Logo carousel
The strip of tool logos under the hero on joinstarlight.com: eight monochrome marks drifting in a seamless, edge-faded loop that grow and brighten under the pointer.
Build a React 19 + TypeScript component called LogoCarousel: the strip of tool logos under the hero on joinstarlight.com, a caption over monochrome marks drifting in an endless, edge-faded loop. Constraints - One .tsx file, "use client", imports from react only, default export, no required props. All CSS in a template string rendered as <style href="ui-logo-carousel" precedence="ui">, every class prefixed "lc-". - The root fills its parent: position relative, width/height 100%, overflow hidden, isolation isolate, background #0a0a0f. A centred column with a 24px gap and 24px padding. - Font: var(--font-google-sans-flex, "Google Sans Flex"), system-ui, sans-serif. - Props with defaults: caption "We find and reach your best-fit buyers with the tools you already use", duration 30 (seconds per loop), direction "left" | "right". Content - Caption: 16px/24px, weight 500, #5A5A75, centred, text-wrap balance, max-width 576px. - Eight logos as inline SVG paths filled with currentColor, in this order: LinkedIn, X, Reddit, GitHub, Gmail, Crunchbase, Apollo, Google. Single-colour marks only: Google's G as one merged path, Reddit as Snoo's face alone. Loop - Window: width 100%, max-width 576px, overflow hidden, 8px padding top and bottom cancelled by −8px margins (so hovered logos aren't clipped), masked with linear-gradient(to right, transparent, black 15%, black 85%, transparent). - Track: a flex row, width max-content, holding the list doubled into a "set" and the set doubled again (32 logos). A keyframe moves it translate3d(0,0,0) → translate3d(−50%,0,0), linear, infinite, over duration; "right" plays the reverse keyframe. will-change transform, translateZ(0), backface-visibility hidden. - Each logo: 36×36px, margin-right 56px. Use a trailing margin, never gap: gap only sits between items, so half the track would be a gap short of a set and the loop would jump. - A set is 16 × 92px = 1472px, wider than the window, so the wrap never shows empty space. Hover - The logo scales to 1.25 and its colour goes from #3A3A55 to #6A6A85, both over 200ms cubic-bezier(.4,0,.2,1). The loop keeps moving. Behaviour - The track is a <ul> labelled "Tools". Only the first eight logos carry role="img" and an aria-label with the tool's name; every repeat is aria-hidden. - Pause the animation (animation-play-state) when the root is off screen (IntersectionObserver) or the tab is hidden, by toggling an attribute rather than re-rendering. - prefers-reduced-motion: no animation and no hover transitions.
"use client";
/**
* LogoCarousel: the strip of tool logos under the hero on Starlight (joinstarlight.com), captioned "We find and
* reach your best-fit buyers with the tools you already use". Eight monochrome marks drift left forever behind
* a mask that fades them in and out at the edges; hover one and it grows and brightens.
*
* How it works
* - The logo list is doubled into a "set" and the set doubled again into the track, which a CSS keyframe slides
* by −50% every `duration` seconds. At −50% the second set sits exactly where the first began, so the loop
* restarts without a jump.
* - Spacing is a trailing margin on every logo, never `gap`: a gap only sits *between* items, which would leave
* half the track one gap short of a set and make the loop hitch once a cycle.
* - A set (16 logos × 92px = 1472px) is wider than the 576px window, so the wrap point never shows empty space.
* - The window is masked with a horizontal gradient (transparent → black at 15% and 85% → transparent).
* - The animation pauses off screen and in hidden tabs, and doesn't run at all with reduced motion.
* - Only the first pass of logos is labelled for screen readers; the repeats are decorative.
*
* Usage
* <div style={{ height: 240 }}><LogoCarousel /></div>
* <LogoCarousel duration={20} direction="right" caption="Works with what you use" />
*
* Requirements: React 19 (for the hoisted <style>), no other dependencies. Set in Google Sans Flex when the page
* provides `--font-google-sans-flex`, else the system sans. The marks are inline SVG and take `currentColor`.
*/
import { useEffect, useRef, type CSSProperties, type ReactNode } from "react";
type Props = {
/** The line above the logos. */
caption?: string;
/** Seconds for one full loop (half the track). */
duration?: number;
/** Which way the logos drift. */
direction?: "left" | "right";
};
// ── Marks ─────────────────────────────────────────────────────────────────────────────────────────
// Single-colour paths: Google's four-colour G is merged into one shape and Reddit is Snoo's face alone
// (Phosphor's filled mark, drawn on a 256 grid), so every logo reads the same in one ink.
const LOGOS: { name: string; viewBox: string; icon: ReactNode }[] = [
{
name: "LinkedIn",
viewBox: "0 0 24 24",
icon: (
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" />
),
},
{
name: "X",
viewBox: "0 0 24 24",
icon: (
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
),
},
{
name: "Reddit",
viewBox: "0 0 256 256",
icon: (
<path d="M248,104a32,32,0,0,0-52.94-24.19c-16.75-8.9-36.76-14.28-57.66-15.53l5.19-31.17,17.72,2.72a24,24,0,1,0,2.87-15.74l-26-4a8,8,0,0,0-9.11,6.59L121.2,64.16c-21.84.94-42.82,6.38-60.26,15.65a32,32,0,0,0-42.59,47.74A59,59,0,0,0,16,144c0,21.93,12,42.35,33.91,57.49C70.88,216,98.61,224,128,224s57.12-8,78.09-22.51C228,186.35,240,165.93,240,144a59,59,0,0,0-2.35-16.45A32.16,32.16,0,0,0,248,104ZM72,128a16,16,0,1,1,16,16A16,16,0,0,1,72,128Zm91.75,55.07a76.18,76.18,0,0,1-71.5,0,8,8,0,1,1,7.5-14.14,60.18,60.18,0,0,0,56.5,0,8,8,0,1,1,7.5,14.14ZM168,144a16,16,0,1,1,16-16A16,16,0,0,1,168,144Z" />
),
},
{
name: "GitHub",
viewBox: "0 0 24 24",
icon: (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844a9.59 9.59 0 0 1 2.504.338c1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.02 10.02 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"
/>
),
},
{
name: "Gmail",
viewBox: "0 0 24 24",
icon: (
<path d="M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z" />
),
},
{
name: "Crunchbase",
viewBox: "0 0 225 225",
icon: (
<path d="M225 225H0V0H225V225ZM106.041 119.242C102.954 103.803 83.9587 92.383 67.5 96.0693C47.4292 100.565 36.5153 123.496 45.6514 141.975C58.2046 167.364 94.0867 166.05 104.909 139.806C106.763 135.31 106.958 135.45 98.8359 135.45H91.8936L90.4453 137.707C79.0279 155.499 51.2032 143.116 56.9082 122.782C61.3227 107.05 84.2122 104.522 91.0859 119.008L91.8418 120.6H106.312L106.041 119.242ZM118.8 157.95H132.412L132.143 156.6C131.808 154.929 131.686 154.921 135.667 156.836C158.344 167.743 184.059 150.83 182.549 126C181.121 102.503 156.366 88.2097 135.676 98.9346C133.943 99.8327 132.373 100.637 132.188 100.722C132.002 100.804 131.85 92.7563 131.85 82.8369V64.7998H118.8V157.95ZM131.948 128.846C131.251 114.642 145.637 104.945 158.217 111.138C168.576 116.238 171.911 128.657 165.486 138.216C155.63 152.881 132.816 146.507 131.948 128.846Z" />
),
},
{
name: "Apollo",
viewBox: "0 0 225 225",
icon: (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M0 112.5C0 174.632 50.368 225 112.5 225C174.632 225 225 174.632 225 112.5C225 50.368 174.632 0 112.5 0C50.368 0 0 50.368 0 112.5ZM118 78.545V97.6198C118 99.8423 117.117 101.974 115.545 103.545C111.421 107.67 108.681 106.87 86.016 94.915C62.518 82.52 63.106 83.234 70.1 75.581C76.036 69.086 75.653 69.202 79.51 72.75C81.154 74.263 88.451 81.013 95.726 87.75C114.195 104.854 114.241 104.814 105.931 78.778C102.546 68.175 99.715 59.064 99.639 58.532C99.464 57.315 104.782 56.303 112.25 56.132C115.404 56.0596 118 58.5966 118 61.7515V78.545ZM149.419 70.1C156.278 76.369 156.367 75.353 148.18 84.162C118.905 115.658 119.202 114.644 141.283 107.665C171.573 98.09 167.876 97.86 168.688 109.373C169.017 114.036 165.323 118 160.649 118H146.603H127.38C125.158 118 123.026 117.117 121.455 115.545C117.346 111.437 118.145 108.721 130.137 86.053C142.611 62.471 141.803 63.14 149.419 70.1ZM101.343 108.11C108.437 111.343 107.735 114.482 94.138 140.313C82.463 162.493 83.381 161.766 75.7 154.92C68.487 148.491 67.594 150.697 84.963 132.04C105.22 110.28 105.348 110.503 77.745 119.414C65.883 123.243 57.745 125.396 57.378 124.803C57.042 124.259 56.531 120.031 56.243 115.407C55.9585 110.851 59.5767 107 64.1414 107H77.312C91.01 107 99.797 107.406 101.343 108.11ZM133.407 127.413C164.661 143.752 162.295 141.328 154.9 149.419C148.408 156.523 150.016 157.078 134.14 142.25C114.689 124.084 115.144 124.456 113.881 125.719C113.09 126.51 113.947 130.504 116.978 140.156C126.897 171.742 127.081 168.029 115.56 168.748C110.921 169.037 107 165.353 107 160.705V146.832C107 123.41 107.148 122.535 111.5 120.155C115.061 118.207 117.07 118.872 133.407 127.413Z"
/>
),
},
{
name: "Google",
viewBox: "0 0 24 24",
icon: (
<path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09zM12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23zM5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62zM12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" />
),
},
];
// One set is the list twice over, and the track is two sets: sliding it by −50% lands on an identical frame.
const SET = [...LOGOS, ...LOGOS];
const TRACK = [...SET, ...SET];
const css = `
.lc{position:relative;width:100%;height:100%;overflow:hidden;isolation:isolate;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:24px;box-sizing:border-box;background:#0a0a0f;font-family:var(--font-google-sans-flex,"Google Sans Flex"),system-ui,sans-serif;-webkit-font-smoothing:antialiased}
.lc *,.lc *::before,.lc *::after{box-sizing:border-box}
.lc-caption{margin:0;max-width:576px;text-align:center;text-wrap:balance;font-size:16px;line-height:24px;font-weight:500;color:#5a5a75}
/* The window: 8px of padding above and below (cancelled by negative margins) so a logo grown on hover isn't clipped. */
.lc-window{width:100%;max-width:576px;margin:-8px 0;padding:8px 0;overflow:hidden;-webkit-mask-image:linear-gradient(to right,transparent,#000 15%,#000 85%,transparent);mask-image:linear-gradient(to right,transparent,#000 15%,#000 85%,transparent)}
.lc-track{display:flex;width:max-content;align-items:center;margin:0;padding:0;list-style:none;will-change:transform;transform:translateZ(0);backface-visibility:hidden;animation:lc-scroll var(--lc-duration,30s) linear infinite}
.lc[data-direction="right"] .lc-track{animation-name:lc-scroll-reverse}
.lc[data-paused] .lc-track{animation-play-state:paused}
.lc-logo{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:36px;height:36px;margin-right:56px;transition:transform .2s cubic-bezier(.4,0,.2,1)}
.lc-logo:hover{transform:scale(1.25)}
.lc-logo svg{display:block;width:100%;height:100%;color:#3a3a55;transition:color .2s cubic-bezier(.4,0,.2,1)}
.lc-logo:hover svg{color:#6a6a85}
@keyframes lc-scroll{from{transform:translate3d(0,0,0)}to{transform:translate3d(-50%,0,0)}}
@keyframes lc-scroll-reverse{from{transform:translate3d(-50%,0,0)}to{transform:translate3d(0,0,0)}}
@media (prefers-reduced-motion:reduce){.lc-track{animation:none}.lc-logo,.lc-logo svg{transition:none}}
`;
export default function LogoCarousel({
caption = "We find and reach your best-fit buyers with the tools you already use",
duration = 30,
direction = "left",
}: Props) {
const rootRef = useRef<HTMLDivElement>(null);
// Pause the drift off screen and in hidden tabs (an attribute, so no re-render).
useEffect(() => {
const root = rootRef.current;
if (!root) return;
let onScreen = true;
const sync = () => root.toggleAttribute("data-paused", !onScreen || document.hidden);
const io = new IntersectionObserver(([entry]) => {
onScreen = entry.isIntersecting;
sync();
});
io.observe(root);
document.addEventListener("visibilitychange", sync);
return () => {
io.disconnect();
document.removeEventListener("visibilitychange", sync);
};
}, []);
return (
<div
ref={rootRef}
className="lc"
data-direction={direction}
style={{ "--lc-duration": `${Math.max(1, duration)}s` } as CSSProperties}
>
<style href="ui-logo-carousel" precedence="ui">
{css}
</style>
<p className="lc-caption">{caption}</p>
<div className="lc-window">
<ul className="lc-track" aria-label="Tools">
{TRACK.map(({ name, viewBox, icon }, i) => {
const repeat = i >= LOGOS.length;
return (
<li key={i} className="lc-logo" aria-hidden={repeat || undefined}>
<svg
viewBox={viewBox}
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
role={repeat ? undefined : "img"}
aria-label={repeat ? undefined : name}
focusable="false"
>
{icon}
</svg>
</li>
);
})}
</ul>
</div>
</div>
);
}
