From aefd3ea74b3b69b7268fd72627fea98933b24865 Mon Sep 17 00:00:00 2001 From: mohamedh Date: Mon, 30 Mar 2026 17:56:55 +0100 Subject: [PATCH 01/35] feat: landing page first pass --- .../landing/AccelerateSection.astro | 744 ++++++++++++ src/components/landing/BuildFromScratch.astro | 388 ++++++ src/components/landing/FullPageLines.astro | 45 + src/components/landing/Hero.astro | 61 + src/components/landing/PlatformStats.astro | 257 ++++ src/components/landing/ProductCard.astro | 189 +++ src/components/landing/ProductCardGrid.astro | 72 ++ src/components/landing/ProtectSection.astro | 157 +++ src/components/landing/RequestLifecycle.astro | 1071 +++++++++++++++++ src/components/landing/SecureSection.astro | 111 ++ src/components/landing/StructuralGrid.astro | 82 ++ src/components/landing/constants.ts | 5 + src/components/overrides/Page.astro | 54 +- src/components/overrides/Sidebar.astro | 33 +- src/components/overrides/SidebarSublist.astro | 39 +- src/icons/kv.svg | 2 +- src/pages/index.astro | 591 +++++---- src/pages/request-lifecycle.astro | 63 + src/styles/landing.css | 149 +++ src/styles/layout.css | 26 +- src/styles/sidebar.css | 89 +- 21 files changed, 3944 insertions(+), 284 deletions(-) create mode 100644 src/components/landing/AccelerateSection.astro create mode 100644 src/components/landing/BuildFromScratch.astro create mode 100644 src/components/landing/FullPageLines.astro create mode 100644 src/components/landing/Hero.astro create mode 100644 src/components/landing/PlatformStats.astro create mode 100644 src/components/landing/ProductCard.astro create mode 100644 src/components/landing/ProductCardGrid.astro create mode 100644 src/components/landing/ProtectSection.astro create mode 100644 src/components/landing/RequestLifecycle.astro create mode 100644 src/components/landing/SecureSection.astro create mode 100644 src/components/landing/StructuralGrid.astro create mode 100644 src/components/landing/constants.ts create mode 100644 src/pages/request-lifecycle.astro create mode 100644 src/styles/landing.css diff --git a/src/components/landing/AccelerateSection.astro b/src/components/landing/AccelerateSection.astro new file mode 100644 index 000000000000000..cb8635749db424b --- /dev/null +++ b/src/components/landing/AccelerateSection.astro @@ -0,0 +1,744 @@ +--- +/** + * AccelerateSection variant-a — "The Waterfall" + * + * A request-lifecycle waterfall that shows where latency hides + * and which Cloudflare product eliminates it. Inspired by DevTools + * network panels — rendered as styled HTML/CSS bars with hover + * interactions that connect phases to products. + * + * Toggle between "Without Cloudflare" and "With Cloudflare" to see + * latency bars shrink in real time. + */ +import { Icon } from "astro-icon/components"; +import ProductCard from "./ProductCard.astro"; +import ProductCardGrid from "./ProductCardGrid.astro"; + +/** + * Each phase of a request lifecycle. + * `before` / `after` are percentage widths (of a ~1200ms budget). + * `offset` is when the phase starts (percentage left-offset). + */ +const phases = [ + { + id: "dns", + phase: "DNS Lookup", + before: { offset: 0, width: 18 }, + after: { offset: 0, width: 3 }, + product: "DNS", + icon: "dns", + href: "/dns/", + outcome: "Resolve DNS in single-digit milliseconds", + detail: + "Fastest authoritative DNS. DNSSEC, wildcard records, proxy control.", + tags: ["Authoritative DNS", "DNSSEC"], + color: "bg-orange-400", + colorMuted: "bg-orange-400/20", + }, + { + id: "connect", + phase: "TCP + TLS", + before: { offset: 18, width: 22 }, + after: { offset: 3, width: 4 }, + product: "Argo Smart Routing", + icon: "argo-smart-routing", + href: "/argo-smart-routing/", + outcome: "Route around congestion automatically", + detail: + "Real-time network intelligence — typically 30% faster than public internet.", + tags: ["Smart Routing", "Tiered Caching"], + color: "bg-amber-500", + colorMuted: "bg-amber-500/20", + }, + { + id: "wait", + phase: "Server Wait (TTFB)", + before: { offset: 40, width: 35 }, + after: { offset: 7, width: 5 }, + product: "Cache", + icon: "cache", + href: "/cache/get-started/", + outcome: "Cache at the edge, not from origin", + detail: "Serve from 330+ cities. Cache Rules, tiered caching, purge API.", + tags: ["Cache Rules", "Tiered Cache", "Cache Reserve"], + color: "bg-yellow-500", + colorMuted: "bg-yellow-500/20", + }, + { + id: "db", + phase: "Database Query", + before: { offset: 75, width: 18 }, + after: { offset: 12, width: 3 }, + product: "Hyperdrive", + icon: "hyperdrive", + href: "/hyperdrive/", + outcome: "Make database queries feel local", + detail: + "Connection pooling and caching at the edge. Slash query latency for Postgres, MySQL, and more.", + tags: ["Connection Pooling", "Query Caching"], + color: "bg-lime-500", + colorMuted: "bg-lime-500/20", + }, + { + id: "assets", + phase: "Asset Optimization", + before: { offset: 40, width: 30 }, + after: { offset: 7, width: 6 }, + product: "Images", + icon: "images", + href: "/images/", + outcome: "Transform and serve images from the edge", + detail: + "Resize, convert to modern formats, and deliver from 330+ cities. No origin round-trip.", + tags: ["Transform", "Polish", "WebP/AVIF"], + color: "bg-teal-500", + colorMuted: "bg-teal-500/20", + }, + { + id: "scripts", + phase: "Third-party Scripts", + before: { offset: 60, width: 35 }, + after: { offset: 15, width: 5 }, + product: "Zaraz", + icon: "zaraz", + href: "/zaraz/", + outcome: "Move third-party scripts off the main thread", + detail: + "Load analytics, ads, and pixels server-side. Fewer network requests, faster page loads.", + tags: ["Server-side Tags", "Consent Mgmt"], + color: "bg-sky-500", + colorMuted: "bg-sky-500/20", + }, +]; + +/** Total "before" time label */ +const beforeTotal = "~1,240 ms"; +--- + +
+ +
+ Accelerate +
+

