Patterns Easy
Mouse Light + Magnetic Button
Cursor spotlight and magnetic button hover interactions.
pointer-eventsui-interaction
Targets: JS HTML
Code
body { margin: 0; min-height: 100vh; display: grid; place-content: center; background: #04080f; color: #f2f7ff; font-family: "Avenir Next", sans-serif; overflow: hidden; }
.back { position: fixed; top: 14px; left: 14px; color: #86e8ff; text-decoration: none; z-index: 10; }
main { position: relative; z-index: 4; text-align: center; }
h1 { margin: 0 0 1rem; font-size: clamp(1.8rem, 6vw, 3.2rem); }
button { border: 0; border-radius: 999px; padding: .9rem 1.2rem; font-weight: 700; background: #86e8ff; color: #072131; cursor: pointer; transition: transform .15s; }
.spot { position: fixed; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, #7ee7ff70 0%, transparent 70%); pointer-events: none; transform: translate(-50%, -50%); }Mouse Light + Magnetic Button
Cursor spotlight and magnetic button hover interactions.
Source
- Repository:
libs-gen - Original demo id:
06-mouse-light-magnetic
Notes
Cursor spotlight and magnetic button hover interactions.