diff --git a/components/FamousTemplate.tsx b/components/FamousTemplate.tsx index aec3ef1..8a3bfd8 100644 --- a/components/FamousTemplate.tsx +++ b/components/FamousTemplate.tsx @@ -39,7 +39,7 @@ const FamousTemplate: React.FC = () => {

- Scene Sparks + Hot Templates

{(["all", "music", "animation", "thriller"] as const).map((tab) => ( @@ -50,7 +50,7 @@ const FamousTemplate: React.FC = () => { onClick={() => setActiveTab(tab)} className={`px-3 py-1 italic rounded-none text-sm transition-colors border ${ activeTab === tab - ? "border-white/60 bg-white/80 text-slate-900" + ? "border-white/60 bg-white/60 text-slate-900" : "border-white/20 text-white/80 hover:border-white/40 hover:bg-white/10" }`} > diff --git a/components/HomeBanner.tsx b/components/HomeBanner.tsx index 0943b0c..6d24d36 100644 --- a/components/HomeBanner.tsx +++ b/components/HomeBanner.tsx @@ -1,7 +1,9 @@ "use client"; -import { useEffect, useState } from "react"; +import { useEffect, useState, useRef } from "react"; import { fetchSettingByCode } from "@/api/serversetting"; +import { X, Eclipse } from "lucide-react"; +import { ChatInputBox } from "@/components/ChatInputBox/ChatInputBox"; export const HOME_BANNER_CODE = "homeBanner"; @@ -34,6 +36,32 @@ export default function HomeBanner() { const [config, setConfig] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); + const [isFlying, setIsFlying] = useState(false); + const autoCollapseTimerRef = useRef | null>(null); + + const handleDismiss = () => { + setIsFlying(true); + }; + + const handleBannerClick = () => { + if (isFlying) { + setIsFlying(false); + } + }; + + // Auto collapse after mount (3s) + useEffect(() => { + if (autoCollapseTimerRef.current) return; + autoCollapseTimerRef.current = setTimeout(() => { + setIsFlying(true); + }, 3000); + return () => { + if (autoCollapseTimerRef.current) { + clearTimeout(autoCollapseTimerRef.current); + autoCollapseTimerRef.current = null; + } + }; + }, []); useEffect(() => { let active = true; @@ -98,62 +126,91 @@ export default function HomeBanner() { } return ( -
- {backgroundImage ? ( - - ) : null} - {backgroundImage ? ( -
- ) : null} - -
+ {/* Banner overlay - stacked above */} +
- {eyebrow ? ( - - {eyebrow} - + {backgroundImage ? ( + ) : null} - {title ? ( -

- {title} -

+ {backgroundImage ? ( +
) : null} - {subtitle ? ( -

{subtitle}

- ) : null} - {description ? ( -

{description}

- ) : null} - {ctaLabel ? ( - ctaHref ? ( - - {ctaLabel} - - ) : ( + +
+ {/* Dismiss button */} +
- ) - ) : null} +
+ {isFlying ? ( + + ) : null} + {eyebrow ? ( + + {eyebrow} + + ) : null} + {title ? ( +

+ {title} +

+ ) : null} + {subtitle ? ( +

{subtitle}

+ ) : null} + {description ? ( +

{description}

+ ) : null} + {ctaLabel ? ( + ctaHref ? ( + + {ctaLabel} + + ) : ( + + ) + ) : null} +
+
+ + {/* Base content - always present under the banner */} +
+
-
+
); -} +} \ No newline at end of file