Skip to content

Commit

Permalink
rename carousel to ticker
Browse files Browse the repository at this point in the history
  • Loading branch information
dohaki committed Feb 12, 2024
1 parent b280395 commit f0793ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/app/_components/hero.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ComponentProps } from "react";
import { twMerge } from "tailwind-merge";

import { PartnersCarousel } from "./partners-carousel";
import { PartnersTicker } from "./partners-ticker";

type HeroProps = ComponentProps<"section">;

export function Hero({ className, children, ...props }: HeroProps) {
return (
<section className={twMerge("min-h-screen", className)} {...props}>
{children}
<PartnersCarousel />
<PartnersTicker />
</section>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,23 @@ const partners = [
// Duplicate partners to simulate infinite scrolling
const partnersToRender = [...partners, ...partners];

export function PartnersCarousel() {
export function PartnersTicker() {
return (
<>
<div className="mb-8 text-center text-xs uppercase lining-nums tabular-nums tracking-wide-4 text-grey-400">
Integrated Partners
</div>
<div className="w-[calc(2 * var(--no-of-slides))] relative overflow-hidden">
<div className="w-[calc(2 * var(--no-of-slides))] group relative overflow-hidden">
<div className="container mx-auto">
<div className="grid">
<div className="w-[calc(var(--slides-in-view) * var(--slide-width))] flex flex-row overflow-hidden">
{partnersToRender.map((partner, index) => (
<div
key={index}
className="flex h-[var(--slide-height)] w-[var(--slide-width)] flex-auto flex-shrink-0 flex-grow-0 animate-scroll flex-col items-center"
className="animate-scroll flex h-[var(--slide-height)] w-[var(--slide-width)] flex-auto flex-shrink-0 flex-grow-0 flex-col items-center"
>
{/* Note: partner.name only for testing purposes */}
{/* FIXME: remove before deploying to prod */}
<div>{partner.name}</div>
<partner.Logo className="h-8 w-8" />
</div>
Expand All @@ -55,7 +56,7 @@ export function PartnersCarousel() {
</div>
</div>
{/* Fade in/out overlay */}
<div className="absolute bottom-0 left-0 right-0 top-0 h-full w-full overflow-hidden bg-gradient-to-r from-grey-dark via-transparent via-50% to-grey-dark bg-fixed sm:from-10% sm:to-90% xl:from-25% xl:to-75%" />
<div className="via-transparent absolute bottom-0 left-0 right-0 top-0 h-full w-full overflow-hidden bg-gradient-to-r from-grey-dark via-50% to-grey-dark bg-fixed sm:from-10% sm:to-90% xl:from-25% xl:to-75%" />
</div>
</>
);
Expand Down

0 comments on commit f0793ad

Please sign in to comment.