adryd325 / oneko.js

Cat follow mouse real! A hacky script I wrote to put a cat on my site.
MIT License
695 stars 68 forks source link

Add Cat Petting Feature #26

Closed tylxr59 closed 5 months ago

tylxr59 commented 6 months ago

This version can be viewed on my site - tylxr.com

dualfighter1 commented 6 months ago

There is a bug where the location of the cat and hearts can desync, I managed to consistently do this by using the back arrow to return to the page from another page, causing the cat to quickly move targets. I apologise but that is the most accurate I could get the description of it. image

tylxr59 commented 6 months ago

@dualfighter1 I made some changes on my site, can you see if that still happens now? I wasn't able to reproduce the bug myself

dualfighter1 commented 6 months ago

I can still reproducce the issue, my exact steps are:

  1. Have the cat moving down
  2. Click the visitors link at the bottom of your page
  3. Click the back button on my browser (Firefox)
  4. Have the cat start moving up again
tylxr59 commented 6 months ago

Super strange. I tried a couple different ways but couldn't reproduce the bug. I'm on Firefox Dev Edition 126.0b9. I wonder if it's something with the getBoundingClientRect.

If you'd entertain me, could you reproduce it again and provide the output of your Console log in Dev Tools? Should look something like this

image

dualfighter1 commented 6 months ago

I figured it out, its a bug with scrolling, the hearts dont move while scrolling yet the cat does.

tylxr59 commented 6 months ago

Ahhh, that makes more sense. I'll try to fix that. tyvm for the feedback

dualfighter1 commented 6 months ago

No problem.

adryd325 commented 6 months ago

I'm probably not gonna be merging any new features since its meant to be a simple base for people to build off of, but I'm happy to link your fork in the readme

tylxr59 commented 5 months ago

For sure! I totally understand. Thatd be awesome if you'd want to link back to my repo :)