|
1 | | -'use client'; |
| 1 | +import ArtworkRotation from '../components/ArtworkRotation'; |
2 | 2 |
|
3 | | -import Image from 'next/image'; |
4 | | -import Link from 'next/link'; |
5 | | -import { useState, useEffect } from 'react'; |
6 | | - |
7 | | -const SKETCH_PATHS = [ |
8 | | - '/images/sunflowersketch.png', |
9 | | - '/images/handrose.png', |
10 | | - '/images/peony.png', |
11 | | - '/images/hummingbird.png', |
12 | | - '/images/howl.png', |
13 | | - '/images/hokusai.png', |
14 | | - '/images/christ.png', |
15 | | - '/images/metro.png', |
16 | | - '/images/wave.png', |
17 | | - '/images/room.png', |
18 | | - '/images/angel.png', |
19 | | -] as const; |
20 | | - |
21 | | -const ROTATION_INTERVAL = 3000; |
22 | | - |
23 | | -const HomePage = () => { |
24 | | - const [currentIndex, setCurrentIndex] = useState(0); |
25 | | - |
26 | | - useEffect(() => { |
27 | | - // Rotate sketches |
28 | | - const timer = setInterval(() => { |
29 | | - setCurrentIndex((prev) => (prev + 1) % SKETCH_PATHS.length); |
30 | | - }, ROTATION_INTERVAL); |
31 | | - |
32 | | - return () => { |
33 | | - clearInterval(timer); |
34 | | - }; |
35 | | - }, []); |
36 | | - |
37 | | - useEffect(() => { |
38 | | - // Prevent scrolling on homepage |
39 | | - document.documentElement.style.overflow = 'hidden'; |
40 | | - document.body.style.overflow = 'hidden'; |
41 | | - |
42 | | - return () => { |
43 | | - document.documentElement.style.overflow = ''; |
44 | | - document.body.style.overflow = ''; |
45 | | - }; |
46 | | - }, []); |
47 | | - |
48 | | - return ( |
49 | | - <div className="fixed inset-0 md:left-64 flex items-center justify-center overflow-hidden"> |
50 | | - <div className="relative w-full h-full max-w-6xl px-8 flex items-center justify-center"> |
51 | | - <div className="relative w-full h-[75vh] select-none"> |
52 | | - <Image |
53 | | - src={SKETCH_PATHS[currentIndex]} |
54 | | - alt="sketch" |
55 | | - fill |
56 | | - className="object-contain opacity-90" |
57 | | - priority |
58 | | - draggable={false} |
59 | | - sizes="(max-width: 768px) 100vw, 1280px" |
60 | | - /> |
61 | | - </div> |
62 | | - </div> |
63 | | - |
64 | | - <Link |
65 | | - href="/about" |
66 | | - className="absolute bottom-8 right-8 text-sm text-japanese-sumiiro dark:text-japanese-shironezu hover:underline" |
67 | | - > |
68 | | - about |
69 | | - </Link> |
70 | | - </div> |
71 | | - ); |
72 | | -}; |
73 | | - |
74 | | -export default HomePage; |
| 3 | +export default function HomePage() { |
| 4 | + return <ArtworkRotation />; |
| 5 | +} |
0 commit comments