Skip to content

Commit a14126b

Browse files
committed
add: reg closes scrolling banner
1 parent 0f09cb6 commit a14126b

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/app/layout.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import TEDxStarsCanvas from "@/components/ui/stars";
66
import Script from "next/script";
77
import { ScrollProgressBar } from "@/components/common/scroll-progress";
88
import Footer from "@/components/common/footer";
9+
import ScrollingBanner from "@/components/common/scrolling-banner";
910
const inter = Inter({ subsets: ["latin"] });
1011
export const metadata: Metadata = {
1112
title: "TEDxSJEC",
@@ -43,6 +44,7 @@ export default function RootLayout({
4344
</head>
4445
<body className={(inter.className = "overflow-x-hidden")}>
4546
<ScrollProgressBar />
47+
<ScrollingBanner />
4648
<TEDxStarsCanvas />
4749
<Providers>{children} </Providers>
4850
<Footer />
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"use client";
2+
3+
import { motion } from "framer-motion";
4+
5+
export default function ScrollingBanner() {
6+
const sentence = " Registrations close soon • ";
7+
const repeatCount = 20; // Increase this number to add more repetitions
8+
9+
return (
10+
<div className="bg-gradient-to-b from-transparent from-60% via-redTheme via-75% to-transparent to-90% h-fit text-whiteTheme overflow-hidden py-2">
11+
<motion.div
12+
className="whitespace-nowrap inline-block mt-20 pb-4"
13+
animate={{
14+
x: ["0%", "-50%"],
15+
}}
16+
transition={{
17+
x: {
18+
repeat: Infinity,
19+
repeatType: "loop",
20+
duration: 15, // Reduced from 20 to 15 to speed up the animation
21+
ease: "linear",
22+
},
23+
}}
24+
>
25+
<span className="text-lg font-semibold px-4">
26+
{sentence.repeat(repeatCount)}
27+
</span>
28+
</motion.div>
29+
</div>
30+
);
31+
}

0 commit comments

Comments
 (0)