Skip to content

Commit 9b86ba0

Browse files
Add Commercial Tape ticker
Implemented a new CommercialTape component that displays a scrolling, marquee-style USP ticker with 5 items (supporting English and Arabic), paused on hover. Integrated into the homepage above the navigation with hybrid palette. Updated CSS for marquee animation and RTL support, and wired the component into the Index page. X-Lovable-Edit-ID: edt-590b2072-dc1b-4578-ae41-8f90dfe6035f
2 parents f435310 + c9d2935 commit 9b86ba0

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

src/components/CommercialTape.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { useLanguage } from "@/contexts/LanguageContext";
2+
3+
const advantages = [
4+
{ en: "Pharmacist-Vetted: 5,000+ Premium SKUs", ar: "بإشراف صيدلاني: أكثر من 5,000 منتج طبي فاخر" },
5+
{ en: "The Asper Experience: Same-Day Amman Delivery", ar: "تجربة أسبر: توصيل في نفس اليوم داخل عمّان" },
6+
{ en: "Gold Standard: 100% Guaranteed Authenticity & JFDA Certified", ar: "المعيار الذهبي: أصالة مضمونة 100% ومعتمد من الغذاء والدواء" },
7+
{ en: "Cruelty-Free, Ethical & Dermatologist Tested", ar: "خالٍ من القسوة، أخلاقي ومختبر من أطباء جلدية" },
8+
{ en: "Experience the 3-Click AI Regimen Analysis", ar: "جرّبي تحليل الروتين بالذكاء الاصطناعي بـ3 نقرات" },
9+
];
10+
11+
const CommercialTape = () => {
12+
const { locale } = useLanguage();
13+
14+
// Duplicate items for seamless loop
15+
const items = [...advantages, ...advantages];
16+
17+
return (
18+
<div
19+
className="commercial-tape relative w-full overflow-hidden bg-accent h-10 flex items-center z-[60]"
20+
role="marquee"
21+
aria-label={locale === "ar" ? "مزايا أسبر بيوتي شوب" : "Asper Beauty Shop advantages"}
22+
>
23+
<div className="commercial-tape-track flex items-center whitespace-nowrap">
24+
{items.map((item, i) => (
25+
<span key={i} className="inline-flex items-center">
26+
<span className="font-body text-sm font-medium text-accent-foreground px-4 select-none">
27+
{locale === "ar" ? item.ar : item.en}
28+
</span>
29+
<span
30+
className="text-accent-foreground/50 text-xs select-none"
31+
aria-hidden="true"
32+
>
33+
34+
</span>
35+
</span>
36+
))}
37+
</div>
38+
</div>
39+
);
40+
};
41+
42+
export default CommercialTape;

src/index.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,25 @@
305305
transform: rotate(360deg);
306306
}
307307

308+
/* ─── Commercial Tape Marquee ─── */
309+
.commercial-tape:hover .commercial-tape-track {
310+
animation-play-state: paused;
311+
}
312+
.commercial-tape-track {
313+
animation: marquee-scroll 35s linear infinite;
314+
}
315+
[dir="rtl"] .commercial-tape-track {
316+
animation: marquee-scroll-rtl 35s linear infinite;
317+
}
318+
@keyframes marquee-scroll {
319+
0% { transform: translateX(0); }
320+
100% { transform: translateX(-50%); }
321+
}
322+
@keyframes marquee-scroll-rtl {
323+
0% { transform: translateX(0); }
324+
100% { transform: translateX(50%); }
325+
}
326+
308327
/* ─── Mobile Bottom Nav Spacing ─── */
309328
@media (max-width: 768px) {
310329
.mobile-bottom-pad {

src/pages/Index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const PromoBanner = lazy(() => import("@/components/home/PromoBanner"));
2020
const SocialGallery = lazy(() => import("@/components/home/SocialGallery"));
2121
const Newsletter = lazy(() => import("@/components/home/Newsletter"));
2222
import ScrollProgress from "@/components/ScrollProgress";
23+
import CommercialTape from "@/components/CommercialTape";
2324
import AuthButton from "@/components/AuthButton";
2425
import MobileBottomNav from "@/components/MobileBottomNav";
2526
import MegaMenu from "@/components/MegaMenu";
@@ -49,6 +50,9 @@ const Index = () => {
4950

5051
return (
5152
<div className="min-h-screen bg-background mobile-bottom-pad" dir={dir}>
53+
{/* Commercial Tape — USP ticker */}
54+
<CommercialTape />
55+
5256
{/* Gold scroll progress bar */}
5357
<ScrollProgress />
5458

0 commit comments

Comments
 (0)