Rating Laurel
A gold laurel wreath frames a 4.96 rating above scrolling review cards.
Source
components/kuchi/rating-laurel.tsx
1"use client";23import { loadFont } from "@remotion/google-fonts/HankenGrotesk";4import { loadFont as loadSerif } from "@remotion/google-fonts/InstrumentSerif";5import { loadFont as loadManrope } from "@remotion/google-fonts/Manrope";6import type React from "react";7import {8 AbsoluteFill,9 Easing,10 interpolate,11 spring,12 useCurrentFrame,13 useVideoConfig,14} from "remotion";15import type { GradientParams } from "@/lib/kuchi/gsh/gradient-engine";16import { GshGround } from "@/lib/kuchi/gsh/gsh-ground";17import type { GshPresetId } from "@/lib/kuchi/gsh/presets";1819const { fontFamily: hanken } = loadFont("normal", {20 weights: ["300", "400"],21 subsets: ["latin"],22});23const { fontFamily: serif } = loadSerif("italic", {24 weights: ["400"],25 subsets: ["latin"],26});27const manrope = loadManrope("normal", {28 weights: ["600"],29 subsets: ["latin"],30});3132export interface RatingReview {33 quote: string;34 name: string;35 city: string;36 date?: string;37 hue?: number;38}3940export interface RatingCategory {41 label: string;42 score: number;43 icon: "docs" | "motion" | "setup" | "support" | "value";44}4546export interface RatingLaurelProps {47 rating?: number;48 title?: string;49 subtitle?: string;50 reviews?: RatingReview[];51 reviewCount?: number;52 categories?: RatingCategory[];53 device?: "web" | "phone";54 accent?: string;55 /** Text color of the page copy; overrides the theme ink. */56 ink?: string;57 /** Solid fill in place of the gradient ground; "transparent" drops it. */58 background?: string;59 /** Typeface for the page. Load it yourself; Hanken Grotesk by default. */60 fontFamily?: string;61 /** Label of the install button. */62 ctaLabel?: string;63 /** Price in the phone's bottom bar. */64 priceLabel?: string;65 /** Replaces the acme mark in the page header. */66 logo?: React.ReactNode;67 /** Size of the window or phone, around the frame's center. */68 scale?: number;69 /** Frames to hold the first frame before anything moves. */70 delay?: number;71 speed?: number;72 theme?: "light" | "dark";73 ground?: GshPresetId;74 groundParams?: Partial<GradientParams>;75}7677const DEFAULT_REVIEWS: RatingReview[] = [78 {79 quote:80 "We shipped our launch video the same afternoon we installed it. The transitions feel hand-tuned, and owning the code meant we could tweak every spring.",81 name: "Maya Chen",82 city: "Portland, Oregon",83 date: "March 2026",84 hue: 18,85 },86 {87 quote:88 "I’m not a motion designer and it didn’t matter. Picked three scenes, dropped in our screenshots, rendered. It looked like a studio made it.",89 name: "Leo Park",90 city: "Seoul, South Korea",91 date: "March 2026",92 hue: 210,93 },94 {95 quote:96 "Every component tells you when to use it and when not to. Saved me a full week of keyframing for our Kitebase launch.",97 name: "Priya Raman",98 city: "Austin, Texas",99 date: "February 2026",100 hue: 300,101 },102 {103 quote:104 "Finally, Remotion components that look like current product UI instead of a slideshow. The counter alone got us forty replies.",105 name: "Jonas Weber",106 city: "Berlin, Germany",107 date: "February 2026",108 hue: 150,109 },110 {111 quote:112 "Our whole team edits the video in code review now. Fernway’s launch went from a two-week project to a Friday afternoon.",113 name: "Ana Souza",114 city: "Lisbon, Portugal",115 date: "January 2026",116 hue: 260,117 },118];119120const DEFAULT_CATEGORIES: RatingCategory[] = [121 { label: "Docs", score: 4.9, icon: "docs" },122 { label: "Motion", score: 5.0, icon: "motion" },123 { label: "Setup", score: 4.9, icon: "setup" },124 { label: "Support", score: 4.8, icon: "support" },125 { label: "Value", score: 5.0, icon: "value" },126];127128const ICONS: Record<RatingCategory["icon"], string> = {129 docs: "M6 3.5h8.5L18 7v13.5H6zM14 3.5V7.5h4M9 12h6M9 15.5h6",130 motion: "M3.5 12h4l2.5-6 4 12 2.5-6h4",131 setup: "M5 7h14M5 12h14M5 17h14M9 5v4M15 10v4M8 15v4",132 support: "M4.5 5.5h15v10h-9l-4 3.5v-3.5h-2z",133 value: "M12 3.5l8.5 8.5-8.5 8.5L3.5 12zM12 8.5v7M8.5 12h7",134};135136const STAR =137 "M12 2.6l2.85 6.05 6.62.78-4.9 4.53 1.3 6.54L12 17.2l-5.87 3.3 1.3-6.54-4.9-4.53 6.62-.78z";138139140const SW = 393;141const SH = 852;142const BEZEL = 11;143const BW = SW + BEZEL * 2;144const BH = SH + BEZEL * 2;145146const clamp = { extrapolateLeft: "clamp", extrapolateRight: "clamp" } as const;147const ENTER = Easing.bezier(0.32, 0.72, 0, 1);148const MOVE = Easing.bezier(0.65, 0, 0.35, 1);149const CAM = Easing.bezier(0.87, 0, 0.13, 1);150const HEAVY = { mass: 1, damping: 26, stiffness: 120 };151const CARD = { mass: 0.8, damping: 18, stiffness: 160 };152const CHIP = { mass: 0.5, damping: 12, stiffness: 200 };153154const BEAT = {155 laurel: 4,156 number: 10,157 title: 36,158 sub: 42,159 camFrom: 60,160 camTo: 108,161 categories: 72,162 cards: 84,163 glideFrom: 108,164 glideTo: 250,165 cta: 96,166};167168const LIGHT = {169 page: "#FFFFFF",170 ink: "#1C1C1E",171 muted: "#6B6B70",172 hair: "rgba(20,20,30,0.08)",173 pill: "#F2F2F3",174 window:175 "0 0 0 1px rgba(16,20,40,0.06), 0 2px 4px rgba(16,20,40,0.04), 0 30px 80px -24px rgba(16,24,64,0.32)",176 leafLit: "#4A4A50",177 leafShade: "#141416",178 vein: "#FFFFFF",179 over: "#FFFFFF",180 overMuted: "rgba(255,255,255,0.72)",181};182const DARK: typeof LIGHT = {183 page: "#111215",184 ink: "#F2F1EE",185 muted: "#9C9CA3",186 hair: "rgba(255,255,255,0.08)",187 pill: "#1F2024",188 window:189 "0 0 0 1px rgba(255,255,255,0.09), inset 0 1px 0 rgba(255,255,255,0.05), 0 30px 80px -20px rgba(0,0,0,0.7)",190 leafLit: "#F2F1EE",191 leafShade: "#A9A7A2",192 vein: "#111215",193 over: "#FFFFFF",194 overMuted: "rgba(255,255,255,0.68)",195};196type Palette = typeof LIGHT;197198const P0 = [44, 112];199const P1 = [2, 78];200const P2 = [30, 8];201const LIGHT_DIR = [-0.45, -0.9];202const LEAVES = Array.from({ length: 8 }, (_, i) => {203 const tip = i === 7;204 const t = tip ? 1 : 0.1 + i * 0.122;205 const u = 1 - t;206 const x = u * u * P0[0] + 2 * u * t * P1[0] + t * t * P2[0];207 const y = u * u * P0[1] + 2 * u * t * P1[1] + t * t * P2[1];208 const dx = 2 * u * (P1[0] - P0[0]) + 2 * t * (P2[0] - P1[0]);209 const dy = 2 * u * (P1[1] - P0[1]) + 2 * t * (P2[1] - P1[1]);210 const tangent = (Math.atan2(dy, dx) * 180) / Math.PI;211 const angle = tangent + (tip ? 0 : i % 2 === 0 ? -40 : 40);212 const a = (angle * Math.PI) / 180;213 const upperLit = Math.sin(a) * LIGHT_DIR[0] - Math.cos(a) * LIGHT_DIR[1] > 0;214 return { x, y, angle, len: tip ? 22 : 31 - t * 11, upperLit };215});216217function halfLeaf(len: number, side: number) {218 const w = len * 0.42 * side;219 return `M0 0C${len * 0.24} ${w * 1.2} ${len * 0.78} ${w} ${len} 0Z`;220}221222function Laurel({223 h,224 f,225 at,226 fps,227 mirror,228 c,229}: {230 h: number;231 f: number;232 at: number;233 fps: number;234 mirror?: boolean;235 c: Palette;236}) {237 const stem = interpolate(f, [at, at + 22], [0, 1], {238 ...clamp,239 easing: ENTER,240 });241 return (242 <svg243 width={h * 0.5}244 height={h}245 viewBox="0 0 60 120"246 style={{247 overflow: "visible",248 transform: mirror ? "scaleX(-1)" : undefined,249 }}250 >251 <path252 d={`M${P0[0] + 10} ${P0[1] - 3}C${P0[0] + 8} ${P0[1] + 6} ${P0[0] + 1} ${P0[1] + 4} ${P0[0]} ${P0[1]}Q${P1[0]} ${P1[1]} ${P2[0]} ${P2[1]}`}253 fill="none"254 stroke={c.leafShade}255 strokeWidth={2.2}256 strokeLinecap="round"257 pathLength={1}258 strokeDasharray={1}259 strokeDashoffset={1 - stem}260 />261 {LEAVES.map((leaf, i) => {262 const g = spring({263 frame: f - at - 3 - i * 2.4,264 fps,265 config: CHIP,266 });267 const k = 0.3 + 0.7 * g;268 const L = leaf.len;269 return (270 <g271 key={`${leaf.x}-${leaf.y}`}272 opacity={Math.min(1, g * 2)}273 transform={`translate(${leaf.x} ${leaf.y}) rotate(${leaf.angle}) scale(${k})`}274 >275 <path276 d={halfLeaf(L, -1)}277 fill={leaf.upperLit ? c.leafLit : c.leafShade}278 />279 <path280 d={halfLeaf(L, 1)}281 fill={leaf.upperLit ? c.leafShade : c.leafLit}282 />283 <path284 d={`M2 0L${L * 0.86} 0`}285 stroke={c.vein}286 strokeOpacity={0.35}287 strokeWidth={0.6}288 strokeLinecap="round"289 />290 </g>291 );292 })}293 </svg>294 );295}296297function RollingNumber({298 text,299 f,300 at,301 size,302 color,303}: {304 text: string;305 f: number;306 at: number;307 size: number;308 color: string;309}) {310 const lh = size * 1.1;311 const travel = lh * 0.3;312 let di = -1;313 return (314 <div315 style={{316 display: "flex",317 fontSize: size,318 fontWeight: 300,319 letterSpacing: "-0.045em",320 fontVariantNumeric: "tabular-nums",321 color,322 lineHeight: `${lh}px`,323 }}324 >325 {text.split("").map((ch, i) => {326 if (!/\d/.test(ch)) return <span key={`c${i}`}>{ch}</span>;327 di += 1;328 const steps = 3 + di * 2;329 const target = Number(ch);330 let t = at + di * 4;331 let k = 0;332 let s = 1;333 for (let j = 1; j <= steps; j++) {334 const gap = 1 + j * 1.1;335 if (f < Math.round(t)) break;336 k = j;337 const t0 = Math.round(t);338 s = interpolate(339 f,340 [t0, t0 + Math.min(4, Math.round(gap) + 1)],341 [0, 1],342 { ...clamp, easing: ENTER },343 );344 t += gap;345 }346 const val = (n: number) => (((target - steps + n) % 10) + 10) % 10;347 const glyph = (n: number, y: number, o: number) => (348 <span349 style={{350 position: "absolute",351 inset: 0,352 textAlign: "center",353 opacity: o,354 transform: `translateY(${y}px)`,355 }}356 >357 {val(n)}358 </span>359 );360 return (361 <span362 key={`d${i}`}363 style={{364 position: "relative",365 height: lh,366 display: "inline-block",367 overflow: "hidden",368 }}369 >370 <span style={{ visibility: "hidden" }}>{ch}</span>371 {k > 0 && s < 1372 ? glyph(k - 1, -s * travel, Math.max(0, 1 - s * 2.5))373 : null}374 {glyph(k, (1 - s) * travel, k > 0 ? Math.min(1, s * 1.25) : 1)}375 </span>376 );377 })}378 </div>379 );380}381382function Stars({383 size,384 color,385 gap = 1,386}: {387 size: number;388 color: string;389 gap?: number;390}) {391 return (392 <div style={{ display: "flex", gap }}>393 {[0, 1, 2, 3, 4].map((i) => (394 <svg key={i} width={size} height={size} viewBox="0 0 24 24">395 <path d={STAR} fill={color} />396 </svg>397 ))}398 </div>399 );400}401402function RichText({ text, color }: { text: string; color: string }) {403 return (404 <>405 {text.split("**").map((part, i) => (406 <span key={`${i}${part}`} style={i % 2 === 1 ? { color } : undefined}>407 {part}408 </span>409 ))}410 </>411 );412}413414function Avatar({415 name,416 hue,417 size,418 dark,419}: {420 name: string;421 hue: number;422 size: number;423 dark: boolean;424}) {425 const initials = name426 .split(" ")427 .map((p) => p[0])428 .join("")429 .slice(0, 2);430 return (431 <div432 style={{433 width: size,434 height: size,435 borderRadius: size / 2,436 flexShrink: 0,437 background: dark ? `hsl(${hue} 14% 24%)` : `hsl(${hue} 30% 92%)`,438 color: dark ? `hsl(${hue} 30% 82%)` : `hsl(${hue} 30% 32%)`,439 fontSize: size * 0.38,440 fontWeight: 400,441 display: "flex",442 alignItems: "center",443 justifyContent: "center",444 boxShadow: `inset 0 0 0 1px ${dark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.06)"}`,445 }}446 >447 {initials}448 </div>449 );450}451452function ReviewCard({453 review,454 c,455 w,456 u,457 lines,458 dark,459}: {460 review: RatingReview;461 c: Palette;462 w: number;463 u: number;464 lines: number;465 dark: boolean;466}) {467 return (468 <div style={{ width: w, flexShrink: 0, boxSizing: "border-box" }}>469 <div style={{ display: "flex", alignItems: "center", gap: 12 * u }}>470 <Avatar471 name={review.name}472 hue={review.hue ?? 200}473 size={40 * u}474 dark={dark}475 />476 <div>477 <div style={{ fontSize: 17 * u, fontWeight: 400, color: c.ink }}>478 {review.name}479 </div>480 <div style={{ fontSize: 15 * u, color: c.muted, marginTop: 1 }}>481 {review.city}482 </div>483 </div>484 </div>485 <div486 style={{487 display: "flex",488 alignItems: "center",489 gap: 8 * u,490 marginTop: 12 * u,491 fontSize: 15 * u,492 color: c.muted,493 }}494 >495 <Stars size={11 * u} color={c.ink} gap={1} />496 <span>{review.date ?? "March 2026"}</span>497 </div>498 <div499 style={{500 marginTop: 8 * u,501 fontSize: 16 * u,502 lineHeight: 1.5,503 color: c.ink,504 height: 16 * u * 1.5 * lines,505 overflow: "hidden",506 display: "-webkit-box",507 WebkitLineClamp: lines,508 WebkitBoxOrient: "vertical",509 textWrap: "pretty",510 }}511 >512 {review.quote}513 </div>514 </div>515 );516}517518const Icon = ({519 d,520 size,521 color,522}: {523 d: string;524 size: number;525 color: string;526}) => (527 <svg width={size} height={size} viewBox="0 0 24 24" fill="none">528 <path529 d={d}530 stroke={color}531 strokeWidth={1.5}532 strokeLinecap="round"533 strokeLinejoin="round"534 />535 </svg>536);537538function KuchiLogo({ fontSize, color }: { fontSize: number; color: string }) {539 return (540 <div541 style={{542 display: "flex",543 alignItems: "baseline",544 color,545 fontFamily: manrope.fontFamily,546 fontWeight: 600,547 fontSize,548 letterSpacing: "-0.025em",549 lineHeight: 1,550 }}551 >552 <span>Acme</span>553 </div>554 );555}556557function StatusBar({ color }: { color: string }) {558 return (559 <div560 style={{561 position: "absolute",562 top: 0,563 left: 0,564 right: 0,565 height: 54,566 display: "flex",567 alignItems: "center",568 justifyContent: "space-between",569 padding: "6px 34px 0 52px",570 boxSizing: "border-box",571 zIndex: 8,572 }}573 >574 <span style={{ fontSize: 17, fontWeight: 400, color }}>9:41</span>575 <div style={{ display: "flex", gap: 6, alignItems: "center" }}>576 <svg width="18" height="12" viewBox="0 0 18 12">577 {[0, 1, 2, 3].map((i) => (578 <rect579 key={i}580 x={i * 4.6}581 y={9 - i * 3}582 width={3.2}583 height={3 + i * 3}584 rx={0.8}585 fill={color}586 />587 ))}588 </svg>589 <div590 style={{591 width: 25,592 height: 12,593 borderRadius: 3.5,594 border: `1px solid ${color}`,595 padding: 1.5,596 boxSizing: "border-box",597 }}598 >599 <div600 style={{601 width: "80%",602 height: "100%",603 borderRadius: 2,604 background: color,605 }}606 />607 </div>608 </div>609 </div>610 );611}612613function Phone({614 children,615 dark,616}: {617 children: React.ReactNode;618 dark: boolean;619}) {620 const btn = (side: "left" | "right", top: number, h: number) => (621 <div622 style={{623 position: "absolute",624 [side]: -3,625 top,626 width: 4,627 height: h,628 borderRadius: 2,629 background: "#3A3A3D",630 }}631 />632 );633 return (634 <div style={{ position: "relative", width: BW, height: BH }}>635 {btn("left", 150, 32)}636 {btn("left", 210, 62)}637 {btn("left", 284, 62)}638 {btn("right", 236, 98)}639 <div640 style={{641 position: "absolute",642 inset: 0,643 borderRadius: 66,644 background: "#0B0B0C",645 boxShadow: `inset 0 0 0 1.5px #6E6E73, inset 0 0 0 3px #1C1C1E, ${dark ? "0 50px 100px -20px rgba(0,0,0,0.7)" : "0 2px 6px rgba(16,20,40,0.12), 0 50px 100px -30px rgba(16,24,64,0.45)"}`,646 }}647 />648 <div649 style={{650 position: "absolute",651 left: BEZEL,652 top: BEZEL,653 width: SW,654 height: SH,655 borderRadius: 55,656 overflow: "hidden",657 }}658 >659 {children}660 <div661 style={{662 position: "absolute",663 top: 11,664 left: (SW - 126) / 2,665 width: 126,666 height: 37,667 borderRadius: 19,668 background: "#000",669 zIndex: 20,670 }}671 />672 <div673 style={{674 position: "absolute",675 bottom: 8,676 left: (SW - 134) / 2,677 width: 134,678 height: 5,679 borderRadius: 3,680 background: dark ? "#fff" : "#111",681 zIndex: 20,682 }}683 />684 </div>685 </div>686 );687}688689/** The foreground at `scale`, around the frame's center; nothing extra at 1. */690function ScaleLayer({691 scale,692 children,693}: {694 scale: number;695 children: React.ReactNode;696}) {697 if (scale === 1) return children;698 return (699 <AbsoluteFill style={{ transform: `scale(${scale})` }}>700 {children}701 </AbsoluteFill>702 );703}704705export function RatingLaurel({706 rating = 4.96,707 title = "Loved by builders",708 subtitle = "acme is in the **top 5%** of launch tools, based on ratings, reviews, and reliability",709 reviews = DEFAULT_REVIEWS,710 reviewCount = 298,711 categories = DEFAULT_CATEGORIES,712 device = "web",713 accent = "#3B5BFD",714 ink,715 background,716 fontFamily = hanken,717 ctaLabel = "Install",718 priceLabel = "Free",719 logo,720 scale = 1,721 delay = 0,722 speed = 1,723 theme = "light",724 ground,725 groundParams,726}: RatingLaurelProps) {727 const frame = Math.max(0, useCurrentFrame() - delay);728 const { fps, width, height } = useVideoConfig();729 const f = frame * speed;730 const dark = theme === "dark";731 const palette = dark ? DARK : LIGHT;732 const c = ink === undefined ? palette : { ...palette, ink };733 const tall = height > width;734 const phone = device === "phone" || tall;735736 const sp = (at: number, config: typeof CARD) =>737 spring({ frame: f - at, fps, config });738 const fadeUp = (at: number, dy = 14): React.CSSProperties => {739 const v = interpolate(f, [at, at + 14], [0, 1], {740 ...clamp,741 easing: ENTER,742 });743 return {744 opacity: v,745 transform: `translateY(${(1 - v) * dy}px)`,746 };747 };748749 const groundEl =750 background !== undefined ? (751 <AbsoluteFill752 style={{753 background: background === "transparent" ? undefined : background,754 }}755 />756 ) : (757 <>758 <GshGround759 preset={ground ?? (dark ? "earthshine" : "paper-crease")}760 params={groundParams}761 timeOffset={5}762 timeScale={0.35}763 />764 {dark ? (765 <AbsoluteFill766 style={{767 background:768 "radial-gradient(80% 70% at 40% 40%, rgba(3,5,12,0.5), rgba(3,5,12,0) 100%)",769 }}770 />771 ) : null}772 </>773 );774775 const hero = (scale: number) => (776 <div777 style={{778 display: "flex",779 flexDirection: "column",780 alignItems: "center",781 textAlign: "center",782 }}783 >784 <div style={{ display: "flex", alignItems: "center", gap: 10 * scale }}>785 <Laurel h={104 * scale} f={f} at={BEAT.laurel} fps={fps} c={c} />786 <RollingNumber787 text={rating.toFixed(2)}788 f={f}789 at={BEAT.number}790 size={92 * scale}791 color={c.ink}792 />793 <Laurel h={104 * scale} f={f} at={BEAT.laurel} fps={fps} c={c} mirror />794 </div>795 <div796 style={{797 marginTop: 6 * scale,798 fontSize: 26 * scale,799 fontWeight: 400,800 letterSpacing: "-0.02em",801 color: c.ink,802 ...fadeUp(BEAT.title),803 }}804 >805 {title}806 </div>807 <div808 style={{809 marginTop: 6 * scale,810 maxWidth: 420 * scale,811 fontSize: 17 * scale,812 lineHeight: 1.45,813 color: c.muted,814 textWrap: "balance",815 ...fadeUp(BEAT.sub, 10),816 }}817 >818 <RichText text={subtitle} color={c.ink} />819 </div>820 </div>821 );822823 if (phone) {824 const u = 1;825 const cardW = 300;826 const step = cardW + 28;827 const glide = interpolate(828 f,829 [BEAT.glideFrom, BEAT.glideTo],830 [0, step * 2],831 {832 ...clamp,833 easing: MOVE,834 },835 );836 const pk = tall ? (height * 0.6) / BH : (height * 0.9) / BH;837 const phoneC = tall838 ? { x: width / 2, y: height * 0.37 }839 : { x: width * 0.7, y: height / 2 };840 const rise = sp(0, HEAVY);841 const s = width / (tall ? 1080 : 1280);842 const lineIn = (d: number) =>843 interpolate(f, [18 + d, 34 + d], [0, 1], { ...clamp, easing: ENTER });844 const barIn = sp(BEAT.cta, CARD);845 return (846 <AbsoluteFill style={{ fontFamily, overflow: "hidden" }}>847 {groundEl}848 <ScaleLayer scale={scale}>849 <div850 style={{851 position: "absolute",852 left: phoneC.x - BW / 2,853 top: phoneC.y - BH / 2,854 width: BW,855 height: BH,856 transform: `translateY(${(1 - rise) * height * 0.7}px) scale(${pk * (1 + 0.02 * (f / 270))})`,857 }}858 >859 <Phone dark={dark}>860 <div861 style={{ position: "absolute", inset: 0, background: c.page }}862 >863 <StatusBar color={c.ink} />864 <div865 style={{866 position: "absolute",867 top: 58,868 left: 20,869 right: 20,870 height: 40,871 display: "flex",872 alignItems: "center",873 gap: 22,874 }}875 >876 <Icon d="M19 12H5M11 5l-7 7 7 7" size={22} color={c.ink} />877 <div style={{ flex: 1 }} />878 <Icon879 d="M12 3v12M7 8l5-5 5 5M5 13v7h14v-7"880 size={20}881 color={c.ink}882 />883 <Icon884 d="M12 20s-7.5-4.6-7.5-10A4.3 4.3 0 0 1 12 7.4 4.3 4.3 0 0 1 19.5 10c0 5.4-7.5 10-7.5 10z"885 size={21}886 color={c.ink}887 />888 </div>889 <div890 style={{ position: "absolute", top: 104, left: 0, right: 0 }}891 >892 {hero(0.8)}893 </div>894 <div895 style={{896 position: "absolute",897 top: 330,898 left: 22,899 right: 22,900 display: "flex",901 borderTop: `1px solid ${c.hair}`,902 borderBottom: `1px solid ${c.hair}`,903 padding: "12px 0",904 ...fadeUp(BEAT.categories - 4, 0),905 }}906 >907 {categories.slice(0, 4).map((cat, i) => {908 const v = sp(BEAT.categories + i * 3, CHIP);909 return (910 <div911 key={cat.label}912 style={{913 flex: 1,914 paddingLeft: i === 0 ? 0 : 10,915 borderLeft: i === 0 ? "none" : `1px solid ${c.hair}`,916 opacity: Math.min(1, v * 1.5),917 transform: `translateY(${(1 - v) * 10}px)`,918 }}919 >920 <div style={{ fontSize: 13, color: c.muted }}>921 {cat.label}922 </div>923 <div924 style={{925 fontSize: 17,926 color: c.ink,927 fontVariantNumeric: "tabular-nums",928 marginTop: 2,929 }}930 >931 {cat.score.toFixed(1)}932 </div>933 </div>934 );935 })}936 </div>937 <div938 style={{939 position: "absolute",940 top: 430,941 left: 22,942 display: "flex",943 gap: 28,944 transform: `translateX(${-glide}px)`,945 }}946 >947 {[...reviews, ...reviews].map((r, i) => {948 const v = sp(BEAT.cards + Math.min(i, 4) * 3, CARD);949 return (950 <div951 key={`${r.name}-${i < reviews.length ? "a" : "b"}`}952 style={{953 opacity: Math.min(1, v * 1.4),954 transform: `translateX(${(1 - v) * 48}px)`,955 }}956 >957 <ReviewCard958 review={r}959 c={c}960 w={cardW}961 u={u * 0.92}962 lines={5}963 dark={dark}964 />965 </div>966 );967 })}968 </div>969 <div970 style={{971 position: "absolute",972 top: 618,973 left: 22,974 right: 22,975 height: 48,976 borderRadius: 12,977 background: c.pill,978 color: c.ink,979 fontSize: 16,980 display: "flex",981 alignItems: "center",982 justifyContent: "center",983 ...fadeUp(BEAT.cta + 6, 8),984 }}985 >986 Show all {reviewCount} reviews987 </div>988 <div989 style={{990 position: "absolute",991 bottom: 0,992 left: 0,993 right: 0,994 height: 112,995 background: c.page,996 borderTop: `1px solid ${c.hair}`,997 display: "flex",998 alignItems: "flex-start",999 justifyContent: "space-between",1000 padding: "18px 22px 0",1001 boxSizing: "border-box",1002 transform: `translateY(${(1 - barIn) * 112}px)`,1003 }}1004 >1005 <div style={{ color: c.ink }}>1006 <div style={{ fontSize: 18, fontWeight: 400 }}>1007 {priceLabel}1008 </div>1009 <div style={{ fontSize: 13, color: c.muted, marginTop: 3 }}>1010 MIT licensed · own the code1011 </div>1012 </div>1013 <div1014 style={{1015 width: 140,1016 height: 48,1017 borderRadius: 12,1018 background: accent,1019 color: "#fff",1020 fontSize: 16,1021 fontWeight: 400,1022 display: "flex",1023 alignItems: "center",1024 justifyContent: "center",1025 boxShadow:1026 "inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.12)",1027 }}1028 >1029 {ctaLabel}1030 </div>1031 </div>1032 </div>1033 </Phone>1034 </div>1035 <div1036 style={{1037 position: "absolute",1038 ...(tall1039 ? { left: 90 * s, right: 90 * s, top: height * 0.72 }1040 : { left: 96 * s, width: 470 * s, top: height / 2 - 120 * s }),1041 color: ink ?? (dark ? c.ink : "#15161B"),1042 textAlign: tall ? "center" : "left",1043 }}1044 >1045 <div1046 style={{1047 fontSize: (tall ? 26 : 20) * s,1048 color: dark ? c.muted : "#4F5260",1049 fontVariantNumeric: "tabular-nums",1050 ...{1051 opacity: lineIn(0),1052 transform: `translateY(${(1 - lineIn(0)) * 10}px)`,1053 },1054 }}1055 >1056 {reviewCount} reviews1057 </div>1058 <div style={{ overflow: "hidden", paddingBottom: 8 * s }}>1059 <div1060 style={{1061 marginTop: 10 * s,1062 fontSize: (tall ? 84 : 62) * s,1063 fontWeight: 300,1064 lineHeight: 1.04,1065 letterSpacing: "-0.04em",1066 textWrap: "balance",1067 transform: `translateY(${(1 - lineIn(4)) * 105}%)`,1068 }}1069 >1070 Rated {rating.toFixed(2)} by the people who{" "}1071 <span1072 style={{1073 fontFamily: serif,1074 fontStyle: "italic",1075 letterSpacing: "-0.02em",1076 }}1077 >1078 ship1079 </span>{" "}1080 with it.1081 </div>1082 </div>1083 </div>1084 </ScaleLayer>1085 </AbsoluteFill>1086 );1087 }10881089 const cardW = 270;1090 const step = cardW + 40;1091 const glide = interpolate(f, [BEAT.glideFrom, BEAT.glideTo], [0, step * 2], {1092 ...clamp,1093 easing: MOVE,1094 });1095 const winW = 1000;1096 const winH = 640;1097 const winX = (1280 - winW) / 2;1098 const winY = (720 - winH) / 2;1099 const cam = interpolate(f, [BEAT.camFrom, BEAT.camTo], [0, 1], {1100 ...clamp,1101 easing: CAM,1102 });1103 const zoom = 1.8 - 0.8 * cam;1104 const focusY = winY + 215;1105 const ty = (1 - cam) * (360 - focusY);1106 const winIn = sp(0, HEAVY);1107 const push = 1 + 0.02 * interpolate(f, [BEAT.camTo, 270], [0, 1], clamp);1108 const s = width / 1280;1109 return (1110 <AbsoluteFill style={{ fontFamily, overflow: "hidden" }}>1111 {groundEl}1112 <ScaleLayer scale={scale}>1113 <div1114 style={{1115 position: "absolute",1116 left: 0,1117 top: 0,1118 width: 1280,1119 height: 720,1120 transform: `scale(${s})`,1121 transformOrigin: "0 0",1122 }}1123 >1124 <div1125 style={{1126 position: "absolute",1127 inset: 0,1128 transform: `translateY(${ty + (1 - winIn) * 30}px) scale(${zoom * push})`,1129 transformOrigin: `640px ${focusY}px`,1130 }}1131 >1132 <div1133 style={{1134 position: "absolute",1135 left: winX,1136 top: winY,1137 width: winW,1138 height: winH,1139 borderRadius: 18,1140 background: c.page,1141 boxShadow: c.window,1142 overflow: "hidden",1143 }}1144 >1145 <div1146 style={{1147 position: "absolute",1148 top: 0,1149 left: 0,1150 right: 0,1151 height: 60,1152 borderBottom: `1px solid ${c.hair}`,1153 display: "flex",1154 alignItems: "center",1155 padding: "0 32px",1156 opacity: interpolate(1157 f,1158 [BEAT.camFrom + 10, BEAT.camTo],1159 [0, 1],1160 {1161 ...clamp,1162 easing: ENTER,1163 },1164 ),1165 }}1166 >1167 <div style={{ flex: 1 }}>1168 {logo ?? <KuchiLogo fontSize={22} color={c.ink} />}1169 </div>1170 <div style={{ display: "flex", gap: 28, fontSize: 16 }}>1171 {["Components", "Templates", "Reviews"].map((t, i) => (1172 <span key={t} style={{ color: i === 2 ? c.ink : c.muted }}>1173 {t}1174 </span>1175 ))}1176 </div>1177 <div1178 style={{1179 flex: 1,1180 display: "flex",1181 justifyContent: "flex-end",1182 }}1183 >1184 <div1185 style={{1186 height: 36,1187 padding: "0 16px",1188 borderRadius: 10,1189 background: accent,1190 color: "#fff",1191 fontSize: 16,1192 display: "flex",1193 alignItems: "center",1194 boxShadow: "inset 0 1px 0 rgba(255,255,255,0.2)",1195 }}1196 >1197 {ctaLabel}1198 </div>1199 </div>1200 </div>1201 <div style={{ position: "absolute", top: 84, left: 0, right: 0 }}>1202 {hero(1)}1203 </div>1204 <div1205 style={{1206 position: "absolute",1207 top: 318,1208 left: 80,1209 right: 80,1210 display: "flex",1211 borderTop: `1px solid ${c.hair}`,1212 borderBottom: `1px solid ${c.hair}`,1213 padding: "16px 0",1214 ...fadeUp(BEAT.categories - 4, 0),1215 }}1216 >1217 {categories.map((cat, i) => {1218 const v = sp(BEAT.categories + i * 3, CHIP);1219 return (1220 <div1221 key={cat.label}1222 style={{1223 flex: 1,1224 display: "flex",1225 alignItems: "center",1226 gap: 12,1227 paddingLeft: i === 0 ? 0 : 20,1228 borderLeft: i === 0 ? "none" : `1px solid ${c.hair}`,1229 opacity: Math.min(1, v * 1.5),1230 transform: `translateY(${(1 - v) * 10}px)`,1231 }}1232 >1233 <Icon d={ICONS[cat.icon]} size={24} color={c.ink} />1234 <div>1235 <div style={{ fontSize: 16, color: c.muted }}>1236 {cat.label}1237 </div>1238 <div1239 style={{1240 fontSize: 20,1241 color: c.ink,1242 fontVariantNumeric: "tabular-nums",1243 }}1244 >1245 {cat.score.toFixed(1)}1246 </div>1247 </div>1248 </div>1249 );1250 })}1251 </div>1252 <div1253 style={{1254 position: "absolute",1255 top: 428,1256 left: 0,1257 right: 0,1258 paddingLeft: 80,1259 maskImage:1260 "linear-gradient(90deg, transparent, #000 6%, #000 90%, transparent)",1261 }}1262 >1263 <div1264 style={{1265 display: "flex",1266 gap: 40,1267 transform: `translateX(${-glide}px)`,1268 }}1269 >1270 {[...reviews, ...reviews].map((r, i) => {1271 const v = sp(BEAT.cards + Math.min(i, 4) * 3, CARD);1272 return (1273 <div1274 key={`${r.name}-${i < reviews.length ? "a" : "b"}`}1275 style={{1276 opacity: Math.min(1, v * 1.4),1277 transform: `translateX(${(1 - v) * 48}px)`,1278 }}1279 >1280 <ReviewCard1281 review={r}1282 c={c}1283 w={cardW}1284 u={1}1285 lines={4}1286 dark={dark}1287 />1288 </div>1289 );1290 })}1291 </div>1292 </div>1293 </div>1294 </div>1295 </div>1296 </ScaleLayer>1297 </AbsoluteFill>1298 );1299}









