{"id":13547205,"url":"https://github.com/lindelof/power-mode-input","last_synced_at":"2025-04-02T19:32:44.935Z","repository":{"id":57329087,"uuid":"229732807","full_name":"lindelof/power-mode-input","owner":"lindelof","description":"PowerModeInput can make your text input box more compelling","archived":false,"fork":false,"pushed_at":"2021-03-19T12:46:16.000Z","size":2907,"stargazers_count":92,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-03T15:38:34.548Z","etag":null,"topics":["input","magic-input","particle","particles","tiny"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/power-mode-input-y39l6","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/lindelof.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":"2019-12-23T10:48:52.000Z","updated_at":"2024-10-15T13:00:02.000Z","dependencies_parsed_at":"2022-09-01T11:41:39.986Z","dependency_job_id":null,"html_url":"https://github.com/lindelof/power-mode-input","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lindelof%2Fpower-mode-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lindelof%2Fpower-mode-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lindelof%2Fpower-mode-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lindelof%2Fpower-mode-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lindelof","download_url":"https://codeload.github.com/lindelof/power-mode-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246880266,"owners_count":20848836,"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":["input","magic-input","particle","particles","tiny"],"created_at":"2024-08-01T12:00:52.431Z","updated_at":"2025-04-02T19:32:42.369Z","avatar_url":"https://github.com/lindelof.png","language":"JavaScript","funding_links":[],"categories":["🚀 A series of exquisite and compact web page cool effects"],"sub_categories":["Input Effect"],"readme":"# PowerModeInput\n\n[![NPM](https://img.shields.io/npm/v/power-mode-input.svg)](https://www.npmjs.com/package/power-mode-input) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\u003e PowerModeInput can make your text input box more compelling\n\nThis project can make your input box lively. One day I saw a vscode plugin called [`Power Mode`](https://marketplace.visualstudio.com/items?itemName=hoovercj.vscode-power-mode), so I wanted to write a similar javascript library. This project uses [`proton.js`](https://github.com/drawcall/Proton) and it is also great.\n\n#### By the way recommend a great react particle animation background component [https://github.com/lindelof/particles-bg](https://github.com/lindelof/particles-bg)\n\n### Online demo\n* demo [https://codesandbox.io/s/power-mode-input-y39l6](https://codesandbox.io/s/power-mode-input-y39l6)\n\n![](https://github.com/lindelof/power-mode-input/blob/master/image/01.gif?raw=true)\n\n\n## Install\n\n```bash\nnpm install --save power-mode-input\n```\n\n## Usage\n\n```jsx\nimport PowerModeInput from \"power-mode-input\";\n\nconst input = document.getElementById(\"obinput\");\nPowerModeInput.make(input);\n\n// close PowerModeInput\nPowerModeInput.close(input);\n\n// destroy PowerModeInput\nPowerModeInput.destroy();\n\n// another usage\nPowerModeInput.make(\".phone\", {\n  height: 5,\n  tha: [0, 360],\n  g: 0.5,\n  num: 5,\n  radius: 6,\n  circle: true,\n  alpha: [0.75, 0.1],\n  color: \"random\"\n});\n```\n\n#### If you are in `react`, you can use it like this\n```jsx\ncomponentDidMount(){\n  PowerModeInput.make(this.inputRef.current);\n}\n```\n\n#### You can use it like this in `vue.js`\n```vue\nmounted() {\n  PowerModeInput.make(this.$refs.inputRef);\n}\n```\n\n#### Of course this can be done in `angular`\n```javascript\nconst inputElement = this.elementRef.nativeElement.querySelector('input');\nPowerModeInput.make(inputElement);\n```\n\n## Parameter Description\n```javascript\nPowerModeInput.make(input, {\n  height: 5,\n  tha: [0, 360],\n  g: 0.5,\n  num: 5,\n  ... // Parameter\n});\n```\n\nkey | describe |type | example\n----|-----|-----|------\n`g` | Whether to add gravity | number | `1`\n`num` | The number of particles emitted each time | number | `3`\n`radius` | The radius of every particle | number | `10`\n`alpha` | The alpha of every particle | number | `.1`\n`tha` | The Particle emitter angle | array | `[0, 360]`\n`v` | The Particle emitter Particle velocity | number | `0.5`\n`life` | The life of every particle | number | `1.2`\n`color` | Particle color  | array or string | `#ffcccc`\n`random` | Random force | number | `1.2`\n`y` | Particle emitter height  | number | `2`\n`height` | Particle emitter height Ibid  | number | `2`\n\n---\n\n## Explanation\nFor some special types of input boxes, the cursor may not be positioned correctly. I am also looking for a solution to this problem. If you know, please let me know. [See here for specific reasons](https://stackoverflow.com/questions/21177489/selectionstart-selectionend-on-input-type-number-no-longer-allowed-in-chrome)\n\n## Contribution\nI very much hope that you can work with me to modify the code. I also have a lot of fun ideas. Maybe you can join me to implement it.\n\n## License\n\nhttps://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flindelof%2Fpower-mode-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flindelof%2Fpower-mode-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flindelof%2Fpower-mode-input/lists"}