← Blurr Motion pricing-magnetic-cta-minimal
Categorie pricing Tier 1 Techniek #12 Deps
1. Mechanisme — kopieer 1-op-1, geen styling-keuzes
// Mechanisme: pricing-magnetic-cta-minimal
import gsap from 'https://esm.sh/[email protected]';
// Pas toe op je eigen selector — geen stijlkeuzes hier.
if(window.matchMedia('(prefers-reduced-motion: reduce)').matches)return;
const MAG_LERP=0.18, MAG_PULL=0.3, MAG_RESET_DUR=0.8, MAG_EASE='power2.out';
document.querySelectorAll('.magnetic').forEach(el=>{
const xTo=gsap.quickTo(el,'x',{duration:MAG_LERP,ease:MAG_EASE});
const yTo=gsap.quickTo(el,'y',{duration:MAG_LERP,ease:MAG_EASE});
el.addEventListener('mousemove',e=>{const r=el.getBoundingClientRect();xTo((e.clientX-r.left-r.width/2)*MAG_PULL);yTo((e.clientY-r.top-r.height/2)*MAG_PULL);});
el.addEventListener('mouseleave',()=>{gsap.to(el,{x:0,y:0,duration:MAG_RESET_DUR,ease:MAG_EASE});});});
2. Skeleton — DOM + class-namen, mag herschikken
<!-- Skeleton: pricing-magnetic-cta-minimal -->
<div class="demo-block">
  <!-- DOM-structuur hier -->
</div>
3. Styling-template — verplicht eigen invulling per merk
/* Styling: pricing-magnetic-cta-minimal */
:root {
  --block-bg: ;
  --block-fg: ;
  --block-accent: ;
}