+ See where the milliseconds go +

+

+ Every request is a waterfall of latency. Hover a phase to see which product + eliminates it — toggle to see the compound effect. +

+ + +
+
+ + + +
+
+ Total + {beforeTotal} +
+
+ + +
+ + { + [ + "-top-[5.5px] -left-[5.5px]", + "-top-[5.5px] -right-[5.5px]", + "-bottom-[5.5px] -left-[5.5px]", + "-right-[5.5px] -bottom-[5.5px]", + ].map((pos) => ( + + )) + } + + + + + + { + phases.map((p, i) => ( + 0 && "border-t border-zinc-200 dark:border-[#2a2a2a]", + ]} + style="grid-template-columns: 150px 1fr auto;" + data-phase={p.id} + > + {/* Accent bar — bottom reveal on hover */} +
+ + + + diff --git a/src/components/landing/BuildFromScratch.astro b/src/components/landing/BuildFromScratch.astro new file mode 100644 index 000000000000000..3703facfff60cb8 --- /dev/null +++ b/src/components/landing/BuildFromScratch.astro @@ -0,0 +1,388 @@ +--- +/** + * Steelmanned Minimal Tabs + * + * Improvements over base: + * - Icons restored in tab bar (product identity) + * - Tab bar has subtle background differentiation from panel + * - Active tab gets bg fill, not just underline + * - Command block has segmented $ | command | copy layout (matching PlatformStats precision) + * - CTA is a bordered button, not naked text + * - Tags rendered as low-contrast text links (less noise) + * - Plus marks on outer container (structural language from PlatformStats) + * - Consistent border/bg tokens throughout + */ +import { Icon } from "astro-icon/components"; + +const primitives = [ + { + id: "compute", + label: "Compute", + icon: "workers-vpc", + iconColor: "#0a95ff", + iconBg: "rgba(10, 149, 255, 0.1)", + iconBgDark: "rgba(10, 149, 255, 0.16)", + heading: "Run code at the edge", + description: + "Deploy serverless functions and full-stack apps onto Cloudflare's global network. No servers to manage, no cold starts — your code runs in 330+ cities, milliseconds from every user.", + command: "npm create cloudflare@latest my-app", + cta: { + label: "Deploy your first Worker", + href: "/workers/get-started/guide/", + }, + tags: [ + { label: "Workers", href: "/workers/" }, + { label: "Pages", href: "/pages/" }, + { label: "Containers", href: "/containers/" }, + { label: "Workflows", href: "/workflows/" }, + { label: "Queues", href: "/queues/" }, + ], + }, + { + id: "ai", + label: "AI", + icon: "workers-ai", + iconColor: "#19e306", + iconBg: "#f2f5e1", + iconBgDark: "rgba(25, 227, 6, 0.16)", + heading: "Add intelligence to anything you build", + description: + "Run inference, build agents, and search across your data — all from inside your Workers, with no external API calls or GPU infrastructure.", + command: "npx wrangler ai models list", + cta: { label: "Browse available models", href: "/workers-ai/models/" }, + tags: [ + { label: "Workers AI", href: "/workers-ai/" }, + { label: "AI Gateway", href: "/ai-gateway/" }, + { label: "AI Agents", href: "/agents/" }, + { label: "Vectorize", href: "/vectorize/" }, + { label: "Browser Rendering", href: "/browser-rendering/" }, + ], + }, + { + id: "storage", + label: "Storage", + icon: "kv", + iconColor: "#ee0ddb", + iconBg: "rgba(238, 13, 219, 0.1)", + iconBgDark: "rgba(238, 13, 219, 0.16)", + heading: "Persist data close to your users", + description: + "S3-compatible object storage, a relational SQL database, and low-latency KV — all queryable directly from Workers with no connection pooling.", + command: "npx wrangler r2 bucket create my-bucket", + cta: { label: "Get started with R2", href: "/r2/get-started/" }, + tags: [ + { label: "R2", href: "/r2/" }, + { label: "D1", href: "/d1/" }, + { label: "KV", href: "/kv/" }, + { label: "Hyperdrive", href: "/hyperdrive/" }, + ], + }, + { + id: "media", + label: "Media", + icon: "images", + iconColor: "#9616ff", + iconBg: "rgba(150, 22, 255, 0.1)", + iconBgDark: "rgba(150, 22, 255, 0.22)", + heading: "Serve images and video at scale", + description: + "Store, transform, and deliver images and video from Cloudflare's network. Resize on the fly, stream live or on-demand — no separate infrastructure.", + command: "npx wrangler pages project create my-site", + cta: { label: "Get started with Images", href: "/images/get-started/" }, + tags: [ + { label: "Images", href: "/images/" }, + { label: "Stream", href: "/stream/" }, + { label: "Realtime", href: "/realtime/" }, + ], + }, +]; +--- + +
+
+ Build +
+

+ Everything you need to build at the edge +

+ +
+ + { + [ + "-top-[5.5px] -left-[5.5px]", + "-top-[5.5px] -right-[5.5px]", + "-bottom-[5.5px] -left-[5.5px]", + "-right-[5.5px] -bottom-[5.5px]", + ].map((pos) => ( + + )) + } + + +
+ { + primitives.map((p, i) => ( + + )) + } +
+ + + { + primitives.map((p, i) => ( + + )) + } +
+
+ + + + diff --git a/src/components/landing/FullPageLines.astro b/src/components/landing/FullPageLines.astro new file mode 100644 index 000000000000000..5978a138080c95d --- /dev/null +++ b/src/components/landing/FullPageLines.astro @@ -0,0 +1,45 @@ +--- +/** + * Full-page vertical container lines. + * + * Positioned absolutely within the same relative parent as StructuralGrid + * so the lines share the same coordinate system as the plus marks and + * corner brackets. Uses 100lvh height to extend beyond the content area; + * parent containers have overflow:visible so the lines are not clipped. + * + * Uses the same container widths and responsive margin logic as StructuralGrid. + */ +const CONTAINERS = [1400, 1280, 720, 400]; + +const MIN_MARGINS = [0, 48, 120, 200]; +function rw(w: number): string { + const i = CONTAINERS.indexOf(w); + const margin = i >= 0 ? MIN_MARGINS[i] : 0; + if (margin === 0) return `min(${w}px, 100%)`; + return `min(${w}px, calc(100% - ${margin}px))`; +} + +const lineBase = "absolute top-0 left-1/2 -translate-x-1/2"; +--- + +