원본 트윗
Design Engineering Tip:
Use cursor velocity, not just cursor position. A fast movement can add more rotation, stretch, or blur for a split second. The interface suddenly feels more physical, because it reacts to motion, not just location.
JS
let x = 0, t = performance. now();
addEventListener("pointermove", e => {
let now = performance. now();
let v = (e.clientX - x) / (now - t);
card. style.transform =
`rotate(${v * 6}deg) scaleX(${1 + Math.abs(v) * .08})`;
x = e.clientX;
t = now;
});
CSS
.card { transition: transform .25s cubic-bezier(.22,1,.36,1); }
좋아요 707 · 리트윗 23
x.com/gabriell_lab/status/2062232102515675385