{"id":17402328,"url":"https://github.com/malash/illusion-number","last_synced_at":"2025-04-15T18:24:39.559Z","repository":{"id":57271827,"uuid":"42921617","full_name":"malash/illusion-number","owner":"malash","description":"Implementing an illusion number transform.","archived":false,"fork":false,"pushed_at":"2015-10-29T11:07:25.000Z","size":221,"stargazers_count":25,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T23:22:38.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://malash.me/201510/illusion-number/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-22T08:34:03.000Z","updated_at":"2024-05-03T11:14:21.000Z","dependencies_parsed_at":"2022-08-31T00:01:59.170Z","dependency_job_id":null,"html_url":"https://github.com/malash/illusion-number","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malash%2Fillusion-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malash%2Fillusion-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malash%2Fillusion-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malash%2Fillusion-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malash","download_url":"https://codeload.github.com/malash/illusion-number/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550633,"owners_count":21122934,"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":[],"created_at":"2024-10-16T17:26:12.531Z","updated_at":"2025-04-15T18:24:39.542Z","avatar_url":"https://github.com/malash.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Illusion Number\n\n![Illusion Number Gif](https://gist.githubusercontent.com/malash/9ff5b2897f05d0fae6dd/raw/1b069c33becefa4ca5c19efc955bbc1bc67f441a/illusion-number.gif)\n\n## Overview\n\nImplementing an illusion number transform as showing in GIF written in Javascript and CSS.\nI find the GIF image from SNS website and don't know its source. Please leave me a issuse if you know it and I will be appreciate for you :)\n\n## Demo\n\nTimer: [https://rawgit.com/malash/illusion-number/master/example/index.html](https://rawgit.com/malash/illusion-number/master/example/index.html)\n\nDatetime: [https://rawgit.com/malash/illusion-number/master/example/datetime.html](https://rawgit.com/malash/illusion-number/master/example/datetime.html)\n\nYou can find more demos in the `example` folder.\n\n## Usage\n\nUse `bower`  to install `illusion-number` to your project:\n\n```bash\n$ bower install illusion-number\n```\n\nThen include `.js` and `.css` files:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"/beep/bower_components/illusion-number/dist/illusion-number.min.css\"\u003e\n\u003cscript src=\"/beep/bower_components/illusion-number/dist/illusion-number.min.js\"\u003e\u003c/script\u003e\n```\n\nPut an empty `div` emelent to your HTML file:\n\n```html\n\u003cdiv id=\"test\"\u003e\u003c/div\u003e\n```\n\nCall global variable `IllusionNumber`'s method `play` with the element and options:\n\n```javascript\nIllusionNumber.play(document.getElementById('test'), {\n  from: '0',\n  to: '1'\n});\n```\n\n## Documentation\n\n### IllusionNumber.play(ele, options)\n\n#### ele\n\nType: `element`\n\nRequired: `true`\n\nThe DOM element to bind\n\n#### options.from\n\nType: `number` or `char`\n\nRequired: `true`\n\n#### options.to\n\nType: `number` or `char`\n\nRequired: `true`\n\nThe animation transforms from `options.from` bitmap to `options.to` bitmap.\n\n#### options.size\n\nType: `number` or `string`\n\nDefault: `250px`\n\nThe animation canvas size. Some valid value: `250`, `'14px'`, `'3em'`, `'2rem'`\n\n#### options.animationDuration\n\nType: `number`\n\nDefault: `1`\n\nThe animation duration defaults to 1 second. The type of value could be `number` or `float`.\n\n#### options.reverse\n\nType: `boolean`\n\nDefault: `false`\n\nIf `options.reverse` is `true`, the anamation direction will be reversed.\n\n### IllusionNumber.setBitmap(char, bitmap)\n\nSet or override a bitmap.\n\nFor example:\n\n```javascript\nIllusionNumber.setBitmap('A', [\n  [0, 1, 0],\n  [1, 0, 0],\n  [1, 1, 1],\n  [1, 0, 1],\n  [1, 0, 1]\n]);\nIllusionNumber.play(document.getElementById('test'), {\n  from: '9',\n  to: 'A'\n});\n\n```\n\n#### char\n\nType: `char`\n\nRequired: `true`\n\nCharacter to set.\n\n#### bitmap\n\nType: `number[][]`\n\nRequired: `true`\n\nCharacter's bitmap. The tile displays for value `1` and hides for value `0` at the same position in 2-dimensional array.\n\n## Development\n\nWe use `gulp` as build system.\n\nFor development:\n\n```bash\nnpm install\ngulp dev\n```\n\nFor build:\n\n```bash\nnpm install\ngulp build\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 [Malash](https://malash.me/) \u003c\u003ci@malash.me\u003e\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalash%2Fillusion-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalash%2Fillusion-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalash%2Fillusion-number/lists"}