diff --git a/public/images/hero-image.png b/public/images/hero-image.png new file mode 100644 index 0000000..518e5bb Binary files /dev/null and b/public/images/hero-image.png differ diff --git a/src/components/banner/HeroBanner.js b/src/components/banner/HeroBanner.js index a10d99b..b0fbb44 100644 --- a/src/components/banner/HeroBanner.js +++ b/src/components/banner/HeroBanner.js @@ -1,16 +1,38 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState, useRef } from 'react'; import useWindowWidth from '@/hooks/useWindowWidth'; import Image from 'next/image'; +import { useImageProxy } from '@/hooks/useImageProxy'; +import { useRouter } from 'next/router'; +import GenericButton from '../buttons/GenericButton'; +import HeroImage from '../../../public/images/hero-image.png'; const HeroBanner = () => { - const options = ['Bitcoin', 'Lightning', 'Nostr']; - const [currentOption, setCurrentOption] = useState(0); - const [isFlipping, setIsFlipping] = useState(false); - + const [currentTech, setCurrentTech] = useState('Bitcoin'); + const [isAnimating, setIsAnimating] = useState(false); + const techs = ['Bitcoin', 'Lightning', 'Nostr']; const windowWidth = useWindowWidth(); + const isTabView = windowWidth <= 1360; + const router = useRouter(); + const { returnImageProxy } = useImageProxy(); + const videoRef = useRef(null); - const getColorClass = (option) => { - switch (option) { + useEffect(() => { + const interval = setInterval(() => { + setIsAnimating(true); + setTimeout(() => { + setCurrentTech(prev => { + const currentIndex = techs.indexOf(prev); + return techs[(currentIndex + 1) % techs.length]; + }); + setIsAnimating(false); + }, 400); // Half of the interval for smooth transition + }, 2800); + + return () => clearInterval(interval); + }, []); + + const getColorClass = (tech) => { + switch (tech) { case 'Bitcoin': return 'text-orange-400'; case 'Lightning': return 'text-blue-500'; case 'Nostr': return 'text-purple-400'; @@ -18,44 +40,61 @@ const HeroBanner = () => { } }; - useEffect(() => { - const interval = setInterval(() => { - setIsFlipping(true); - setTimeout(() => { - setCurrentOption((prevOption) => (prevOption + 1) % options.length); - setTimeout(() => { - setIsFlipping(false); - }, 400); // Start preparing to flip back a bit before the halfway point - }, 400); // Update slightly before the midpoint for smoother transition - }, 2500); // Increased to provide a slight pause between animations for readability - - return () => clearInterval(interval); - }, []); + // useEffect(() => { + // videoRef.current.play(); + // }, []); return ( -
Learn how to code
-
- Build{' '}
-
- {options[currentOption]}
+ Become a developer
+ Learn to code
+
+ Build {currentTech} apps
- {' '}Apps
-
-
+ A one of a kind developer education and community platform built on Nostr and fully Lightning integrated.
+
+