Menu

Googly eyes for any element with one attribute (and the spring that makes them wobble)
📰

Googly eyes for any element with one attribute (and the spring that makes them wobble)

DEV Community: javascript·Frantisek Gejdos·about 14 hours ago
#31J7udfk
#devtojavascript#devto#dev#eyes#googly
Long article (485 words) — no AI summary yet.
Reading 0:00
15s threshold

Some ideas don't need a business case. I wanted to put googly eyes on a logo, so I made Googly Eyes : add one attribute to anything and it gets a pair of eyes that follow the cursor. Free, MIT, zero dependencies, about 11 KB.

Live demo: https://fluri.xyz/googly-eyes/

<img src = "logo.svg" data-googly > <h1 data-googly > Hello </h1> <img src = "team.jpg" data-googly = "42,30" > <!-- 42% across, 30% down -->

<script src = "https://cdn.jsdelivr.net/npm/@fluritheme/googly-eyes@1/dist/googly-eyes.global.js" data-auto ></script>

Enter fullscreen mode

Exit fullscreen mode

Eyes that only look are boring

My first version pointed the pupils at the cursor. It worked and it was dull.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.