| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
- #쇼핑몰
- 이미지
- #웹솔루션
- #업종별
- javascript
- 홈페이지
- #홈페이지
- #이미지
- 사이트제작
- #CSS
- 게시판
- #happycgi
- 솔루션
- #해피CGI
- #홈페이지제작
- #cgimall
- 웹솔루션
- 해피CGI
- #뉴스
- #솔루션
- CGIMALL
- 홈페이지제작
- CSS
- jquery
- 해피씨지아이
- php
- #image
- #동영상
- happycgi
- #jQuery
- Today
- Total
웹솔루션개발 26년 노하우! 해피CGI의 모든것
[해피CGI][cgimall] 3D 입체 이미지 슬라이드 본문
3D 회전 효과와 부드러운 움직임이 적용된 이미지 슬라이드 예제입니다.
현재 선택된 이미지는 중앙에 크게 강조되고, 양쪽 이미지는 기울어진 형태로 배치되어 입체적인 화면 구성을 만들 수 있습니다.
이전/다음 버튼을 통해 이미지를 이동할 수 있으며, 하단 점 버튼과 이미지 클릭을 통해 원하는 이미지로 바로 이동할 수 있습니다.일반적인 이미지 슬라이드보다 시각적인 집중도가 높아 포트폴리오, 갤러리, 브랜드 소개, 상품 이미지, 이벤트 화면 등에 활용하기 좋습니다.

HTML 구조
<div id="app"></div>
CSS 소스
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');
* {
box-sizing: border-box;
}
body {
min-height: 100vh;
background-color: #ececec;
font-family: "Bricolage Grotesque", sans-serif;
display: grid;
place-content: center;
overflow: hidden;
}
JS 소스
import React, { useState, useEffect } from "https://esm.sh/react@19"
import { createRoot } from "https://esm.sh/react-dom@19/client"
import { motion } from "https://esm.sh/motion/react"
import { ChevronLeft, ChevronRight } from "https://esm.sh/lucide-react"
const ASSETS = [
{
title: 'urban exploration',
},
{
title: 'night scene',
},
{
title: 'yellow wildflowers',
},
{
title: 'street with mount fuji',
},
{
title: 'bridgestone bicycle shop',
},
{
title: 'train window view',
},
{
title: 'train tracks',
},
{
title: 'lawson convenience store',
},
{
title: 'street scene',
},
{
title: 'japanese culture',
},
]
const App = () => {
const [activeIndex, setActiveIndex] = useState(3)
const toPrev = () => {
setActiveIndex(prev => Math.max(0, prev - 1))
}
const toNext = () => {
setActiveIndex(prev => Math.min(ASSETS.length - 1, prev + 1))
}
const toSlide = (index) => {
setActiveIndex(index)
}
return (
<div className="p-2 text-neutral-800 select-none">
{/* carousel wrapper */}
<div className="w-30 md:w-50 mt-8">
{/* slides container */}
<motion.div
className="flex w-fit"
animate={{ x: `${-activeIndex * 100 / ASSETS.length}%` }}
transition={{ type: 'spring', bounce: 0.2, duration: 0.8 }}
>
{ASSETS.map((item, i) => {
const isActive = activeIndex === i
{/* slide */}
return (
<div className="perspective-midrange" key={i}>
<motion.div
className="w-30 md:w-50 aspect-3/4 flex flex-col items-center gap-2 will-change-[transform,scale]"
animate={{ rotateY: (activeIndex - i) * 60, scale: isActive ? 1 : 0.85 }}
transition={{ type: 'spring', bounce: 0.1, duration: 1 }}
>
<img src={item.src} alt={item.title} className="w-full h-full object-cover rounded-lg" onClick={() => toSlide(i)} />
<motion.div
className="text-xs md:text-sm whitespace-nowrap will-change-[opacity,filter]"
animate={{ filter: isActive ? 'blur(0)' : 'blur(2px)', opacity: isActive ? 1 : 0 }}
>
{item.title}
</motion.div>
</motion.div>
</div>
)
})}
</motion.div>
</div>
{/* controls */}
<div className="fixed bottom-4 left-0 right-0 w-fit px-2 mx-auto flex items-center gap-4 justify-center text-neutral-700 rounded-full bg-neutral-200/50 px-2 backdrop-blur-xs border border-neutral-200/80 shadow-sm">
{/* prev button */}
<button onClick={toPrev} className="p-2 cursor-pointer">
<ChevronLeft />
</button>
{/* slide dots */}
<div className="w-[180px] flex justify-center items-center gap-2">
{ASSETS.map((_, i) => (
<div
key={i}
onClick={() => toSlide(i)}
className={`rounded-full cursor-pointer h-2 transition-[width,background-color] duration-300 ${activeIndex === i ? 'w-7 bg-current' : 'w-2 bg-current/30'}`}>
</div>
))}
</div>
{/* next button */}
<button onClick={toNext} className="p-2 cursor-pointer">
<ChevronRight />
</button>
</div>
</div>
)
}
const root = createRoot(document.getElementById("app"))
root.render(<App />)
'웹프로그램밍 자료실 > 기타 자료' 카테고리의 다른 글
| [해피CGI][cgimall] Material Design Floating Action Share Button 플로팅 액션 공유 버튼 (0) | 2026.07.22 |
|---|---|
| [해피CGI][cgimall] 반응형 확장 이미지 카드 (0) | 2026.07.21 |
| [해피CGI][cgimall] 마우스를 따라 다니는 글씨들 Letters mouse follow (0) | 2026.07.07 |
| [해피CGI][cgimall] 비디오 버튼 Video button animation - Only CSS (0) | 2026.07.03 |
| [해피CGI][cgimall] Cred App Like Tab Bar Interaction 탭메뉴 css 상호작용 (0) | 2026.06.18 |

