├── README.md ├── index.js ├── package.json ├── preview-1.gif └── preview-2.gif /README.md: -------------------------------------------------------------------------------- 1 | **Not compatible with Hyper 2.x 😿** 2 | 3 | An extension for [Hyper](https://github.com/zeit/hyper) to replace the cursor with a cat emoji sequence. Why? Because I was bored. 4 | 5 | ![Animated gif of a command line interface with a cat emoji animation as cursor](https://raw.githubusercontent.com/balazssagi/hyper-cat-cursor/master/preview-1.gif) 6 | 7 | # Installation 8 | 9 | Add `hyper-cat-cursor` to the `plugins` array of your `.hyper.js` file. 10 | 11 | # Options 12 | 13 | You may configure the extension by adding a `catCursor` object to the `.hyper.js` file's `config` object. Use the following options: 14 | 15 | ```javascript 16 | catCursor: { 17 | speed: 3000, // length of the sequence in milliseconds 18 | fontSize: 60, // font size of the cat in css pixels 19 | cats: ['🐱', '🙀', '😾', '😿', '😹', '😼', '😺', '😻', '😸', '😽'] // custom cat sequence. only cats are accepted, of course 20 | }, 21 | ``` 22 | 23 | So you can easily create abominations like this: 24 | 25 | ![Animated gif of a command line interface with a cat emoji animation as cursor](https://raw.githubusercontent.com/balazssagi/hyper-cat-cursor/master/preview-2.gif) 26 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | function createAnimation(chars) { 2 | let anim = ''; 3 | chars.forEach((char, i) => { 4 | anim += ` 5 | ${(i / chars.length) * 100}% { 6 | content: '${char}' 7 | }`; 8 | }); 9 | return anim; 10 | } 11 | 12 | exports.decorateConfig = (config) => { 13 | const catConfig = Object.assign({ 14 | fontSize: config.fontSize, 15 | speed: 1000, 16 | cats: ['🐱', '😺'], 17 | }, config.catCursor); 18 | 19 | return Object.assign({}, config, { 20 | cursorColor: 'transparent', 21 | termCSS: ` 22 | ${config.termCSS || ''} 23 | .cursor-node::after { 24 | content: '${catConfig.cats[0]}'; 25 | font-size: ${catConfig.fontSize}px; 26 | position: absolute; 27 | left: 0; 28 | right: 0; 29 | bottom: 0; 30 | animation: cat ${catConfig.speed}ms linear infinite; 31 | } 32 | 33 | @keyframes cat { 34 | ${createAnimation(catConfig.cats)} 35 | }`, 36 | }); 37 | }; 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hyper-cat-cursor", 3 | "version": "1.0.2", 4 | "description": "Hyper extension to replace your cursor with a cat emoji sequence. Why? Because I was bored.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/balazssagi/hyper-cat-cursor.git" 12 | }, 13 | "keywords": [ 14 | "hyper", 15 | "cat", 16 | "emoji" 17 | ], 18 | "author": "balazssagi", 19 | "license": "MIT" 20 | } 21 | -------------------------------------------------------------------------------- /preview-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balazssagi/hyper-cat-cursor/36d9e7d9b71758dd146e8a3cbe99308fc397d79d/preview-1.gif -------------------------------------------------------------------------------- /preview-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balazssagi/hyper-cat-cursor/36d9e7d9b71758dd146e8a3cbe99308fc397d79d/preview-2.gif --------------------------------------------------------------------------------