本文へスキップ

TOP / MOTION LAB / スクロール

スクロール 読了目安 3分

振幅

概要

スクロールの速度を物理的な揺れ・伸縮・歪み・傾きに変換し、素材感のある4種のリアクションを見せる、インタラクション表現のショーケース。

使用技術

実装ポイント

コアスニペット

let velocity = self.getVelocity();
if (velocity > 4000) velocity = 4000;
if (velocity < -4000) velocity = -4000;

// SWING: 速度を角度に換算し、揺れてから減衰
let amplitude = velocity / 80;
amplitude = gsap.utils.clamp(-60, 60, amplitude);
gsap.fromTo(
  hanger,
  { rotate: -amplitude },
  { rotate: 0, duration: 2.5, ease: "elastic.out(1, 0.2)", overwrite: true }
);