Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ovnanova/smoloneko
A hand-minified implementation of oneko.js with touch support
https://github.com/ovnanova/smoloneko
gif javascript minify script web
Last synced: 9 days ago
JSON representation
A hand-minified implementation of oneko.js with touch support
- Host: GitHub
- URL: https://github.com/ovnanova/smoloneko
- Owner: ovnanova
- License: mpl-2.0
- Created: 2024-10-05T20:31:06.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-10-22T05:08:27.000Z (25 days ago)
- Last Synced: 2024-10-23T06:45:57.572Z (24 days ago)
- Topics: gif, javascript, minify, script, web
- Language: HTML
- Homepage: https://ovnanova.github.io/smoloneko/
- Size: 158 KB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 🐱 smol oneko
Want to add `oneko.js` to your site, but 5.41 KB is just too much? Now it's 1.65 KB!
The default image is `oneko.gif` in the same directory as the `index.html`. This allows for a shorter directory reference in the script, which saves a few bytes. This can be changed by modifying the `backgroundImage="url('oneko.gif')` variable in `oneko.js`.
**You should not do this unless your image is formatted as a sprite sheet with the individual frames mapped in the same positions as `oneko.gif`.** Improperly formatted images will **not** display correctly, as the script makes assumptions about the GIF grid.
*Optional: smol oneko also supports mobile via a helper script (minified to 229 bytes)! Add both `oneko.js` and `oneko_touch.js` to your directory with the corresponding `` tags in your HTML.*
**Implementation:**
All scripts for smol oneko are located in the `/scripts` directory, and `oneko.gif` is located in the top-level directory.
```html
<script>src="oneko.js">
src="oneko_touch.js"
```## 📖 Lexicon
The variable names in the scripts have been truncated (and, as a side effect, obfuscated) to reduce file size. If you would like to tweak the scripts to your liking, see the [LEXICON.md](https://github.com/ovnanova/smoloneko/blob/main/LEXICON.md) for help.
## 🏆 Contributing
Feel free to submit a pull request if you see any fixes or further optimizations to be made. If you want to add functionality, I would suggest starting your own fork.
## 📜 License
This project is licensed under the MPL-2.0 License.
## 🤝 Acknowledgments
Credit to [adryd](https://github.com/adryd325/oneko.js) for the original script.
## 📺 Demo
[oneko.webm](https://github.com/user-attachments/assets/c1ce686e-207a-444f-8fc5-aa1b385223df)