本文へスキップ

TOP / MOTION LAB / ギャラリー

ギャラリー 読了目安 3分

3Dギャラリー

概要

カードが円環状に3D配置され、ゆっくり自動回転しながらドラッグでも回せる、ポートフォリオや実績紹介向けのリッチなギャラリー。

使用技術

実装ポイント

コアスニペット

const angleStep = 360 / cardCount;
// Radius calculation with extra room for the reflection
const radius = Math.round((320 / 2) / Math.tan(Math.PI / cardCount)) + 200;

wrappers.forEach((wrapper, index) => {
  const angle = index * angleStep;
  gsap.set(wrapper, {
    rotationY: angle,
    z: radius,
    transformOrigin: `50% 50% ${-radius}px`
  });
});