{"id":16765210,"url":"https://github.com/devlato/react-easter","last_synced_at":"2025-04-10T18:22:18.384Z","repository":{"id":65372888,"uuid":"83618130","full_name":"devlato/react-easter","owner":"devlato","description":"Quite convenient and flexible React component for adding easter eggs to your React app","archived":false,"fork":false,"pushed_at":"2024-12-09T00:31:29.000Z","size":15,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:02:41.918Z","etag":null,"topics":["easter","easter-egg","hotkey","hotkeys","javascript","konami","konamicode","react","rodney","shortcut","shortcuts","timeout"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devlato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-02T01:05:53.000Z","updated_at":"2024-12-09T00:31:33.000Z","dependencies_parsed_at":"2023-01-19T23:35:28.871Z","dependency_job_id":null,"html_url":"https://github.com/devlato/react-easter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlato%2Freact-easter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlato%2Freact-easter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlato%2Freact-easter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlato%2Freact-easter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devlato","download_url":"https://codeload.github.com/devlato/react-easter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248270551,"owners_count":21075794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["easter","easter-egg","hotkey","hotkeys","javascript","konami","konamicode","react","rodney","shortcut","shortcuts","timeout"],"created_at":"2024-10-13T05:28:45.721Z","updated_at":"2025-04-10T18:22:18.366Z","avatar_url":"https://github.com/devlato.png","language":"JavaScript","readme":"# react-easter\n\nEasily add Easter eggs to your React app\n\n\n[![Build Status](https://travis-ci.org/devlato/react-easter.svg?branch=master)](https://travis-ci.org/devlato/react-easter)\n[![Coverage Status](https://coveralls.io/repos/github/devlato/react-easter/badge.svg?branch=master)](https://coveralls.io/github/devlato/react-easter?branch=master)\n[![Code Climate](https://codeclimate.com/github/devlato/react-easter/badges/gpa.svg)](https://codeclimate.com/github/devlato/react-easter)\n[![Issue Count](https://codeclimate.com/github/devlato/react-easter/badges/issue_count.svg)](https://codeclimate.com/github/devlato/react-easter)\n[![npm version](https://badge.fury.io/js/react-easter.svg)](https://badge.fury.io/js/react-easter)\n\n\n## Installation\n\nWith npm:\n\n```sh\n$ npm install --save-dev react-easter\n```\n\nOr with Yarn:\n\n```sh\n$ yarn add react-easter\n```\n\n\n## Usage\n\nThe usage is very simple, there is just a couple of props to pass.\n\n```jsx\nconst EasterEgg = require('react-easter');\n\n// ...\n\nrender() {\n  return (\n    \u003cEasterEgg\n        keys={/* Array of keys to type to trigger the easter egg */}\n        simultaneous={/* Add this prop if keys should be pressed all together */}\n        timeout={/* Duration to show your easter egg, easter egg is displayed forever if prop is not set */}\n        onKeysCoincide={/* Callback to call when the code is correctly inserted*/}\n        onTimeout={/* Callback to call when the timer runs out*/}\u003e\n      {/* Your easter egg JSX goes here */}\n    \u003c/EasterEgg\u003e\n  );\n}\n```\n\nYou can add `react-easter` anywhere in your component hierarchy, because it adds a global\nkeyboard events listener and doesn't stops any event bubbling.\n\nFor example:\n\n```jsx\nconst EasterEgg = require('react-easter');\n\n\nexport default class YourComponent extends React.Component {\n  render() {\n    const konamiCode = [\n      'arrowup',\n      'arrowup',\n      'arrowdown',\n      'arrowdown',\n      'arrowleft',\n      'arrowright',\n      'arrowleft',\n      'arrowright',\n      'b',\n      'a',\n      'enter'\n    ];\n\n    return (\n      \u003cEasterEgg keys={konamiCode}\n                 timeout={5000}\u003e\n        \u003cdiv class=\"overlay\"\u003e\n          \u003ciframe class=\"sexy-nude-geek-girls-playing-mario\"\n                  src=\"https://www.youtube.com/embed/DLzxrzFCyOs?autoplay=1\"\n                  frameborder=\"0\"\n                  allowfullscreen /\u003e\n        \u003c/div\u003e\n      \u003c/EasterEgg\u003e\n    );\n  }\n}\n```\n\n\n## Props\n\n* `keys` – Just array of string representing each button to be pressed;\n* `simultaneous` – Set this prop if user should press buttons all together;\n* `timeout` – Amount of time in milliseconds while easter egg is displayed.\n\n\n## Supported keys\n\nAll alphabetic letters and numbers could be passed as is, i.e. letter \"a\" is just \"a\".\n\nIf you use `simultaneous` mode and you have the `Shift` button in your hotkey combination,\nplease set the unmodified buttons.\n\nFor example, to have a `Shift+!` hotkey, you should pass `keys={[\"shift\", \"1\"]}`,\nbecause \"Shift\" and \"1\" pressed together produce \"!\".\n\n\n## Dependencies\n\nProject uses [react-shortcut](https://www.npmjs.com/package/react-shortcut) to handle keyboard shortcuts.\n\n\n## Test coverage\n\nLibrary has ~100% test coverage:\n\n```sh\n$ npm run test:coverage\n\n\u003e react-easter@1.0.0 test:coverage ~/projects/react-easter\n\u003e NODE_ENV=test jest --coverage --no-cache --config .jestrc\n\n PASS  test/Component.js\n  \u003cEasterEgg /\u003e\n    ✓ Should render (16ms)\n    ✓ Should handle keys sequently without timeout (1032ms)\n    ✓ Should handle keys sequently with timeout (1011ms)\n\n--------------|----------|----------|----------|----------|----------------|\nFile          |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\n--------------|----------|----------|----------|----------|----------------|\nAll files     |      100 |    77.78 |      100 |      100 |                |\n Component.js |      100 |    77.78 |      100 |      100 |                |\n--------------|----------|----------|----------|----------|----------------|\nTest Suites: 1 passed, 1 total\nTests:       3 passed, 3 total\nSnapshots:   0 total\nTime:        3.831s\nRan all test suites.\n```\n\n\n## Code style\n\nLibrary is 100% compatible with [airbnb-base](https://www.npmjs.com/package/eslint-config-airbnb-base) for ES5.\n\n\n## Available commands\n\nLibrary has the following commands available:\n\n* Run the tests:\n\n  ```\n  $ npm test\n  ```\n\n* Run the tests and display test coverage:\n\n  ```\n  $ npm run test:coverage\n  ```\n\n* Run the linter:\n\n  ```\n  $ npm run lint\n  ```\n\n## Build\n\nNo building required, library is implemented with ES5 React syntax for better compatibility and shipped as is.\n\n\n## License\n\nLibrary is shipped \"as is\" under MIT License.\n\n\n## Contributing\n\nFeel free to contribute but don't forget to test everything properly.\n\n\n[![NPM](https://nodei.co/npm/react-easter.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/react-easter/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlato%2Freact-easter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlato%2Freact-easter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlato%2Freact-easter/lists"}