import { useState } from 'react' import { AnimatePresence, motion } from 'framer-motion' import { getBackgroundImage, getPublicPath, getStaticImage } from '@/lib/utils' import { Image, Video } from '@/components' import { useNavigate } from 'react-router-dom' const INTRO_VIEWED_KEY = 'home-intro-viewed' const Home = () => { const navigate = useNavigate() const [showIntroVideo, setShowIntroVideo] = useState(false) const [introViewed, setIntroViewed] = useState( () => localStorage.getItem(INTRO_VIEWED_KEY) === 'true' ) const handleIntroClick = () => { setShowIntroVideo(true) if (!introViewed) { setIntroViewed(true) localStorage.setItem(INTRO_VIEWED_KEY, 'true') } } return (
{/* 课程简介 */} {!showIntroVideo && (
{!introViewed && ( )}
)}
{ navigate('/menu') }} className="absolute bottom-38 left-1/2 -translate-1/2" button src={getStaticImage('home/首页-进入')} /> {showIntroVideo && ( )}
) } export default Home