Skip to content

varthe/oneko-react

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oneko-react

A React port of oneko.js with a few new features:

  • Anchors to the DOM while asleep
  • Clicking on it while awake puts it to sleep and keeps it in place
  • Optionally wakes up automatically when it goes out of view, e.g after scrolling (wakeOutOfView prop)
  • Additional props to control movement speed and animations

Installation

npm install @varthe/oneko-react

Usage example

import { Oneko } from "@varthe/oneko-react"

export const MyComponent = () => {
  return (
    // Use anywhere in the DOM
    <Oneko />
  )
}

Props

Name Description Type Default
speed Movement speed (px/frame) number 10
wakeOutOfView Automatically wake up when out of view (unless manually slept) boolean false
idleAfter Time before idle animation after stopping (ms) number 5000
sleepAfter Time before sleep after stopping (ms) number 10000

About

Cat that follows your mouse

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%