diff --git a/public/images/new/arrow_mobile_1.webp b/public/images/new/arrow_mobile_1.webp new file mode 100644 index 0000000..6498330 Binary files /dev/null and b/public/images/new/arrow_mobile_1.webp differ diff --git a/public/images/new/arrow_mobile_2.webp b/public/images/new/arrow_mobile_2.webp new file mode 100644 index 0000000..34113a6 Binary files /dev/null and b/public/images/new/arrow_mobile_2.webp differ diff --git a/public/images/new/arrow_pc_2.webp b/public/images/new/arrow_pc_2.webp new file mode 100644 index 0000000..629e4c2 Binary files /dev/null and b/public/images/new/arrow_pc_2.webp differ diff --git a/public/images/new/confuse_mobile.webp b/public/images/new/confuse_mobile.webp new file mode 100644 index 0000000..925d289 Binary files /dev/null and b/public/images/new/confuse_mobile.webp differ diff --git a/src/components/new_ui/CyclingImage.tsx b/src/components/new_ui/CyclingImage.tsx index 2d05222..7bf7367 100644 --- a/src/components/new_ui/CyclingImage.tsx +++ b/src/components/new_ui/CyclingImage.tsx @@ -3,12 +3,15 @@ import { useState, useEffect, CSSProperties } from 'react' interface CyclingImageProps { src: string + src2?: string // Optional second image to alternate with position?: CSSProperties['position'] w?: any + maxW?: any left?: any top?: any right?: any bottom?: any + display?: any cycleDuration?: number // Duration of one complete cycle in seconds intensity?: number // How dark/light it gets (0-1, where 1 is maximum) timingFunction?: string // CSS timing function @@ -19,12 +22,15 @@ interface CyclingImageProps { const CyclingImage = ({ src, + src2, position = 'relative', w, + maxW, left, top, right, bottom, + display, cycleDuration = 3, intensity = 0.5, timingFunction = 'ease-in-out', @@ -35,11 +41,23 @@ const CyclingImage = ({ const [isPlaying, setIsPlaying] = useState(autoStart) const [speed, setSpeed] = useState(cycleDuration) const [currentIntensity, setCurrentIntensity] = useState(intensity) + const [currentImage, setCurrentImage] = useState(src) useEffect(() => { setSpeed(cycleDuration) }, [cycleDuration]) + // Handle image alternation if src2 is provided + useEffect(() => { + if (!src2 || !isPlaying) return + + const interval = setInterval(() => { + setCurrentImage(prev => prev === src ? src2 : src) + }, speed * 1000) + + return () => clearInterval(interval) + }, [src, src2, speed, isPlaying]) + const togglePlayPause = () => { setIsPlaying(!isPlaying) } @@ -57,13 +75,13 @@ const CyclingImage = ({ const animationStyle = ` @keyframes ${animationName} { 0% { - filter: brightness(${1 + currentIntensity}); + filter: brightness(${1 - currentIntensity * 1.5}); } 50% { - filter: brightness(${1 - currentIntensity}); + filter: brightness(1); } 100% { - filter: brightness(${1 + currentIntensity}) ; + filter: brightness(${1 - currentIntensity * 1.5}); } } ` @@ -72,16 +90,18 @@ const CyclingImage = ({ <> + {/* Global keyframes for all animations */} + + + {/* Hero 1 title */} hero title - + maxW={{ base: "70%", sm: "70%", md: "70%", lg: "70%", xl: "70%" }} + bottom={'10px'} + display={{ base: "block", sm: "block", md: "none", lg: "none", xl: "none" }} + cycleDuration={0.3} + intensity={0} + /> + {/* Desktop arrow - shown on md, lg, xl */} + {/* signs */} - - + + + - + + + + + + - + right={{ base: '11vw', sm: '11vw', md: '18vw', lg: '18vw', xl: '18vw' }} + top={{ base: '12vw', sm: '12vw', md: '20vw', lg: '20vw', xl: '10vw' }} + css={{ + animation: 'floatSlow 3.3s ease-in-out infinite', + animationDelay: '1.5s' + }} + > + + {/* Warning Texts */} - - + + + - + + + - + + + + w={{ base: "13vw", sm: "13vw", md: "8vw", lg: "8vw", xl: "7vw" }} + right={{ base: "14vw", sm: "14vw", md: "26vw", lg: "26vw", xl: "26vw" }} + top={{ base: "35vw", sm: "35vw", md: "18vw", lg: "18vw", xl: "12vw" }} + css={{ + animation: 'floatFast 3.3s ease-in-out infinite', + animationDelay: '0.9s' + }} + > + + diff --git a/src/components/new_ui/hero2.tsx b/src/components/new_ui/hero2.tsx index d429147..4e36273 100644 --- a/src/components/new_ui/hero2.tsx +++ b/src/components/new_ui/hero2.tsx @@ -11,7 +11,7 @@ function Hero2() {