diff --git a/packages/console/app/public/apps/browse.png b/packages/console/app/public/apps/browse.png new file mode 100644 index 00000000000..e57834e6800 Binary files /dev/null and b/packages/console/app/public/apps/browse.png differ diff --git a/packages/console/app/public/apps/hex.png b/packages/console/app/public/apps/hex.png new file mode 100644 index 00000000000..e1dd476449d Binary files /dev/null and b/packages/console/app/public/apps/hex.png differ diff --git a/packages/console/app/public/apps/isocast.png b/packages/console/app/public/apps/isocast.png new file mode 100644 index 00000000000..6777ba8d847 Binary files /dev/null and b/packages/console/app/public/apps/isocast.png differ diff --git a/packages/console/app/public/apps/justice.png b/packages/console/app/public/apps/justice.png new file mode 100644 index 00000000000..dc2ec130e5e Binary files /dev/null and b/packages/console/app/public/apps/justice.png differ diff --git a/packages/console/app/public/apps/opentunnel-mark.svg b/packages/console/app/public/apps/opentunnel-mark.svg new file mode 100644 index 00000000000..f52a199ad48 --- /dev/null +++ b/packages/console/app/public/apps/opentunnel-mark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/console/app/public/apps/opentunnel.png b/packages/console/app/public/apps/opentunnel.png new file mode 100644 index 00000000000..ca09e432e3a Binary files /dev/null and b/packages/console/app/public/apps/opentunnel.png differ diff --git a/packages/console/app/src/i18n/en.ts b/packages/console/app/src/i18n/en.ts index 5b2e79ec543..76f785f72eb 100644 --- a/packages/console/app/src/i18n/en.ts +++ b/packages/console/app/src/i18n/en.ts @@ -665,19 +665,7 @@ export const dict = { "enterprise.form.inferenceSpend.over100k": "$100K or more", "enterprise.form.error.invalidInferenceSpend": "Select a valid inference spend range.", "enterprise.form.error.captcha": "Captcha verification failed. Please try again.", - // Still used by dev's old home and changelog pages until its replacement lands in a later commit. - "home.faq.a1": "OpenCode is an open source agent that helps you write and run code with any AI model. It's available as a terminal-based interface, desktop app, or IDE extension.", - "home.faq.a3.p2.afterZen": ".", - "home.faq.a3.p2.beforeZen": "Aside from these, you can use any of the popular coding models with", - "home.faq.a3.p3": "While we encourage users to use OpenCode Models, OpenCode also works with all popular providers such as OpenAI, Anthropic, xAI etc.", - "home.faq.a3.p4.localLink": "local models", - "home.faq.a5.and": "and", - "home.faq.a5.beforeDesktop": "Not anymore! OpenCode is now available as an app for your", - "home.faq.a5.desktop": "desktop", - "home.faq.a5.web": "web", - "home.zenCta.body": "OpenCode Models give you access to a handpicked set of AI models that OpenCode has tested and benchmarked specifically for coding agents. No need to worry about inconsistent performance and quality across providers. Use validated models that work.", - "home.zenCta.link": "Learn about OpenCode Models", - "home.zenCta.title": "Access reliable optimized models for coding agents", + // Still used by dev's old changelog page until its replacement lands in a later commit. "changelog.empty": "No changelog entries found.", "changelog.viewJson": "View JSON", } as const diff --git a/packages/console/app/src/routes/desktop.tsx b/packages/console/app/src/routes/desktop.tsx new file mode 100644 index 00000000000..36ee6c67869 --- /dev/null +++ b/packages/console/app/src/routes/desktop.tsx @@ -0,0 +1,10 @@ +import { ProductPage } from "~/component/site/product-page" +import { productAreas } from "~/component/site/product-data" +import { productChangelog } from "~/lib/changelog" + +// Hovering or focusing a link here (a carousel card, say) starts loading the page's changelog. +export const route = { preload: () => productChangelog(productAreas.desktop!) } + +export default function Page() { + return +} diff --git a/packages/console/app/src/routes/extensions/browse.tsx b/packages/console/app/src/routes/extensions/browse.tsx new file mode 100644 index 00000000000..f67a918512e --- /dev/null +++ b/packages/console/app/src/routes/extensions/browse.tsx @@ -0,0 +1,5 @@ +import { ExtensionPage } from "~/component/site/extension-page" + +export default function Page() { + return +} diff --git a/packages/console/app/src/routes/extensions/lane.ts b/packages/console/app/src/routes/extensions/lane.ts new file mode 100644 index 00000000000..4c400a6c82f --- /dev/null +++ b/packages/console/app/src/routes/extensions/lane.ts @@ -0,0 +1,8 @@ +import type { APIEvent } from "@solidjs/start/server" +import { redirect } from "@solidjs/router" +import { localeFromRequest, route } from "~/lib/language" + +// Lane is no longer listed; its old page goes to the Extensions on /product. +export async function GET(event: APIEvent) { + return redirect(`${route(localeFromRequest(event.request), "/product")}#extensions`, 301) +} diff --git a/packages/console/app/src/routes/extensions/ssh.ts b/packages/console/app/src/routes/extensions/ssh.ts new file mode 100644 index 00000000000..1ea96aa587f --- /dev/null +++ b/packages/console/app/src/routes/extensions/ssh.ts @@ -0,0 +1,8 @@ +import type { APIEvent } from "@solidjs/start/server" +import { redirect } from "@solidjs/router" +import { localeFromRequest, route } from "~/lib/language" + +// SSH is no longer listed (extension-data.ts); its old page goes to the Extensions on /product. +export async function GET(event: APIEvent) { + return redirect(`${route(localeFromRequest(event.request), "/product")}#extensions`, 301) +} diff --git a/packages/console/app/src/routes/extensions/wsl.ts b/packages/console/app/src/routes/extensions/wsl.ts new file mode 100644 index 00000000000..b5e32502256 --- /dev/null +++ b/packages/console/app/src/routes/extensions/wsl.ts @@ -0,0 +1,8 @@ +import type { APIEvent } from "@solidjs/start/server" +import { redirect } from "@solidjs/router" +import { localeFromRequest, route } from "~/lib/language" + +// WSL is no longer listed (extension-data.ts); its old page goes to the Extensions on /product. +export async function GET(event: APIEvent) { + return redirect(`${route(localeFromRequest(event.request), "/product")}#extensions`, 301) +} diff --git a/packages/console/app/src/routes/ide.tsx b/packages/console/app/src/routes/ide.tsx new file mode 100644 index 00000000000..c77466c4f6a --- /dev/null +++ b/packages/console/app/src/routes/ide.tsx @@ -0,0 +1,5 @@ +import { ProductPage } from "~/component/site/product-page" + +export default function Page() { + return +} diff --git a/packages/console/app/src/routes/index.css b/packages/console/app/src/routes/index.css index 9d063f8e468..4d6934e1bae 100644 --- a/packages/console/app/src/routes/index.css +++ b/packages/console/app/src/routes/index.css @@ -1,1183 +1,1964 @@ -::selection { - background: var(--color-background-interactive); - color: var(--color-text-strong); - - @media (prefers-color-scheme: dark) { - background: var(--color-background-interactive); - color: var(--color-text-inverted); - } -} - -[data-page="opencode"] { - --color-background: hsl(0, 20%, 99%); - --color-background-weak: hsl(0, 8%, 97%); - --color-background-weak-hover: hsl(0, 8%, 94%); - --color-background-strong: hsl(0, 5%, 12%); - --color-background-strong-hover: hsl(0, 5%, 18%); - --color-background-interactive: hsl(62, 84%, 88%); - --color-background-interactive-weaker: hsl(64, 74%, 95%); - --color-surface-raised-base: hsla(0, 100%, 3%, 0.01); - --color-surface-raised-base-active: hsla(0, 100%, 17%, 0.06); - - --color-text: hsl(0, 1%, 39%); - --color-text-weak: hsl(0, 1%, 60%); - --color-text-weaker: hsl(30, 2%, 81%); - --color-text-strong: hsl(0, 5%, 12%); - --color-text-inverted: hsl(0, 20%, 99%); - - --color-border: hsl(30, 2%, 81%); - --color-border-weak: hsla(0, 100%, 3%, 0.12); - - --color-icon: hsl(0, 1%, 55%); -} - -body { - background: var(--color-background); -} - -[data-page="opencode"] { - @media (prefers-color-scheme: dark) { - --color-background: hsl(0, 9%, 7%); - --color-background-weak: hsl(0, 6%, 10%); - --color-background-weak-hover: hsl(0, 6%, 15%); - --color-background-strong: hsl(0, 15%, 94%); - --color-background-strong-hover: hsl(0, 15%, 97%); - --color-background-interactive: hsl(62, 100%, 90%); - --color-background-interactive-weaker: hsl(60, 20%, 8%); - - --color-text: hsl(0, 4%, 71%); - --color-text-weak: hsl(0, 2%, 49%); - --color-text-weaker: hsl(0, 3%, 28%); - --color-text-strong: hsl(0, 15%, 94%); - --color-text-inverted: hsl(0, 9%, 7%); - - --color-border: hsl(0, 3%, 28%); - --color-border-weak: hsl(0, 4%, 23%); - - --color-icon: hsl(10, 3%, 43%); - } -} - -@supports (background: -webkit-named-image(i)) { - [data-page="opencode"] { - border-top: 1px solid var(--color-border-weak); - } -} - -[data-slot="br"] { - display: block; - - @media (max-width: 60rem) { - display: none; - } -} - -[data-page="opencode"] { - background: var(--color-background); - --padding: 5rem; - --vertical-padding: 4rem; - --heading-font-size: 1.375rem; - - @media (max-width: 60rem) { - --padding: 1.5rem; - --vertical-padding: 3rem; - } - - display: flex; - gap: var(--vertical-padding); - flex-direction: column; - font-family: var(--font-mono); - color: var(--color-text); - padding-bottom: 5rem; - - a { - color: var(--color-text-strong); - text-decoration: underline; - text-underline-offset: var(--space-1); - text-decoration-thickness: 1px; - } - - p { - line-height: 200%; - - @media (max-width: 60rem) { - line-height: 180%; - } - } - - @media (max-width: 60rem) { - font-size: 15px; - } - - [data-component="growth-stats"] { - margin-top: 48px; - margin-left: 40px; - display: flex; - gap: 64px !important; - - @media (max-width: 60rem) { - gap: 56px !important; - } - - @media (max-width: 50rem) { - gap: 48px !important; - } - - @media (max-width: 40rem) { - display: none !important; - } - - [data-component="growth-stat"] { - display: flex; - flex-direction: column; - gap: 24px; - text-align: left; - width: 100%; - - span { - display: flex; - align-items: center; - justify-content: left; - width: 100%; - gap: 10px; - font-size: 14px; - - strong { - color: var(--color-text-strong); - font-weight: 500; - } - - figure { - font-size: 14px; - color: var(--color-text-weak); - padding: 0; - margin: 0; - - @media (max-width: 70rem) { - display: none; - } - } - } - - [data-component="stat-illustration"] { - width: 100%; - height: 100%; - display: block; - - svg { - margin: 0; - width: auto; - height: auto; - display: block; - } - } - } - } - - [data-component="container"] { - max-width: 67.5rem; - margin: 0 auto; - border: 1px solid var(--color-border-weak); - border-top: none; - - @media (max-width: 65rem) { - border: none; - } - } +[data-page="home"] { + /* Hero layout options. Sizes use the carousel's card width so the text can sit on the same grid. */ [data-component="content"] { + container-type: inline-size; } - [data-component="top"] { - padding: 24px var(--padding); - height: 80px; - min-height: 80px; - position: sticky; - top: 0; - display: flex; - justify-content: space-between; - align-items: center; - background: var(--color-background); - border-bottom: 1px solid var(--color-border-weak); + [data-component="hero"], + [data-component="block"], + [data-component="logo-wall"] { + --card: calc((100cqw - var(--gaps) * var(--gutter)) / var(--visible)); + --two-cards: calc(var(--card) * 2 + var(--gutter)); + /* The open source stats numbers' size, which follows the hero option. */ + --hero-size: clamp(2.25rem, 4.4vw, 4rem); + } - z-index: 10; + &[data-site]:has([data-component="hero"][data-variant="two-up"]) + :is([data-component="hero"], [data-component="block"]) { + --hero-size: calc(var(--two-cards) / (15 * 0.57) * 0.98); + } - img { - height: 34px; - width: auto; + &[data-site]:has([data-component="hero"][data-variant="full"]) + :is([data-component="hero"], [data-component="block"]) { + --hero-size: calc(100cqw / (31 * 0.57) * 0.98); + } + + /* Sections sit on the carousel grid: the label takes the first card's width and the body + starts with the second card. With three or more whole cards on screen the body spans two + cards; with fewer it runs to the right edge. */ + &[data-site] [data-component="block"] { + grid-template-columns: var(--card) minmax(0, 1fr); + + [data-slot="body"] { + grid-column: 2; + max-width: calc(var(--card) * var(--body-cards) + var(--gutter) * (var(--body-cards) - 1)); } - [data-component="nav-desktop"] { - ul { - display: flex; - justify-content: space-between; - align-items: center; - gap: 32px; - - @media (max-width: 55rem) { - gap: 24px; - } - - @media (max-width: 48rem) { - gap: 24px; - } - li { - display: inline-block; - a { - text-decoration: none; - span { - color: var(--color-text-weak); - } - } - a:hover { - text-decoration: underline; - text-underline-offset: var(--space-1); - text-decoration-thickness: 1px; - } - [data-slot="cta-button"] { - background: var(--color-background-strong); - color: var(--color-text-inverted); - padding: 8px 16px 8px 10px; - border-radius: 4px; - font-weight: 500; - text-decoration: none; - display: flex; - align-items: center; - gap: 8px; - white-space: nowrap; - - @media (max-width: 55rem) { - display: none; - } - } - [data-slot="cta-button"]:hover { - background: var(--color-background-strong-hover); - text-decoration: none; - } - } - } - - @media (max-width: 40rem) { - display: none; - } - } - - [data-component="nav-mobile"] { - button > svg { - color: var(--color-icon); - } - } - - [data-component="nav-mobile-toggle"] { - border: none; - background: none; - outline: none; - height: 40px; - width: 40px; - cursor: pointer; - margin-right: -8px; - } - - [data-component="nav-mobile-toggle"]:hover { - background: var(--color-background-weak); - } - - [data-component="nav-mobile"] { - display: none; - - @media (max-width: 40rem) { - display: block; - - [data-component="nav-mobile-icon"] { - cursor: pointer; - height: 40px; - width: 40px; - display: flex; - align-items: center; - justify-content: center; - } - - [data-component="nav-mobile-menu-list"] { - position: fixed; - background: var(--color-background); - top: 80px; - left: 0; - right: 0; - height: 100vh; - - ul { - list-style: none; - padding: 20px 0; - - li { - a { - text-decoration: none; - padding: 20px; - display: block; - - span { - color: var(--color-text-weak); - } - } - - a:hover { - background: var(--color-background-weak); - } - } - } - } - } - } - - [data-slot="logo dark"] { - display: none; - } - - @media (prefers-color-scheme: dark) { - [data-slot="logo light"] { - display: none; - } - [data-slot="logo dark"] { - display: block; - } + /* The lead paragraph stays within two card columns even when the section runs to the edge. */ + [data-slot="lead"] { + max-width: var(--two-cards); } } - [data-component="hero"] { - display: flex; - flex-direction: column; - max-width: 100%; - padding: calc(var(--vertical-padding) * 1.5) var(--padding); + /* The FAQ always spans two card columns, whatever the section width setting, so its plus signs + end on the third column's right edge. */ + &[data-site] [data-component="block"]:has([data-component="faq"]) [data-slot="body"] { + max-width: var(--two-cards); + } - @media (max-width: 30rem) { - padding: var(--vertical-padding) var(--padding); - } + /* "What is OpenCode?": ten features in five rows of two, one feature per card column, under the + two-column lead. */ + &[data-site] [data-component="block"]:has([data-component="features"]) [data-slot="body"] { + max-width: none; + } - @media (prefers-color-scheme: dark) { - [data-slot="zen logo light"] { - display: none; - } - [data-slot="zen logo dark"] { - display: block; - } + &[data-site] [data-component="features"] { + max-width: var(--two-cards); + grid-template-columns: repeat(2, minmax(0, 1fr)); + + /* Phones: one column, each title over its description. */ + @media (max-width: 40rem) { + grid-template-columns: minmax(0, 1fr); + row-gap: 2rem; } } - [data-slot="installation-instructions"] { - color: var(--color-text-strong); - margin-bottom: 8px; - } + /* Settings › Section columns: from 80rem up each section's content spans two or three card + columns beside its title, whatever the section width, and so does everything inside it. The + features stay two to a row (ten in five rows) at either span, never three, so no row is left + with one; the tools keep four to a row and grow wider. + The attribute repeats to outrank the per-section widths above. Narrower screens keep the + section width behaviour. */ + @media (min-width: 80rem) { + &[data-site] [data-component="block"][data-columns][data-columns] { + --body-span: var(--two-cards); - [data-slot="installation"] { - width: 100%; - max-width: 100%; - overflow: hidden; - - @media (max-width: 550px) { - width: calc(100vw - 48px); - } - } - - [data-slot="installation-options"] { - font-size: 13px; - margin-top: 12px; - } - - [data-component="tabs"] { - [data-slot="tablist"] { - display: flex; - gap: 40px; - align-items: center; - border: 1px solid var(--color-border-weak); - border-bottom: none; - border-top-left-radius: 6px; - border-top-right-radius: 6px; - background: var(--color-background-weak); - padding: 0 20px; - - @media (max-width: 60rem) { - gap: 32px; - overflow-x: auto; - width: 100%; - } - } - - [data-slot="tab"] { - appearance: none; - background: transparent; - border: 0; - padding: 16px 0; - margin: 0; - cursor: pointer; - color: var(--color-text-weak); - line-height: 1; - border-bottom: 2px solid transparent; - } - - [data-slot="tab"][aria-selected="true"] { - color: var(--color-text-strong); - border-bottom-color: var(--color-background-strong); - } - - [data-slot="tab"]:focus-visible { - } - - [data-slot="panels"] { - background: var(--color-background-weak); - border: 1px solid var(--color-border-weak); - border-bottom-left-radius: 6px; - border-bottom-right-radius: 6px; - padding: 16px; - } - - [data-slot="panel"] { - display: block; - margin: 0; - overflow: auto; - white-space: pre-wrap; - transition: opacity 0.18s ease; - font-size: 16px; - font-family: var(--font-mono); - width: 100%; - - button { - max-width: 100%; + &[data-columns="3"] { + --body-span: calc(var(--card) * 3 + var(--gutter) * 2); } - [data-slot="command"] { - all: unset; - display: flex; - max-width: 100%; - cursor: pointer; - align-items: center; - color: var(--color-text); - gap: 16px; - color: var(--color-text); - padding: 8px 16px 8px 8px; - border-radius: 4px; + :is([data-slot="body"], [data-slot="lead"], [data-component="features"], [data-component="tools"]) { + max-width: min(100%, var(--body-span)); + } - [data-slot="command-script"] { - display: inline-block; - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - vertical-align: middle; + /* The Console copy keeps its own measure at two columns; split has no title column. */ + &[data-columns="3"]:not([data-console="split"]) [data-slot="copy"] { + max-width: min(100%, var(--body-span)); + } - @media (prefers-color-scheme: dark) { - color: var(--color-text-weak); - } + /* Settings › copy columns: the lead (or the Console headline and text) takes its own two or + three cards, while the features, tools and stats keep the section's columns. The body + grows to whichever is wider. */ + &[data-copy-columns] { + --copy-span: var(--two-cards); - @media (max-width: 35rem) { - width: calc(100% - 40px) !important; - } + &[data-copy-columns="3"] { + --copy-span: calc(var(--card) * 3 + var(--gutter) * 2); } - [data-slot="highlight"] { - font-weight: 500; - color: var(--color-text-strong); + :is([data-slot="body"], [data-slot="copy"]) { + max-width: min(100%, max(var(--body-span), var(--copy-span))); } - } - [data-slot="command"]:hover { - background: var(--color-background-weak-hover); + :is([data-slot="lead"], [data-slot="copy"] > h3, [data-slot="copy"] > p) { + max-width: min(100%, var(--copy-span)); + } - @media (prefers-color-scheme: dark) { - color: var(--color-text-weak); - background: var(--color-background-weak-hover); + [data-component="stats"] { + max-width: min(100%, var(--body-span)); } } } } - [data-slot="hero-copy"] { - [data-slot="releases"] { - background: none; - color: var(--color-text-weak); - padding: 0; - border: none; - font-weight: 400; - cursor: pointer; - margin-bottom: 14px; - border-radius: 0; - display: flex; - width: fit-content; - gap: 12px; - text-decoration: none; - padding-bottom: 2px; - border-bottom: 1px solid transparent; - } + /* Hero title: shared with /product in component/site/hero-title.css. */ - [data-slot="releases"]:hover { - background: none; - padding-bottom: 2px; - border-bottom: 1px solid var(--color-border-weak); - } - - h1 { - font-size: 38px; - color: var(--color-text-strong); - font-weight: 700; - margin-bottom: 8px; - - @media (max-width: 60rem) { - font-size: 22px; - } - } - - p { - color: var(--color-text); - margin-bottom: 32px; - max-width: 82%; - - @media (max-width: 50rem) { - max-width: 100%; - } - } - - a { - background: var(--color-background-strong); - padding: 8px 12px 8px 20px; - color: var(--color-text-inverted); - border: none; - border-radius: 4px; - font-weight: 500; - cursor: pointer; - display: flex; - width: fit-content; - gap: 12px; - text-decoration: none; - } - - a:hover { - background: var(--color-background-strong-hover); - } - } - [data-slot="model-logos"] { - display: flex; - gap: 24px; - margin-bottom: 56px; - - svg { - color: var(--color-background-strong); - } - - @media (prefers-color-scheme: dark) { - svg { - color: var(--color-background-strong); - } - } + /* Hero subtitle: Settings › Subtitle width sets how many card columns it spans, never past the + content edge; below 60rem the hero is one column, so it runs the full width. "2 columns" ends on + the second column's right edge whatever the hero option, like the /product subtitle. */ + &[data-site] [data-component="hero"] p[data-width] { + --columns: 2; + max-width: min(100%, calc(var(--card) * var(--columns) + var(--gutter) * (var(--columns) - 1))); + text-wrap: pretty; } - [data-slot="pricing-copy"] { - strong { - color: var(--color-text-strong); - font-weight: 500; - } - - p:first-child { - margin-bottom: 24px; - color: var(--color-text); - display: flex; - gap: 8px; - - @media (max-width: 40rem) { - flex-direction: column; - gap: 4px; - } - } + &[data-site] [data-component="hero"] p[data-width="3"] { + --columns: 3; } - [data-component="video"] { - border-top: 1px solid var(--color-border-weak); - - video { - width: 100%; - height: auto; - max-width: none; - max-height: none; - display: block; - aspect-ratio: 16 / 9; - object-fit: cover; - } + &[data-site] [data-component="hero"] p[data-width="4"] { + --columns: 4; } - [data-slot="section-title"] { - margin-bottom: 24px; - max-width: 100%; - - div { - display: flex; - gap: 12px; - } - - span { - color: var(--color-icon); - line-height: 200%; - - @media (max-width: 60rem) { - line-height: 180%; - } - } - - h3 { - font-size: 16px; - font-weight: 700; - color: var(--color-text-strong); - margin-bottom: 12px; - } - - p { - margin-bottom: 12px; - color: var(--color-text); - } - - div > p > strong { - font-weight: 500; - color: var(--color-text-strong); - } + /* Settings › Announcement: the "New" bar, modelled on the docs' V1 notice (docs-version-notice.css: + the same height, padding and type, square corners) in the link blue: a solid tag, then a light + wash of the blue with blue text. Closed, it has no height and no opacity; the site root's + data-home-announcement opens it, set before first paint for a saved value, so a saved "on" + never animates in. Contrast (light on #fff and #fbfbfb, dark on #0c0c0c with the dark blues): + tag 5.2:1 (dark 5.2:1 and up), text 5.7:1 (dark 6.4:1 and up). */ + /* The bar is placed against the content column (its page slot is display: contents). */ + [data-component="content"] { + position: relative; } - [data-component="what"] { - border-top: 1px solid var(--color-border-weak); - padding: var(--vertical-padding) var(--padding); - color: var(--color-text); + [data-component="announcement"] { + --card: calc((100cqw - var(--gaps) * var(--gutter)) / var(--visible)); + --announce-tint: light-dark( + color-mix(in srgb, var(--link) 9%, var(--bg)), + color-mix(in srgb, var(--link) 12%, var(--bg)) + ); + --announce-text: light-dark(color-mix(in srgb, var(--link) 85%, #000), color-mix(in srgb, var(--link) 85%, #fff)); + --announce-hover: light-dark(color-mix(in srgb, var(--link) 70%, #000), color-mix(in srgb, var(--link) 60%, #fff)); + display: grid; + grid-template-rows: 0fr; + opacity: 0; + visibility: hidden; + transition: + grid-template-rows 200ms var(--ease-out), + opacity 200ms ease, + visibility 0s linear 200ms; - a { - background: var(--color-background-strong); - padding: 8px 12px 8px 20px; - color: var(--color-text-inverted); - border: none; - border-radius: 4px; - font-weight: 500; - cursor: pointer; - margin-top: 40px; - display: flex; - width: fit-content; - gap: 12px; - text-decoration: none; + /* Level with the logo, over the hero's three card columns; the hero stays where it is. */ + @media (min-width: 60.0625rem) { + position: absolute; + z-index: 1; + top: calc(var(--top) + (var(--logo-height) - 2rem) / 2); + /* The content column's left padding, where the hero starts. */ + inset-inline-start: var(--gutter); + width: min(100%, calc(var(--card) * 3 + var(--gutter) * 2)); } - a:hover { - background: var(--color-background-strong-hover); + @media (prefers-reduced-motion: reduce) { + transition: none; } - ul { - padding: 0; - li { - list-style: none; - margin-bottom: 16px; - display: flex; - gap: 12px; - line-height: 200%; - - @media (max-width: 60rem) { - line-height: 180%; - } - - span { - color: var(--color-icon); - } - strong { - font-weight: 500; - color: var(--color-text-strong); - margin-right: 12px; - } - } - li:last-child { - margin-bottom: 0; - } - } - } - - [data-component="growth"] { - border-top: 1px solid var(--color-border-weak); - padding: var(--vertical-padding) var(--padding); - - svg { - margin-top: 32px; - width: 100%; - height: 100%; - margin-left: 40px; - - @media (max-width: 60rem) { - display: none; - } - } - - figure { - margin-top: 16px; - font-size: 13px; - margin-left: 40px; - - span { - color: var(--color-text-strong); - } - - @media (max-width: 60rem) { - display: none; - } - } - } - - [data-component="privacy"] { - border-top: 1px solid var(--color-border-weak); - padding: var(--vertical-padding) var(--padding); - - [data-slot="privacy-title"] { - h3 { - font-size: 16px; - font-weight: 700; - color: var(--color-text-strong); - margin-bottom: 12px; - } - - div { - display: flex; - gap: 12px; - } - - span { - color: var(--color-icon); - line-height: 200%; - } - } - } - - [data-component="zen-cta"] { - border-top: 1px solid var(--color-border-weak); - display: flex; - padding: var(--vertical-padding) var(--padding); - } - - [data-slot="zen-cta-copy"] { - strong { - color: var(--color-text-strong); - font-weight: 700; - margin-bottom: 16px; - display: block; - } - - p { - color: var(--color-text); - margin-bottom: 24px; - max-width: 90%; - - @media (max-width: 50rem) { - max-width: 100%; - } - } - - a { - background: var(--color-background); - padding: 8px 12px 8px 20px; - color: var(--color-text-strong); - border: none; - border-radius: 4px; - border: 1px solid var(--color-border-weak); - font-weight: 500; - cursor: pointer; - display: flex; - width: fit-content; - gap: 12px; - text-decoration: none; - } - - a:hover { - background: var(--color-background-weak); - } - } - [data-slot="model-logos"] { - display: flex; - gap: 24px; - margin-bottom: 40px; - - svg { - color: var(--color-background-strong); - } - - @media (prefers-color-scheme: dark) { - svg { - color: var(--color-background-strong); - } - } - } - - [data-component="email"] { - border-top: 1px solid var(--color-border-weak); - padding: var(--vertical-padding) var(--padding); - color: var(--color-text); - - [data-slot="dock"] { - border-radius: 14px; - border: 0.5px solid rgba(176, 176, 176, 0.6); - background: #f2f1f0; - margin-bottom: 32px; + [data-slot="clip"] { + min-height: 0; overflow: hidden; - height: 64px; - width: 185px; - box-shadow: - 0 6px 80px 0 rgba(0, 0, 0, 0.05), - 0 2.507px 33.422px 0 rgba(0, 0, 0, 0.04), - 0 1.34px 17.869px 0 rgba(0, 0, 0, 0.03), - 0 0.751px 10.017px 0 rgba(0, 0, 0, 0.03), - 0 0.399px 5.32px 0 rgba(0, 0, 0, 0.02), - 0 0.166px 2.214px 0 rgba(0, 0, 0, 0.01); - - img { - width: 100%; - height: auto; - } - - @media (prefers-color-scheme: dark) { - background: #312d2d; - } } - [data-slot="form"] { - position: relative; - - input { - background: var(--color-background-weak); - border-radius: 6px; - border: 1px solid var(--color-border-weak); - padding: 20px; - width: 100%; - - /* Use color, not -moz-text-fill-color, for normal text */ - color: var(--color-text-strong); - - @media (max-width: 30rem) { - padding-bottom: 80px; - } - - &:not(:focus) { - color: var(--color-text-strong); - } - - &::placeholder { - color: var(--color-text-weak); - opacity: 1; - } - - /* Optional legacy */ - &::-moz-placeholder { - color: var(--color-text-weak); - opacity: 1; - } - } - - input:focus { - background: var(--color-background-interactive-weaker); - outline: none; - border: none; - color: var(--color-text-strong); - border: 1px solid var(--color-background-strong); - box-shadow: 0 0 0 3px var(--color-background-interactive); - - @media (prefers-color-scheme: dark) { - box-shadow: none; - border: 1px solid var(--color-background-interactive); - } - } - - button { - position: absolute; - height: 40px; - right: 12px; - background: var(--color-background-strong); - padding: 4px 20px; - color: var(--color-text-inverted); - border-radius: 4px; - border: none; - outline: none; - font-weight: 500; - cursor: pointer; - top: 50%; - margin-top: -20px; - - @media (max-width: 30rem) { - left: 20px; - right: 20px; - bottom: 20px; - top: auto; - } - } - } - } - - [data-component="faq"] { - border-top: 1px solid var(--color-border-weak); - padding: var(--vertical-padding) var(--padding); - - ul { - padding: 0; - - li { - list-style: none; - margin-bottom: 24px; - line-height: 200%; - } - } - - [data-slot="faq-question"] { - display: flex; - gap: 16px; - margin-bottom: 8px; - color: var(--color-text-strong); - font-weight: 500; - cursor: pointer; - background: none; - border: none; - padding: 0; - align-items: start; - min-height: 24px; - - svg { - margin-top: 2px; - } - - [data-slot="faq-icon-plus"] { - flex-shrink: 0; - color: var(--color-text-weak); - margin-top: 2px; - - [data-closed] & { - display: block; - } - [data-expanded] & { - display: none; - } - } - [data-slot="faq-icon-minus"] { - flex-shrink: 0; - color: var(--color-text-weak); - margin-top: 2px; - - [data-closed] & { - display: none; - } - [data-expanded] & { - display: block; - } - } - [data-slot="faq-question-text"] { - flex-grow: 1; - text-align: left; - } - } - - [data-slot="faq-answer"] { - margin-left: 40px; - margin-bottom: 32px; - line-height: 200%; - } - } - - [data-component="testimonials"] { - border-top: 1px solid var(--color-border-weak); - padding: var(--vertical-padding) var(--padding); - display: flex; - flex-direction: column; - gap: 20px; - + /* On phones the bar is part of the page, so the space under it opens and closes with it. */ @media (max-width: 60rem) { - --padding: 1rem; - --vertical-padding: 1rem; + [data-slot="bar"] { + margin-bottom: 1.5rem; + } + } + + [data-slot="bar"] { + display: flex; + align-items: stretch; + min-height: 2rem; + background: var(--announce-tint); + font: 400 13px/1.4 var(--font-mono); + color: var(--announce-text); + } + + [data-slot="badge"] { + flex-shrink: 0; + display: flex; + align-items: center; + padding: 1px 0.75rem 0; + background: light-dark(var(--link), color-mix(in srgb, var(--link) 65%, #000)); + color: #fff; + font-weight: 700; + text-transform: uppercase; + } + + p { + align-self: center; + margin: 0; + padding: 0.375rem 0.75rem 0.3125rem; + text-wrap: pretty; } a { - text-decoration: none; - } - [data-slot="testimonial"] { - background: var(--color-background-weak); - border-radius: 6px; - border: 1px solid var(--color-border-weak); - padding: 20px; - display: flex; - flex-direction: column; - gap: 12px; + color: inherit; + text-decoration: underline; + text-decoration-thickness: 1px; + text-underline-offset: 0.15em; + transition: color 150ms ease; - @media (max-width: 60rem) { - flex-direction: column-reverse; - gap: 24px; - } - - [data-slot="name"] { - display: flex; - gap: 16px; - - @media (max-width: 60rem) { - flex-direction: column; - gap: 8px; - } - - span { - display: inline-block; - } - - img { - height: 24px; - width: 24px; - border-radius: 24px; + @media (hover: hover) and (pointer: fine) { + &:hover { + color: var(--announce-hover); } } - [data-slot="quote"] { - margin-left: 40px; - - @media (max-width: 60rem) { - margin-left: 0; - } - span { - color: var(--color-text); - text-decoration: none; - } - } - } - - [data-slot="button"] { - all: unset; - cursor: pointer; - display: flex; - align-items: center; - color: var(--color-text); - gap: var(--space-2-5); - font-size: 1rem; - - @media (max-width: 24rem) { - font-size: 0.875rem; + &:active { + color: var(--announce-hover); } - strong { - color: var(--color-text-strong); - font-weight: 500; - } - - @media (max-width: 40rem) { - justify-content: flex-start; - } - - @media (max-width: 30rem) { - justify-content: center; + &:focus-visible { + color: var(--announce-hover); + outline: 2px solid var(--link); + outline-offset: 2px; } } } - [data-component="copy-status"] { - [data-slot="copy"] { - display: block; - width: var(--space-4); - height: var(--space-4); - color: var(--color-text-weaker); - - [data-copied] & { - display: none; - } - } - - [data-slot="check"] { + /* Settings › Announcement style. "bar" is the box above; "text" is one line of blue text with + no box: "NEW" set like the bar's tag, then the whole message as its link, underlined on hover. + 2rem tall like the bar, so it centres on the logo the same way. The blue is the bar's text + blue (5.9:1 on the light page, 6.5:1 and up on the dark one). */ + [data-component="announcement"] { + [data-slot="line"] { display: none; - width: var(--space-4); - height: var(--space-4); - color: var(--color-text-strong); - - [data-copied] & { - display: block; - } - } - } - - [data-component="footer"] { - border-top: 1px solid var(--color-border-weak); - display: flex; - flex-direction: row; - - @media (max-width: 65rem) { - border-bottom: 1px solid var(--color-border-weak); - } - - [data-slot="cell"] { - flex: 1; - text-align: center; + align-items: center; + gap: 0.75rem; + min-height: 2rem; + margin: 0; + /* Over the bar's own paragraph padding. */ + padding: 0; + font: 400 13px/1.4 var(--font-mono); + color: var(--announce-text); + text-wrap: pretty; a { text-decoration: none; - padding: 2rem 0; - width: 100%; - display: block; + } - span { - color: var(--color-text-weak); + @media (hover: hover) and (pointer: fine) { + a:hover { + color: var(--announce-text); + text-decoration: underline; + } + } - @media (max-width: 40rem) { - display: none; + a:active { + color: var(--announce-text); + text-decoration: underline; + } + + a:focus-visible { + color: var(--announce-text); + text-decoration: underline; + } + } + + /* The link's right chevron (icons.tsx), in the text's colour, a small step after the words. */ + [data-slot="chevron-right"] { + display: inline-block; + margin-inline-start: 0.25rem; + vertical-align: -1px; + } + + [data-slot="new"] { + flex-shrink: 0; + font-weight: 700; + text-transform: uppercase; + } + + /* "chip": "NEW" in white on the bar tag's blue (5.2:1 light, 6.2:1 and up dark), 4px of + padding round it, so it stays shorter than the logo. */ + &[data-style="chip"] [data-slot="new"] { + padding: 4px 8px; + background: light-dark(var(--link), color-mix(in srgb, var(--link) 65%, #000)); + color: #fff; + line-height: 1; + } + + &:is([data-style="text"], [data-style="chip"]) { + [data-slot="bar"] { + display: none; + } + + [data-slot="line"] { + display: flex; + } + + @media (max-width: 60rem) { + [data-slot="line"] { + align-items: baseline; + min-height: 0; + margin-bottom: 1.25rem; + } + } + } + } + + /* "banner": the in-content line and bar give way to the banner above the page. */ + [data-component="announcement"][data-style="banner"] { + display: none; + } + + &[data-site][data-home-announcement="on"] [data-component="announcement"] { + grid-template-rows: 1fr; + opacity: 1; + visibility: visible; + transition: + grid-template-rows 200ms var(--ease-out), + opacity 200ms ease, + visibility 0s; + + @media (prefers-reduced-motion: reduce) { + transition: none; + } + } + + /* Settings › Hero install: every option renders hidden, and only an exact match of the site root's + data-hero-install (set by the pre-paint script for a saved value) shows one. "off", or no + attribute at all, shows none, so nothing appears or goes after load. "agent only" shows the row + above the carousel with just the agent button (below). Phones never show any. */ + &[data-site] [data-component="hero-install"] { + display: none; + } + + @media (min-width: 60.0625rem) { + &[data-site][data-hero-install="line"] [data-component="hero-install"][data-mode="line"], + &[data-site][data-hero-install="tabs"] [data-component="hero-install"][data-mode="tabs"], + &[data-site]:is([data-hero-install="above carousel"], [data-hero-install="agent only"]) + [data-component="hero-install"][data-mode="row"] { + display: flex; + } + } + + /* "agent only": the row keeps its place and spacing, with the ghost button (robot icon and the + Design mode label) as its only visible part, whatever the install row style. */ + &[data-site][data-hero-install="agent only"] [data-component="hero-install"][data-mode="row"] { + padding-inline-end: 0; + + > :not([data-slot="sr-only"]) { + display: none; + } + + > [data-slot="ghost"] { + display: inline-flex; + } + } + + /* Settings › Hero install: a small mono command under the subtitle, desktop only. The tabs and + the command share one 36px bordered box, the height of a site button. */ + [data-component="hero-install"] { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.75rem 1.25rem; + /* 1.75rem below the subtitle, inside the hero's 2.5rem gap. */ + margin-top: -0.75rem; + font-family: var(--font-mono); + font-size: var(--fs-meta); + color: var(--text-weak); + + @media (max-width: 60rem) { + display: none; + } + + [data-slot="tabs"] { + display: flex; + height: 2.25rem; + border: 1px solid var(--border); + border-inline-end: 0; + + button { + padding: 0 0.75rem; + color: var(--text-weaker); + transition: + color 150ms ease, + background-color 150ms ease; + + &[aria-selected="true"] { + background: var(--bg-weaker); + color: var(--text-strong); + } + + @media (hover: hover) and (pointer: fine) { + &:hover { + color: var(--text-strong); + } + } + + &:active { + color: var(--text-strong); + } + + &:focus-visible { + outline: 2px solid var(--link); + outline-offset: -2px; + } + } + } + + &[data-mode="tabs"] { + column-gap: 0; + } + + /* Above the product carousel: the curl command, and beside it the agent button (the brand page's + neutral copy button). The space above it, from the subtitle's ink (its line box runs about + 0.375rem below the text, as in logo-wall.css) through the carousel's 3rem top margin, and the + space below it to the cards are both 2.5rem. */ + &[data-mode="row"] { + flex-wrap: nowrap; + gap: 0.75rem; + margin: calc(2.5rem - 3rem - 0.375rem) 0 2.5rem; + + > * { + flex-shrink: 0; + } + + /* Settings › Install row style: every layout's parts render, and data-style shows the ones it + uses. */ + > :is( + [data-slot="segmented"], + [data-slot="ghost"], + [data-slot="agent-icon"], + [data-slot="or"], + [data-slot="agent-link"], + [data-slot="agent-note"], + [data-slot="agent-button"] + ) { + display: none; + } + + &[data-style="inline"] > :is([data-slot="or"], [data-slot="agent-link"]), + &[data-style^="text link"] > [data-slot="agent-link"], + &[data-style="icon only"] > [data-slot="agent-icon"], + &[data-style="ghost button left"] > [data-slot="ghost"], + &[data-style="button"] > [data-slot="agent-button"] { + display: inline-flex; + } + + &[data-style="segmented"] > [data-slot="segmented"] { + display: flex; + } + + /* Far right, on the page's right padding (the carousel bleeds past it). */ + &[data-style="text link right"] { + padding-inline-end: var(--edge); + + > [data-slot="agent-link"] { + margin-inline-start: auto; + } + } + + &[data-style="text link left"] > [data-slot="agent-link"] { + order: -1; + } + + &[data-style="inline"] { + gap: 0.25rem; + + > [data-slot="or"] { + color: var(--text-weaker); + font-family: var(--font-sans); + font-size: var(--fs-small); + } + } + + /* A small muted line under the command, on its text. */ + &[data-style="two rows"] { + flex-wrap: wrap; + row-gap: 0.25rem; + + > [data-slot="agent-note"] { + display: block; + flex-basis: 100%; + padding-inline-start: 0.875rem; + font-family: var(--font-sans); + font-size: var(--fs-meta); + color: var(--text-weaker); + + [data-slot="agent-link"] { + display: inline-flex; + height: auto; + padding: 0; + font-size: inherit; } } } - a:hover { - background: var(--color-background-weak); - text-decoration: underline; - text-underline-offset: var(--space-1); - text-decoration-thickness: 1px; + /* The row's width holds whichever text it copies. */ + &[data-style="segmented"] [data-slot="install"] [data-slot="text"] { + width: 46ch; + } + + /* Text actions: Inter, muted, the copy icon after the label. */ + [data-slot="agent-link"] { + align-items: center; + gap: 0.375rem; + height: 2.25rem; + padding: 0 0.5rem; + font-family: var(--font-sans); + font-size: var(--fs-small); + color: var(--text-weak); + transition: color 150ms ease; + + @media (hover: hover) and (pointer: fine) { + &:hover { + color: var(--text-strong); + } + } + + &:active { + color: var(--text-strong); + } + + &:focus-visible { + outline: 2px solid var(--link); + outline-offset: 2px; + } + } + + [data-slot="agent-icon"] { + align-items: center; + justify-content: center; + width: 2.25rem; + height: 2.25rem; + color: var(--text-weak); + + @media (hover: hover) and (pointer: fine) { + &:hover { + color: var(--text-strong); + background: var(--bg-weaker); + } + } + + &:active { + color: var(--text-strong); + background: var(--bg-weaker); + } + + &:focus-visible { + outline: 2px solid var(--link); + outline-offset: -2px; + } + } + + [data-slot="ghost"] { + align-items: center; + gap: 0.5rem; + height: 2.25rem; + padding: 0 0.75rem; + border: 1px solid var(--border); + font-family: var(--font-sans); + font-size: var(--fs-small); + color: var(--text-strong); + transition: background-color 150ms ease; + + > svg:first-child { + color: var(--text-weak); + } + + @media (hover: hover) and (pointer: fine) { + &:hover { + background: var(--bg-weaker); + } + } + + &:active { + background: var(--bg-weaker); + } + + &:focus-visible { + outline: 2px solid var(--link); + outline-offset: 2px; + } + } + + /* Like the Terminal menu rows: the chosen side has the blue tint and the bar on its left. */ + [data-slot="segmented"] { + height: 2.25rem; + margin-inline-end: 0.25rem; + + button { + position: relative; + padding: 0 0.75rem; + font-family: var(--font-mono); + font-size: var(--fs-meta); + color: var(--text-weak); + + &::before { + content: ""; + position: absolute; + top: 0; + bottom: 0; + inset-inline-start: 0; + width: 2px; + background: var(--link); + opacity: 0; + } + + &[aria-pressed="true"] { + color: var(--text-strong); + background: light-dark( + color-mix(in srgb, var(--link) 7%, transparent), + color-mix(in srgb, var(--link) 13%, transparent) + ); + + &::before { + opacity: 1; + } + } + + @media (hover: hover) and (pointer: fine) { + &:hover { + color: var(--text-strong); + } + } + + &:active { + color: var(--text-strong); + } + + &:focus-visible { + outline: 2px solid var(--link); + outline-offset: -2px; + } + } + } + + /* A row of the Terminal card's install menu (site.css: the site-menu rows), outside a menu: + no box, the command in the menu's mono size and colour, and Copy crossfading to Copied. + Hover and keyboard focus add the menu's tint and the bar on the left edge, always in the + blue of Settings › Menu color "blue" (the same mixes of the link blue), whatever that + setting is. 36px tall, like the agent button beside it. */ + [data-slot="install"] { + --row-hover: light-dark( + color-mix(in srgb, var(--link) 7%, transparent), + color-mix(in srgb, var(--link) 13%, transparent) + ); + --row-press: light-dark( + color-mix(in srgb, var(--link) 11%, transparent), + color-mix(in srgb, var(--link) 18%, transparent) + ); + position: relative; + display: grid; + grid-template-columns: minmax(0, auto) 16px; + gap: 0.75rem; + align-items: center; + flex: 0 1 auto; + min-width: 0; + height: 2.25rem; + padding: 0 0.875rem; + font-family: var(--font-mono); + font-size: var(--fs-meta); + text-align: start; + + &::before { + content: ""; + position: absolute; + top: 0; + bottom: 0; + inset-inline-start: 0; + width: 2px; + background: var(--link); + opacity: 0; + } + + @media (hover: hover) and (pointer: fine) { + &:hover { + background: var(--row-hover); + + &::before { + opacity: 1; + } + } + } + + &:focus-visible { + outline: none; + background: var(--row-hover); + + &::before { + opacity: 1; + } + } + + &:active { + background: var(--row-press); + } + + [data-slot="text"] { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: var(--text-strong); + } + + [data-slot="status"] { + display: grid; + justify-items: end; + color: var(--text-weak); + + svg { + display: block; + } + + > span { + grid-area: 1 / 1; + transition: + opacity 150ms ease, + filter 150ms ease; + } + } + + [data-slot="done"], + &[data-copied] [data-slot="idle"] { + opacity: 0; + filter: blur(2px); + } + + &[data-copied] [data-slot="status"] { + color: var(--text-strong); + } + + &[data-copied] [data-slot="done"] { + opacity: 1; + filter: none; + } } } - [data-slot="cell"] + [data-slot="cell"] { - border-left: 1px solid var(--color-border-weak); + [data-slot="copy-labels"] { + display: inline-grid; - @media (max-width: 40rem) { - border-left: none; + > span { + grid-area: 1 / 1; + visibility: hidden; + } + + > [data-active] { + visibility: visible; } } - /* Mobile: third column on its own row */ - @media (max-width: 25rem) { - flex-wrap: wrap; - - [data-slot="cell"] { - flex: 1 0 100%; - border-left: none; - border-top: 1px solid var(--color-border-weak); - } - - [data-slot="cell"]:nth-child(1) { - border-top: none; - } - } - } - - [data-component="legal"] { - color: var(--color-text-weak); - text-align: center; - display: flex; - gap: 32px; - justify-content: center; - - a { - color: var(--color-text-weak); - text-decoration: none; + [data-slot="copy-icon"] { + flex-shrink: 0; } - a:hover { - color: var(--color-text); + [data-slot="command"] { + display: flex; + align-items: center; + gap: 0.75rem; + height: 2.25rem; + padding-block: 0; + padding-inline: 0.875rem 0.25rem; + border: 1px solid var(--border); + min-width: 0; + } + + code { + color: var(--text-strong); + white-space: nowrap; + } + + [data-slot="copy"] { + align-self: stretch; + min-width: 8ch; + padding: 0 0.625rem; + color: var(--text-weak); + transition: + color 150ms ease, + scale 160ms var(--ease-out); + + &:active { + scale: 0.97; + } + + @media (hover: hover) and (pointer: fine) { + &:hover { + color: var(--text-strong); + } + } + } + + [data-slot="more"] { + color: var(--text-weak); text-decoration: underline; + text-decoration-color: var(--border-strong); + text-underline-offset: 0.2em; + transition: color 150ms ease; + + @media (hover: hover) and (pointer: fine) { + &:hover { + color: var(--text-strong); + } + } + + &:active { + color: var(--text-strong); + } } } - input:-webkit-autofill, - input:-webkit-autofill:hover, - input:-webkit-autofill:focus, - input:-webkit-autofill:active { - transition: background-color 5000000s ease-in-out 0s; + [data-component="features"] { + line-height: 1.4; + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 2.5rem var(--gutter); + + /* The whole feature is one link to its docs page; the arrow after the title shows on hover. */ + a { + display: flex; + flex-direction: column; + gap: 0.5rem; + color: inherit; + } + + strong { + display: inline-flex; + align-items: center; + gap: 4px; + font-weight: 500; + } + + /* The description only: a title with Design mode copy has its own span inside the strong. */ + a > span { + color: var(--text-weak); + transition: color 150ms ease; + } + + [data-slot="external"] { + flex-shrink: 0; + translate: calc(-3px * var(--x-dir, 1)) -2px; + opacity: 0; + transition: + opacity 150ms ease, + translate 200ms var(--ease-out); + } + + @media (hover: hover) and (pointer: fine) { + a:hover { + [data-slot="external"] { + opacity: 1; + translate: 0 -2px; + } + + > span { + color: var(--text); + } + } + } + + a:active { + [data-slot="external"] { + opacity: 1; + translate: 0 -2px; + } + + > span { + color: var(--text); + } + } + + a:focus-visible [data-slot="external"] { + opacity: 1; + translate: 0 -2px; + } + + /* Touch has no hover to reveal the arrow, so it always shows. */ + @media (hover: none), (pointer: coarse) { + [data-slot="external"] { + opacity: 1; + translate: 0 -2px; + } + } } - input:-webkit-autofill { - -webkit-text-fill-color: var(--color-text-strong) !important; + [data-component="stats"] { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: var(--gutter); + + /* The numerals' baseline and the label's cap height are the box edges (text-box), so the gap + is the space you see; the same 16px as the avatar wall to the line under it. */ + div { + display: flex; + flex-direction: column-reverse; + gap: 1rem; + } + + dd { + font-family: var(--font-mono); + font-size: min(var(--hero-size), var(--fs-display-max)); + line-height: 1.2; + letter-spacing: -0.03em; + text-box: trim-end cap alphabetic; + + /* "225K" and "1K+" read left to right in every language; their digits are flex items. */ + > * { + direction: ltr; + unicode-bidi: isolate; + } + } + + dt { + color: var(--text-weak); + text-box: trim-start cap alphabetic; + } } - input:-moz-autofill { - -moz-text-fill-color: var(--color-text-strong) !important; + /* Slot stats: every character is a box one line tall, side by side, so the digits' reels and the + fixed "K" or "+" share a baseline. A reel only clips and fades its edges while it spins. */ + [data-component="slot-stat"] { + display: inline-flex; + font-variant-numeric: tabular-nums; + + > span { + display: block; + height: 1lh; + } + + [data-slot="reel"] { + overflow: hidden; + + &[data-spinning] { + mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); + } + } + + [data-slot="strip"] { + display: flex; + flex-direction: column; + will-change: transform; + + > span { + height: 1lh; + } + } + } + + [data-component="odometer"] { + display: inline-flex; + + [data-slot="digit"] { + display: inline-block; + height: 1lh; + overflow: hidden; + /* Soften the edges so neighboring digits never peek in mid-roll. */ + mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent); + } + + [data-slot="strip"] { + display: flex; + flex-direction: column; + transition: translate 2000ms cubic-bezier(0.16, 1, 0.3, 1); + transition-delay: calc(var(--index) * 120ms); + } + } + + [data-component="odometer"] [data-slot="suffix"] { + display: inline-block; + opacity: 0; + translate: 0 0.3em; + transition: + opacity 500ms ease, + translate 700ms cubic-bezier(0.16, 1, 0.3, 1); + transition-delay: calc(var(--index) * 120ms + 900ms); + } + + [data-component="stats"][data-visible] [data-slot="suffix"] { + opacity: 1; + translate: 0 0; + } + + [data-component="stats"][data-visible] [data-slot="strip"] { + translate: 0 calc(var(--target) * -1lh); + } + + /* Once the sidebar is gone the cards are wider than half the page, so the stats numbers set on + the content width instead, sized like a 15-character title line and never larger than the + two-card size. */ + @media (max-width: 60rem) { + &[data-site] :is([data-component="hero"], [data-component="block"]) { + --hero-fit: min(calc(var(--two-cards) / (15 * 0.57) * 0.98), calc(100cqw / (15 * 0.57) * 0.98)); + } + + &[data-site] [data-component="stats"] dd { + font-size: min(var(--hero-fit), var(--fs-display-max)); + } + + &[data-site] [data-component="block"] [data-slot="body"] { + max-width: none; + } + } +} + +/* Console section. The markup is the same for every option so the setting only switches an + attribute. The copy starts on the second card, in line with the other section bodies; split + starts it on the first. */ +[data-page="home"][data-site] [data-component="block"][data-console] { + /* Console height: the padding and minimum height the panel and inline options use, and the + figure height for split. "card" is a carousel card's 4:5 media. The copy is centred + vertically and the section grows when the copy needs more room. */ + --console-pad: 3.5rem; + --console-min: 0px; + --console-figure: 22rem; + position: relative; + + &[data-console-height="card"] { + --console-pad: 1.5rem; + --console-min: calc(var(--card) * 5 / 4); + --console-figure: var(--console-min); + } + + &[data-console-height="half"] { + --console-pad: 3rem; + --console-min: max(360px, 50svh); + --console-figure: var(--console-min); + } + + /* Twice the 1.25rem it was, above the kicker and below the button (David, Nov 2026). */ + &[data-console-height="compact"] { + --console-pad: 2.5rem; + --console-figure: 0px; + } + + [data-slot="console"] { + position: relative; + grid-column: 1 / -1; + display: flex; + flex-direction: column; + justify-content: center; + min-height: var(--console-min); + padding-inline-start: calc(var(--card) + var(--gutter)); + } + + [data-slot="copy"] { + position: relative; + display: flex; + flex-direction: column; + align-items: flex-start; + max-width: min(34rem, 100%); + } + + /* The section's name inside the panel, a small uppercase label above the headline. */ + [data-slot="eyebrow"] { + font-family: var(--font-mono); + font-size: var(--fs-meta); + font-weight: 400; + line-height: 1; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--text-weak); + } + + /* The headline: 28px at 1440, a step down from the Console site's second-level headlines. */ + h3 { + margin-top: 1rem; + font-family: var(--font-mono); + font-size: clamp(1.5rem, 2vw, 1.75rem); + font-weight: 400; + line-height: 1.2; + letter-spacing: -0.03em; + color: var(--text-strong); + text-wrap: balance; + } + + p { + margin-top: 0.75rem; + font-size: var(--fs-lead); + line-height: 1.4; + color: var(--text); + text-wrap: pretty; + } + + [data-slot="actions"] { + display: flex; + align-items: center; + gap: 1.5rem; + margin-top: 2.25rem; + } + + /* The same size and line as the button label, so the two share a baseline. */ + [data-slot="note"] { + min-width: 0; + font-size: var(--fs-small); + line-height: 1.25rem; + color: var(--text-weak); + } + + /* The dots come from console-field.tsx as a mask. The landing page shows base dots at 0.3 and + accent columns at 0.5. Here they fade in from just past halfway down, below most of the copy. They sweep in from the + centre once, the first time the section comes into view. */ + [data-component="console-field"] { + position: absolute; + inset: 0; + overflow: hidden; + pointer-events: none; + + &::before { + content: ""; + position: absolute; + inset: 0; + visibility: hidden; + background: color-mix(in srgb, var(--text-strong) 50%, transparent); + mask-image: + var(--console-dots), linear-gradient(to bottom, transparent 55%, #000 100%), + linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); + mask-size: + 100% 100%, + 100% 100%, + 0% 100%; + mask-position: center; + mask-repeat: no-repeat; + mask-composite: intersect; + transition: mask-size 1.1s var(--ease-out); + } + + &[data-ready]::before { + visibility: visible; + } + + &[data-entered]::before { + mask-size: + 100% 100%, + 100% 100%, + 300% 100%; + } + /* After the sweep, a soft band of brighter dots drifts across the field, like light passing + over it. It runs only while the section is on screen. */ + &::after { + content: ""; + position: absolute; + inset: 0; + visibility: hidden; + background: var(--text-strong); + mask-image: + var(--console-dots), linear-gradient(to bottom, transparent 55%, #000 100%), + linear-gradient(105deg, transparent 35%, #000 50%, transparent 65%); + mask-size: + 100% 100%, + 100% 100%, + 250% 100%; + mask-position: + center, + center, + 150% 0; + mask-repeat: no-repeat; + mask-composite: intersect; + opacity: 0.7; + } + + &[data-ready][data-entered]::after { + visibility: visible; + animation: console-shimmer 7s 1.1s linear infinite; + animation-play-state: paused; + } + + &[data-ready][data-entered][data-visible]::after { + animation-play-state: running; + } + + @media (prefers-reduced-motion: reduce) { + &::before { + transition: none; + } + + &[data-ready][data-entered]::after { + animation: none; + visibility: hidden; + } + } + } +} + +/* No divider above, whatever the section spacer is (the second attribute outranks the spacer + rules). The gap below the FAQ is half the "space" spacer's (David, 5 Nov: 184px to 92px, and + 96px to 48px on phones). The "section" option keeps the spacer. */ +[data-page="home"][data-site] [data-component="block"][data-console]:not([data-console="section"]) { + margin-top: calc(var(--block-space) + 1.25rem); + padding-top: 0; + border-top: 0; + border-image: none; + background-image: none; + + @media (max-width: 60rem) { + margin-top: var(--block-space); + } +} + +/* The dither band is a border and two pseudo-elements; one more attribute outranks it. */ +[data-page="home"][data-site][data-spacer] [data-component="block"][data-console]:not([data-console="section"]) { + border-top: 0; + + &::before, + &::after { + content: none; + } +} + +/* Panel: a dark panel across the whole content width, filled with the dots. It stays dark in the + light theme, like the Console site; the tokens inside resolve to their dark values. */ +[data-page="home"][data-site] [data-component="block"][data-console="panel"] [data-slot="console"] { + color-scheme: dark; + padding-block: var(--console-pad); + padding-inline-end: 1.75rem; + background: var(--bg-weak); +} + +/* Inline: no panel. The dots sit behind the whole section. */ +[data-page="home"][data-site] [data-component="block"][data-console="inline"] { + [data-slot="console"] { + padding-block: var(--console-pad); + } + + /* No frame: the dots alone make the background and run to every edge, so they draw the + section's shape. A soft clearing centred on the copy keeps the text readable. The third mask + layer is the sweep (before) or the shimmer band (after), which animate. */ + [data-component="console-field"] { + /* The shimmer stays faint over 1px dots, as on the Console site. */ + &::after { + opacity: 0.35; + } + + /* Settings › Inline fade sets how far the dots thin out at the centre: 100% clears them + completely, 0% leaves the field even. */ + --clearing: radial-gradient( + ellipse 42% 62% at 38% 50%, + rgb(0 0 0 / calc(1 - var(--clearing-strength, 1))) 35%, + #000 100% + ); + + &::before { + mask-image: + var(--console-dots), var(--clearing), linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); + } + + &::after { + mask-image: + var(--console-dots), var(--clearing), linear-gradient(105deg, transparent 35%, #000 50%, transparent 65%); + } + } +} + +/* Slim: one short row, centred: the headline that names the Console, then "Talk to sales" + (secondary) and "Start for free" (primary). The dots from the inline option fill the row, with + a soft clearing behind the content. */ +[data-page="home"][data-site] [data-component="block"][data-console="slim"] { + [data-slot="console"] { + display: none; + } + + [data-slot="slim"] { + position: relative; + grid-column: 1 / -1; + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + column-gap: 2.5rem; + row-gap: 1.25rem; + padding: 4rem 0; + text-align: center; + + h3 { + position: relative; + font-family: var(--font-mono); + font-size: clamp(1.25rem, 1.7vw, 1.5rem); + font-weight: 400; + line-height: 1.25; + letter-spacing: -0.02em; + color: var(--text-strong); + text-wrap: balance; + } + + [data-slot="actions"] { + position: relative; + display: flex; + flex: none; + gap: 0.75rem; + } + + [data-component="console-field"] { + &::after { + opacity: 0.35; + } + + --clearing: radial-gradient( + ellipse 46% 70% at 50% 50%, + rgb(0 0 0 / calc(1 - var(--clearing-strength, 1))) 35%, + #000 100% + ); + + &::before { + mask-image: + var(--console-dots), var(--clearing), linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); + } + + &::after { + mask-image: + var(--console-dots), var(--clearing), linear-gradient(105deg, transparent 35%, #000 50%, transparent 65%); + } + } + + @media (max-width: 60rem) { + flex-direction: column; + padding: 3rem 0; + } + } +} + +/* Split: the copy on one half, the dots as a framed figure on the other. With four cards on + screen each half is exactly two cards. */ +[data-page="home"][data-site] [data-component="block"][data-console="split"] { + grid-template-columns: repeat(2, minmax(0, 1fr)); + + [data-slot="console"] { + display: contents; + } + + [data-slot="copy"] { + grid-area: 1 / 1; + align-self: center; + padding-inline-end: var(--gutter); + } + + [data-component="console-field"] { + position: relative; + grid-area: 1 / 2; + min-height: var(--console-figure); + color-scheme: dark; + background: var(--bg-weak); + border: 1px solid var(--border); + } +} + +/* Settings › Console label: "inside" keeps the eyebrow above the headline; "left" sets the name in + the first card column like every other section title, and the panel (or the slim row) starts on + the second card, as wide as Section columns sets from 80rem up. Split has no title column and + keeps its eyebrow. */ +[data-page="home"][data-site] [data-component="block"][data-console] > [data-slot="label"] { + display: none; +} + +[data-page="home"][data-site] + [data-component="block"][data-console-label="left"]:is( + [data-console="panel"], + [data-console="inline"], + [data-console="slim"] + ) { + > [data-slot="label"] { + display: block; + grid-row: 1; + } + + [data-slot="eyebrow"] { + display: none; + } + + [data-slot="copy"] h3 { + margin-top: 0; + } + + :is([data-slot="console"], [data-slot="slim"]) { + grid-column: 2; + grid-row: 1; + max-width: var(--body-span, none); + } + + @media (min-width: 60.0625rem) { + [data-slot="console"] { + padding-inline-start: 0; + } + + &[data-console="panel"] [data-slot="console"] { + padding-inline-start: 1.75rem; + } + } +} + +/* Settings › Console layout "columns" (with the name on the left): the panel (or slim row) runs + across columns 2–4, to the content edge. Below 60rem the section stacks. */ +[data-page="home"][data-site] + [data-component="block"][data-console-label="left"][data-console-layout="columns"]:is( + [data-console="panel"], + [data-console="inline"], + [data-console="slim"] + ) + :is([data-slot="console"], [data-slot="slim"]) { + max-width: none; +} + +/* "block": the whole section is one dark container across the content width (dark in both + themes, like the panel; in the dark theme its --bg-weak is a step lighter than the page). The + panel spans all four columns so its dots run edge to edge; the copy starts on the column-2 line, + where the other sections' bodies (the FAQ questions) start, under the small uppercase "CONSOLE" + kicker. The first column stays empty. The page sets data-console="panel" and the name on the + left whatever Console and Console label are saved as, so only these rules apply. */ +[data-page="home"][data-site] [data-component="block"][data-console="panel"][data-console-layout="block"] { + color-scheme: dark; + background: var(--console-band-bg); + + > [data-slot="label"] { + display: none; + } + + [data-slot="console"] { + grid-column: 1 / -1; + max-width: none; + background: none; + } + + /* The kicker at the section titles' size (--title-size), still uppercase and muted. */ + [data-slot="eyebrow"] { + display: block; + font-size: var(--title-size); + line-height: 1.2; + letter-spacing: 0.06em; + } + + [data-slot="copy"] h3 { + margin-top: 0.75rem; + } + + /* The extra attribute outranks the "left" label's panel inset. */ + @media (min-width: 60.0625rem) { + &[data-console-label] [data-slot="console"] { + padding-inline-start: calc(var(--card) + var(--gutter)); + } + } +} + +@media (max-width: 60rem) { + /* On phones "card" falls back to auto. */ + [data-page="home"][data-site] [data-component="block"][data-console] { + --console-pad: 2.5rem; + + &[data-console-height="card"] { + --console-pad: 2.5rem; + --console-min: 0px; + } + + &[data-console-height="half"] { + --console-pad: 2.5rem; + } + + /* Twice the 1.5rem it was. */ + &[data-console-height="compact"] { + --console-pad: 3rem; + } + + [data-slot="console"] { + padding-inline-start: 0; + } + + h3 { + font-size: var(--fs-entry); + } + + p { + font-size: var(--fs-lead); + } + + [data-slot="actions"] { + flex-direction: column; + align-items: flex-start; + gap: 1rem; + } + + /* Phones set the button label at 16px; the note follows it. */ + [data-slot="note"] { + font-size: var(--fs-ui); + line-height: 1.5rem; + } + } + + [data-page="home"][data-site] [data-component="block"][data-console="panel"] [data-slot="console"] { + padding: var(--console-pad) 1.5rem; + } + + [data-page="home"][data-site] [data-component="block"][data-console="inline"] { + [data-slot="console"] { + padding-block: var(--console-pad); + } + } + + [data-page="home"][data-site] [data-component="block"][data-console="split"] { + [data-slot="copy"] { + order: 1; + padding-inline-end: 0; + } + + [data-component="console-field"] { + order: 2; + min-height: max(16rem, var(--console-min)); + margin-top: 2.5rem; + } + } +} + +/* Section: like every other home section. The spacer above, the name in the first card column, + and the copy from the second card, as wide as Console width sets (two cards below 80rem). No + dots and no panel; Console height and Console label don't apply. The headline keeps the panel's + size and is trimmed to its cap height, so its first line shares the title's top line. */ +[data-page="home"][data-site] [data-component="block"][data-console="section"] { + > [data-slot="label"] { + display: block; + grid-row: 1; + } + + [data-component="console-field"], + [data-slot="eyebrow"] { + display: none; + } + + [data-slot="console"] { + grid-column: 2; + grid-row: 1; + min-height: 0; + padding: 0; + } + + [data-slot="copy"] { + max-width: min(100%, var(--body-span, var(--two-cards))); + + h3 { + margin-top: 0; + text-box: trim-start cap alphabetic; + } + + [data-slot="actions"] { + margin-top: 2.5rem; + } + } +} + +@keyframes console-shimmer { + from { + mask-position: + center, + center, + 150% 0; + } + to { + mask-position: + center, + center, + -50% 0; + } +} + +/* Corner: the Console moves out of the page body into a small 4:5 card fixed in the bottom-left + corner, under the sidebar nav. When the footer nav scrolls into view the card slides down out of + the way (ease-in, it is leaving) and the footer nav slides up into its place (ease-out). */ +[data-page="home"][data-site] [data-component="block"]:is([data-console="corner"], [data-console="off"]) { + display: none; +} + +[data-site] [data-component="console-widget"] { + position: fixed; + inset-inline-start: calc(var(--page-offset) + var(--edge)); + bottom: var(--edge); + z-index: 3; + /* Sized to its content: as wide as the headline needs (two lines of about 19 characters), never + wider than the sidebar, and as tall as the label, headline and button. It follows the page + theme so it sits quietly beside the carousel. */ + width: max-content; + max-width: calc(var(--sidebar-width) - var(--edge) - var(--gutter)); + display: flex; + flex-direction: column; + justify-content: flex-start; + padding: 1rem; + overflow: hidden; + background: var(--bg-weak); + color: var(--text); + transition: + transform 320ms cubic-bezier(0.55, 0, 1, 0.45), + opacity 240ms ease-in; + + &[data-away] { + transform: translateY(calc(100% + var(--edge))); + opacity: 0; + pointer-events: none; + } + + &:not([data-away]) { + transition: + transform 420ms var(--ease-out), + opacity 300ms ease-out; + } + + [data-slot="copy"] { + position: relative; + display: flex; + flex-direction: column; + } + + [data-slot="eyebrow"] { + font-family: var(--font-mono); + font-size: var(--fs-micro); + line-height: 1; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--text-weak); + } + + [data-slot="headline"] { + max-width: 20ch; + margin-top: 0.75rem; + font-family: var(--font-mono); + font-size: var(--title-size); + line-height: 1.3; + letter-spacing: -0.01em; + color: var(--text-strong); + text-wrap: balance; + } + + /* The button follows the headline. */ + [data-slot="actions"] { + margin-top: 1rem; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 0.625rem; + } + + /* Quieter alternatives to the dark primary button, picked in Settings › Corner button. Neutral + is a step darker than the card. */ + [data-component="site-button"][data-variant="neutral"] { + background: var(--bg-weaker); + + @media (hover: hover) and (pointer: fine) { + &:hover { + background: var(--border); + } + } + + &:active { + background: var(--border); + } + } + + [data-component="site-button"][data-variant="outline"] { + background: transparent; + color: var(--text-strong); + box-shadow: inset 0 0 0 1px var(--border-strong); + + @media (hover: hover) and (pointer: fine) { + &:hover { + background: var(--bg-weaker); + } + } + + &:active { + background: var(--bg-weaker); + } + } + + [data-component="site-button"][data-variant="link"] { + height: auto; + padding: 0; + background: none; + color: var(--text-strong); + text-decoration: underline; + text-decoration-thickness: 1px; + text-underline-offset: 0.2em; + text-decoration-color: var(--border-strong); + + &::after { + content: "→"; + } + + @media (hover: hover) and (pointer: fine) { + &:hover { + background: none; + text-decoration-color: currentColor; + } + } + + &:active { + background: none; + text-decoration-color: currentColor; + } + } + + /* The dots fill the lower part of the card, behind the button. */ + [data-component="console-field"] { + position: absolute; + inset: 0; + overflow: hidden; + pointer-events: none; + + &::before { + content: ""; + position: absolute; + inset: 0; + visibility: hidden; + background: color-mix(in srgb, var(--text-strong) 45%, transparent); + mask-image: var(--console-dots), linear-gradient(to bottom, transparent 35%, #000 100%); + mask-size: 100% 100%; + mask-repeat: no-repeat; + mask-composite: intersect; + } + + &[data-ready]::before { + visibility: visible; + } + } + + /* No sidebar on phones and tablets, and no room on short windows. */ + @media (max-width: 60rem), (max-height: 40rem) { + display: none; + } + + @media (prefers-reduced-motion: reduce) { + &, + &:not([data-away]) { + transition: opacity 200ms ease; + } + + &[data-away] { + transform: none; + } + } +} + +/* While the corner card is showing, the footer nav waits below and slides up as the card leaves. */ +[data-site] [data-component="secondary-nav"][data-reveal] { + transition: + transform 420ms var(--ease-out) 160ms, + opacity 320ms ease-out 160ms; + + &[data-reveal="hidden"] { + transform: translateY(1.5rem); + opacity: 0; + transition: none; + } + + @media (prefers-reduced-motion: reduce) { + &[data-reveal="hidden"] { + transform: none; + } + } +} + +[data-page="home"][data-site] { + /* "Bring your own tools": a grid of service tiles, four to a row within two card columns. */ + [data-component="tools"] { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 0.5rem; + max-width: var(--two-cards); + font-family: var(--font-mono); + font-size: var(--mono-size); + line-height: 1.2; + + li { + display: flex; + align-items: center; + gap: 0.625rem; + padding: 1rem; + background: var(--bg-weak); + color: var(--text); + } + + /* The reveal's parts (reveal.css): the tile's content animates, its tile or cell stays put. */ + [data-slot="brand"], + [data-slot="mark"] { + display: flex; + align-items: center; + gap: 0.625rem; + } + + [data-slot="icon"] { + flex-shrink: 0; + width: 1.25rem; + height: 1.25rem; + background: currentColor; + mask-size: contain; + mask-repeat: no-repeat; + mask-position: center; + } + + [data-slot="wordmark"] { + width: calc(var(--width) * var(--logo-size)); + height: calc(var(--height) * var(--logo-size)); + translate: 0 calc(var(--shift) * var(--logo-size)); + background: currentColor; + mask-size: contain; + mask-repeat: no-repeat; + mask-position: center; + } + + /* The typed name stays as the tile's accessible text. */ + [data-slot="name"] { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip-path: inset(50%); + white-space: nowrap; + } + + &[data-tiles="logo"] li { + --logo-size: 2.5rem; + justify-content: center; + height: 3.5rem; + padding-block: 0; + } + + /* Logo-only tiles ("Bring your own subs"): the mark centred, twice the icon's size. The + models.dev marks share one square box with their own margins, so one size balances them; it + steps down at narrow widths and stays on whole pixels. */ + &[data-tiles="icon"] { + --icon-size: 40px; + + li { + justify-content: center; + height: 4rem; + padding-block: 0; + } + + [data-slot="icon"] { + width: var(--icon-size); + height: var(--icon-size); + } + + @media (max-width: 60rem) { + --icon-size: 36px; + } + + /* Phones: three across (the wordmark tiles keep two), so twelve logos make four full rows. */ + @media (max-width: 40rem) { + --icon-size: 32px; + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + } + + /* One ruled grid: the list draws the top and left edges, each cell its right and bottom, so + shared edges stay one hairline at any column count. */ + &[data-grid="outline"] { + gap: 0; + border-top: 1px solid var(--border); + border-inline-start: 1px solid var(--border); + + li { + justify-content: center; + height: 5rem; + background: none; + border-inline-end: 1px solid var(--border); + border-bottom: 1px solid var(--border); + } + } + + @media (max-width: 40rem) { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + } +} + +/* Phones: no divider above "Bring your own tools" or above the section after it, the "space" + spacer's gap instead, so the two subscription and tools sections read as one run. */ +@media (max-width: 40rem) { + [data-page="home"][data-site][data-site] + [data-component="block"][data-component="block"]:is( + [data-section="tools"], + [data-section="tools"] + [data-component="block"] + ) { + margin-top: calc(var(--block-space) * 2); + padding-top: 0; + border-top: 0; + background-image: none; + + &::before, + &::after { + content: none; + } + } +} + +/* Phones: the home sections' rhythm, 48px either side of a divider (the 60rem step's --block-space, + which each block's own 4.5rem otherwise outranks), and the same around the logo row, so the + shorter cards aren't followed by gaps sized for desktop. */ +@media (max-width: 40rem) { + [data-page="home"][data-site] [data-component="block"] { + --block-space: 3rem; + } + + [data-page="home"][data-site][data-site]:is( + [data-spacer="line"], + [data-spacer="dashed"], + [data-spacer="hatch"], + [data-spacer="dot gradient"], + [data-spacer="dither gradient"] + ) + [data-component="logo-wall"]:not([data-layout="section"]) { + margin-top: 3rem; + padding-top: calc(3rem - 0.25rem); + + &[data-layout="above"] { + padding-top: 3rem; + } + } +} + +/* Phones: the Console panel's background (the dark panel and its dots) runs edge to edge, to the + screen's edges; its content keeps the page's side padding, so its text lines up with the FAQ's + above on both sides. */ +@media (max-width: 40rem) { + [data-page="home"][data-site] + [data-component="block"][data-console="panel"][data-console-layout="block"][data-console-layout] { + margin-inline: calc(-1 * var(--edge)); + + [data-slot="console"] { + padding-inline: var(--edge); + } + } +} + +/* Tablet portrait (641 to 960px): 40px either side of a divider, between the phones' 48px and the + desktop's 72px rhythm read at this width, and the same around the logo row (whose label sits + above its logos here). */ +@media (min-width: 40.0625rem) and (max-width: 60rem) { + [data-page="home"][data-site] [data-component="block"] { + --block-space: 2.5rem; + } + + [data-page="home"][data-site][data-site]:is( + [data-spacer="line"], + [data-spacer="dashed"], + [data-spacer="hatch"], + [data-spacer="dot gradient"], + [data-spacer="dither gradient"] + ) + [data-component="logo-wall"]:not([data-layout="section"]) { + margin-top: 2.5rem; + padding-top: calc(2.5rem - 0.3125rem); + + &[data-layout="above"] { + padding-top: 2.5rem; + } } } diff --git a/packages/console/app/src/routes/index.tsx b/packages/console/app/src/routes/index.tsx index 68b82625bf6..93abb16db61 100644 --- a/packages/console/app/src/routes/index.tsx +++ b/packages/console/app/src/routes/index.tsx @@ -1,832 +1,1478 @@ +import { joinSentences, rich, sentenceGap } from "~/i18n/rich" import "./index.css" +import "~/component/site/hero-title.css" +import { rollsByCharacter, titleCells } from "~/component/site/hero-title" +import "@kitlangton/rolling-number/styles.css" +import { RollingNumber, RollingText } from "@kitlangton/rolling-number/solid" import { Title, Meta } from "@solidjs/meta" -//import { HttpHeader } from "@solidjs/start" -import video from "../asset/lander/opencode-min.mp4" -import videoPoster from "../asset/lander/opencode-poster.png" -import { IconCopy, IconCheck } from "../component/icon" import { createAsync } from "@solidjs/router" -import { createMemo } from "solid-js" -import { EmailSignup } from "~/component/email-signup" -import { Tabs } from "@kobalte/core/tabs" +import { + createEffect, + createMemo, + createSignal, + createUniqueId, + For, + Index, + lazy, + on, + onCleanup, + onMount, + Match, + Show, + Suspense, + Switch, +} from "solid-js" import { Faq } from "~/component/faq" -import { Header } from "~/component/header" -import { Footer } from "~/component/footer" -import { Legal } from "~/component/legal" -import { github } from "~/lib/github" -import { config } from "~/config" +import { ConsoleField } from "~/component/site/console-field" +import { ChevronRight, ExternalArrow } from "~/component/site/icons" +import { LogoWall } from "~/component/site/logo-wall" +import { createWash, revealMotion, washStartTime, washStep } from "~/component/site/reveal" +import { OpenSourceFork } from "~/component/site/open-source-fork" +import { OpenSourceProof } from "~/component/site/open-source-proof" +import { ConsoleWidget } from "~/component/site/console-widget" +import { + carouselCss, + ProductAction, + ProductCarousel, + ProductCarouselSkeleton, + useDevicePlatform, +} from "~/component/site/products" +import { ProviderLogos } from "~/component/site/provider-logos" +import { PhoneFeatures } from "~/component/site/phone-features" +import { byos } from "~/lib/byos" +import { localize, useContent } from "~/i18n/content" +import "~/component/site/byos.css" +import { getStarted } from "~/lib/get-started" +import "~/component/site/get-started.css" +import { SignupSection } from "~/component/site/signup" +import { installs } from "~/component/site/product-data" +import { isMobile } from "~/lib/platform" +import { LocaleLinks } from "~/component/locale-links" +import { ShareMeta } from "~/component/share-meta" +import { ogImage } from "~/lib/og" +import { faqData, JsonLd, organizationData, softwareData, websiteData } from "~/component/structured-data" +import { Rich } from "~/component/site/rich-text" +import { homeOrderDefaultCss, homeOrderScript, homeOrderStyleId, useHomeOrder } from "~/component/site/home-order" +import { designCopy, designEditing } from "~/component/site/design-copy" +import type { CopyId } from "~/component/site/design-mode" +import type { RichText } from "~/lib/markdown" +import { Site, siteSettings } from "~/component/site/site" +import { logoLabels, setSiteSetting } from "~/component/site/settings" +import { announcementCopy, announcements } from "~/component/site/announcement" +import { useMarkdown } from "~/component/site/use-markdown" import { useI18n } from "~/context/i18n" import { useLanguage } from "~/context/language" -import { LocaleLinks } from "~/component/locale-links" -import { SocialMeta } from "~/component/social-meta" +import { homeContent, linkPhrases } from "~/lib/home-content" +import { tag } from "~/lib/language" +import { dict as en } from "~/i18n/en" +import { homeMarkdown } from "~/lib/home-markdown" +import { repoStats, type RepoStats } from "~/lib/github" +import { inlineKey } from "~/lib/direction" +import { copyOnClick } from "~/lib/clipboard" -function CopyStatus() { - return ( -
- - -
- ) -} +// Only rendered inside the settings panel, so it loads with it. +// Settings rows are a development tool (component/site/settings-panel.tsx), left out of production. +const PageSettings = import.meta.env.DEV ? lazy(() => import("~/component/site/page-settings")) : () => undefined export default function Home() { const i18n = useI18n() const language = useLanguage() - const githubData = createAsync(() => github()) - // Formatted like the footer so both show the same figure. - const starsCompact = createMemo(() => - githubData()?.stars - ? new Intl.NumberFormat(language.tag(language.locale()), { notation: "compact" }).format(githubData()!.stars!) - : config.github.starsFormatted.compact, + const markdown = useMarkdown("/", homeMarkdown) + useHomeOrder() + const [statsVisible, setStatsVisible] = createSignal(false) + // Live repo numbers (lib/github.ts), streamed in under the config's numbers. + const repo = createAsync(() => repoStats()) + + const heroVariant = () => siteSettings.hero + // Console layout "block" is the whole section, so it sets the panel option and the name on the + // left itself: older saved Console and Console label values can't break it. "off" still hides it. + const consoleSection = () => + siteSettings.consoleLayout === "block" && siteSettings.consoleSection !== "off" + ? "panel" + : siteSettings.consoleSection + const content = createMemo(() => homeContent(i18n.t, language.route)) + // Its own meta description (140–155 characters). Until a locale translates it, the locale keeps + // the tagline and hero subtitle it already has in its language. + const description = () => + language.locale() === "en" || i18n.t("home.meta.description") !== en["home.meta.description"] + ? i18n.t("home.meta.description") + : joinSentences([i18n.t("app.meta.description"), ...content().hero.subtitle]) + const title = () => designCopy("home.hero.title", content().hero.title) + const subtitleParts = () => designCopy("home.hero.subtitle", content().hero.subtitle.join("\n")).split("\n") + + // The open source numbers start as they approach the window (a fifth of a window early), so they + // are already spinning when they come into view; the avatars' wash follows once the wall itself is + // in view, never before the numbers. Already on screen at load, they start 300ms after the page's + // code runs. With reduced motion the numbers simply show. The stats render twice when the live + // numbers stream in after the page (first with the config's numbers), so a second one joins a + // start already set. + const [openSourceStart, setOpenSourceStart] = createSignal() + const observeStats = (element: HTMLDListElement) => { + if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return setStatsVisible(true) + if (openSourceStart() !== undefined) return + let first = true + const statsObserver = new IntersectionObserver( + (entries) => { + const initial = first + first = false + if (!entries.some((entry) => entry.isIntersecting)) return + statsObserver.disconnect() + const at = washStartTime(initial) + setOpenSourceStart(at) + setTimeout(() => setStatsVisible(true), Math.max(0, at - performance.now())) + }, + { rootMargin: "0px 0px 20% 0px" }, + ) + statsObserver.observe(element) + onCleanup(() => statsObserver.disconnect()) + } + + // The open source stats, with the stars and contributors live from GitHub when it answered. The + // contributors round down to whole thousands ("1K+") to fit the column; the exact count is in the + // open source proof. + const openSourceStats = (live?: RepoStats) => { + const values = [ + live?.stars ? new Intl.NumberFormat("en-US", { notation: "compact" }).format(live.stars) : undefined, + live?.contributors + ? live.contributors < 1000 + ? String(live.contributors) + : `${Math.floor(live.contributors / 1000)}K+` + : undefined, + ] + return ( +
+ + {(stat, index) => ( +
+
{stat.label}
+
+ + + + + + + + + + + +
+
+ )} +
+
+ ) + } + + // The logo row's label in every layout: the translated label, unless Settings › Logo label picks + // another (English, Design mode only) or Design mode copy overrides it. + const logoLabel = () => + siteSettings.logoWall === "providers" + ? content().providers.label + : designCopy( + "home.logos.label", + siteSettings.logoLabel === logoLabels[0] ? content().companies.label : siteSettings.logoLabel, + ) + // The translated label's short form, only while the row shows that label unchanged. + const logoLabelShort = () => + siteSettings.logoWall === "companies" && logoLabel() === content().companies.label + ? content().companies.labelShort + : undefined + // One logo row, rendered on its own or inside the "section" layout's home section. + const logoWall = () => ( + ) - // Round down so the "over N stars" copy stays true. - const starsFull = createMemo(() => - githubData()?.stars - ? new Intl.NumberFormat(language.tag(language.locale())).format(Math.floor(githubData()!.stars! / 1000) * 1000) - : config.github.starsFormatted.full, + + return ( + : undefined} + markdown={markdown} + > + {content().title} + + + + + + + + + {/* The default section order from the server; a saved one (Design mode, development only) + replaces it before the sections paint. */} + + +
+ {title()}} + > + + +

+ {/* Two inline spans so Design mode keeps the copy's two parts; the text wraps naturally. */} + {subtitleParts()[0]} + {sentenceGap(subtitleParts()[0])} + {subtitleParts()[1] ?? ""} +

+ {/* Every Hero install option renders; the site root's data-hero-install (set before first + paint for a saved value) shows the chosen one, so nothing appears or goes after load. */} + + +
+ + {/* The carousel's frame until the carousel itself has streamed in (products.tsx). */} + + + + + {/* The logo row as a home section: its label is the section title. */} +
+

+ {logoLabel()} +

+
{logoWall()}
+
+
+
+ + } /> + +
+

{content().what.title}

+
+

+ {/* The sentence before the docs link is editable in Design mode; the link always ends it. */} + + {designCopy("home.what.lead", String(content().what.lead[0]).trim())} + {" "} + +

+ + + ({ + href: feature.href, + title: + "copy" in feature && feature.copy === "anyDevice" + ? designCopy("home.feature.anyDevice.title", feature.title) + : feature.title, + body: + "copy" in feature && feature.copy + ? designCopy(`home.feature.${feature.copy}.body`, feature.body) + : feature.body, + }))} + /> +
+
+ + + + + + +
+

{content().tools.title}

+
+

+ +

+ +
+
+
+ +
+

{content().openSource.title}

+
+ {/* The page's own lead is HTML (bold numbers); a Design mode option is plain text. */} + + } + > +

+ {designCopy("home.openSource.lead", stripTags(content().openSource.lead))} +

+
+ + {openSourceStats()} + + + + + } + > + {openSourceStats(repo())} + + + + +
+ +
+ + +
+

{i18n.t("home.openSource.builtInTheOpen")}

+
+ }> + + +
+
+
+ +
+

+ {designCopy("home.privacy.title", content().privacy.title)} +

+
+

+ +

+
+
+ +
+

{content().faq.title}

+
+
    + + {(item) => ( +
  • + + } + > + {(copy) => ( + + + + )} + + +
  • + )} +
    +
+
+
+ + + +
+ {/* Shown instead of the eyebrow when Console label is "left"; both render so the setting + only switches an attribute. */} +

{content().console.title}

+ + + +
+ +
+

{content().console.title}

+

{content().console.headline}

+

{content().console.body}

+ +
+
+
+ + + + +
) - const handleCopyClick = (event: Event) => { - const button = event.currentTarget as HTMLButtonElement - const text = button.textContent - if (text) { - void navigator.clipboard.writeText(text) - button.setAttribute("data-copied", "") - setTimeout(() => { - button.removeAttribute("data-copied") - }, 1500) - } +} + +/** + * Settings › Announcement: a "New" bar level with the logo, over the hero's three card columns + * (in the page's flow on phones). It always renders; the site root's data-home-announcement (set + * before first paint for a saved value) opens it, and changes animate its height and opacity. + * ⇧A (or the older ⇧N) toggles it, like ⇧S and ⇧D for Settings and Design mode, except while typing. + */ +function Announcement() { + const language = useLanguage() + const i18n = useI18n() + const translated = useContent() + const message = () => designCopy("home.announcement", announcementCopy(announcements[0])) + const item = () => announcements.find((entry) => announcementCopy(entry) === message()) + // The chosen announcement in this locale, with its link text; a custom Design mode message stays as typed. + const local = () => { + const index = announcements.findIndex((entry) => announcementCopy(entry) === message()) + return index < 0 ? undefined : translated().announcements[index] + } + const shown = () => (local() ? `${local()!.text} ${local()!.link}` : message()) + + return ( + + ) +} + +/** + * Settings › Hero install "line" and "tabs", on desktop only, under the hero: the curl install + * command with Copy and a link to /product, or a tab per install method beside its command. + */ +function HeroInstall(props: { mode: "line" | "tabs" }) { + const language = useLanguage() + const i18n = useI18n() + const id = createUniqueId() + const [selected, setSelected] = createSignal(0) + const [copied, setCopied] = createSignal(false) + const tabs = () => props.mode === "tabs" + let timer: ReturnType | undefined + onCleanup(() => clearTimeout(timer)) + + const select = (index: number) => { + clearTimeout(timer) + setCopied(false) + setSelected(index) + } + + const keyDown = (event: KeyboardEvent, index: number) => { + const next = { + ArrowLeft: (index - 1 + installs.length) % installs.length, + ArrowRight: (index + 1) % installs.length, + Home: 0, + End: installs.length - 1, + }[inlineKey(event)] + if (next === undefined) return + event.preventDefault() + select(next) + document.getElementById(`${id}-tab-${next}`)?.focus() + } + + const copy = () => { + void navigator.clipboard.writeText(installs[selected()].command).then(() => { + clearTimeout(timer) + setCopied(true) + timer = setTimeout(() => setCopied(false), 1500) + }) } return ( -
- {/**/} - {i18n.t("home.title")} - - - -
-
- -
-
-
- {/**/} - {/* What’s new in {release()?.name ?? "the latest release"}*/} - {/**/} -

{i18n.t("home.hero.title")}

-

- {i18n.t("home.hero.subtitle.a")} - {i18n.t("home.hero.subtitle.b")} -

-
-
- + +
+ + {(item, index) => ( + - - - - - - - - - - - - - - - - -
-
-
-
- -
- -
- -
-
-

{i18n.t("home.what.title")}

-

{i18n.t("home.what.body")}

-
-
    -
  • - [*] -
    - {i18n.t("home.what.multiSession.title")} {i18n.t("home.what.multiSession.body")} -
    -
  • -
  • - [*] -
    - {i18n.t("home.what.copilot.title")} {i18n.t("home.what.copilot.body")} -
    -
  • -
  • - [*] -
    - {i18n.t("home.what.chatgptPlus.title")} {i18n.t("home.what.chatgptPlus.body")} -
    -
  • -
  • - [*] -
    - {i18n.t("home.what.anyModel.title")} {i18n.t("home.what.anyModel.body")} -
    -
  • -
  • - [*] -
    - {i18n.t("home.what.anyEditor.title")} {i18n.t("home.what.anyEditor.body")} -
    -
  • -
- - {i18n.t("home.what.readDocs")} - - - - -
- -
-
-

{i18n.t("home.growth.title")}

-
- [*] -

-

- -
-
-
- - - - - - - - - - - - - - - - - - - - -
- -
{i18n.t("common.figure", { n: 1 })}
{starsCompact()}{" "} - {i18n.t("home.growth.githubStars")} -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
{i18n.t("common.figure", { n: 2 })}
{config.stats.contributors}{" "} - {i18n.t("home.growth.contributors")} -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
{i18n.t("common.figure", { n: 3 })}
{config.stats.monthlyUsers}{" "} - {i18n.t("home.growth.monthlyDevs")} -
-
-
-
-
- -
-
-

{i18n.t("home.privacy.title")}

-
- [*] - -

- {i18n.t("home.privacy.body")} {i18n.t("home.privacy.learnMore")}{" "} - {i18n.t("home.privacy.link")}. -

-
-
-
- -
-
-

{i18n.t("common.faq")}

-
- -
- -
-
- {i18n.t("home.zenCta.title")} -

{i18n.t("home.zenCta.body")}

-
-
- - - - - - - - -
-
- - - - -
-
- - - -
-
- - - - -
-
- - - -
-
- - - -
-
- - - -
-
- - {i18n.t("home.zenCta.link")} - - - - -
-
- - - -
+ {item.id} + + )} +
+ +
+ {installs[selected()].command} +
- -
+ + + {i18n.t("home.install.more")} + + + ) } + +/** + * Settings › Hero install "above carousel": the curl command as one copy button, like a row of the + * Terminal card's install menu, and an action that copies an install prompt for a coding agent. + * Every layout of Settings › Install row style renders; the row's data-style (set before first + * paint for a saved value) shows the parts that layout uses, so a saved style never moves the page. + */ +function InstallRow() { + const i18n = useI18n() + const [copied, setCopied] = createSignal(false) + const [promptCopied, setPromptCopied] = createSignal(false) + // The "segmented" layout's toggle: what the one row copies. + const [target, setTarget] = createSignal<"terminal" | "agent">("terminal") + const label = () => designCopy("home.install.agent", i18n.t("home.install.agent")) + const agentName = () => i18n.t("home.install.agentLabel") + let timer: ReturnType | undefined + let promptTimer: ReturnType | undefined + onCleanup(() => { + clearTimeout(timer) + clearTimeout(promptTimer) + }) + + const flash = (set: (on: boolean) => void, previous: ReturnType | undefined) => { + clearTimeout(previous) + set(true) + return setTimeout(() => set(false), 1500) + } + const copyCommand = () => + void navigator.clipboard.writeText(installs[0].command).then(() => (timer = flash(setCopied, timer))) + const copyPrompt = () => + void navigator.clipboard.writeText(agentPrompt).then(() => (promptTimer = flash(setPromptCopied, promptTimer))) + // The row copies the prompt only in the "segmented" layout with Agent chosen. + const agent = () => siteSettings.installRowStyle === "segmented" && target() === "agent" + + // The agent action's visible label: the Design mode copy, or "Copied" in the same cell, so the + // width holds; the copy icon turns into a check. + const Action = (props: { text?: string }) => ( + <> + + }> + + + + ) + + return ( +
+
+ + +
+ + + + + +

+ {i18n.t("home.install.agentNote")}{" "} + +

+ + + {copied() || promptCopied() ? i18n.t("site.action.copied") : ""} + +
+ ) +} + +// A robot face on the 16px icon grid, as in the footer's "View as agent" button. +function AgentIcon() { + return ( + + ) +} + +// For the agent action above the carousel: the Terminal section of the download page's Markdown lists every +// install command. +const agentPrompt = `Install the OpenCode terminal app on this machine. Follow the Download section of https://opencode.ai/terminal.md and pick the method that fits this system (for example \`${installs[0].command}\`), then run \`opencode --version\` to check that it works.` + +function CopyIcon() { + return ( + + ) +} + +function CheckIcon() { + return ( + + ) +} + +// Rolls every digit up through at least one full turn, like an odometer, once the parent sets +// data-visible. Digits after the first spin an extra turn so smaller place values move faster; +// letters and symbols rise in as the digits settle. +// Letters and digits roll through a wheel; other glyphs crossfade in place. +const heroCharset = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-" + +/** + * The hero title shuffled in with rolling-number: it starts as blank slots of the same length and + * rolls (or flaps) into the title once the page is on screen. Words are separate hosts so the + * title still wraps between them. + */ +function HeroTitle(props: { text: string; mode: "roll" | "flap" }) { + const [shown, setShown] = createSignal(false) + onMount(() => requestAnimationFrame(() => setShown(true))) + const words = () => props.text.split(" ") + return ( +

+ + {(word, index) => ( + <> + {index() > 0 ? " " : ""} + +

+ ) +} + +/** + * A stat like "205K" or "1K+": the number rolls up from zero with rolling-number when the stats + * come into view, and the suffix sits after it. + */ +/** + * A stat like "224K" as a slot machine (Settings › Stats "slot"). It shows the final value until + * `start` (a performance.now() time, set as the stats near the window), then each digit spins a + * reel of random digits and eases out onto its own, left to right and stat by stat (`stat`), in + * about 1.5s. Each reel begins and ends on the digit itself, so starting never jumps or shows a + * zero. Letters and symbols ("K", "+") stay put. The random digits are drawn only once it starts, + * so the server and the first client render agree. + */ +function SlotStat(props: { value: string; start?: number; stat: number }) { + const chars = () => [...props.value] + // Each digit's place among the stat's digits, for the stagger and the number of turns. + const place = (index: number) => + chars() + .slice(0, index) + .filter((char) => /\d/.test(char)).length + return ( + + + {(char, index) => ( + }> + + + )} + + + ) +} + +function SlotDigit(props: { digit: number; start?: number; place: number; stat: number }) { + const [reel, setReel] = createSignal([props.digit]) + let strip: HTMLSpanElement | undefined + createEffect( + on( + () => props.start, + (start) => { + if (start === undefined || !strip) return + // More turns for later digits, so the right of the number spins faster and lands last. + const turns = 14 + props.place * 5 + props.stat * 3 + const digits = [ + props.digit, + ...Array.from({ length: turns }, () => Math.floor(Math.random() * 10)), + props.digit, + ] + setReel(digits) + const line = strip.parentElement?.getBoundingClientRect().height ?? 0 + const animation = strip.animate( + [{ transform: "translateY(0)" }, { transform: `translateY(${-(digits.length - 1) * line}px)` }], + { + duration: 1100, + delay: Math.max(0, start - performance.now()) + props.stat * 120 + props.place * 70, + easing: "cubic-bezier(0.16, 1, 0.3, 1)", + fill: "both", + }, + ) + animation.onfinish = () => { + setReel([props.digit]) + animation.cancel() + } + onCleanup(() => animation.cancel()) + }, + ), + ) + return ( + + ) +} + +function RollingStat(props: { value: string; visible: boolean }) { + const parts = () => /^([\d.,]+)(.*)$/.exec(props.value) + // Start the roll a beat after the stats come into view, once the library has measured them. + // A digit only rolls when it changes, so a 0 in the target (the middle of "205") would sit still. + // Each 0 first heads towards 5, then the roll retargets upwards and carries on round to 0. + const [stage, setStage] = createSignal<"start" | "spin" | "done">("start") + createEffect(() => { + if (!props.visible) return + const spin = setTimeout(() => setStage("spin"), 100) + const done = setTimeout(() => setStage("done"), 350) + onCleanup(() => { + clearTimeout(spin) + clearTimeout(done) + }) + }) + const digits = () => (parts()?.[1] ?? "0").replace(/,/g, "") + const value = () => { + if (stage() === "start") return 0 + return Number(stage() === "spin" ? digits().replace(/0/g, "5") : digits()) + } + return ( + + + ) +} + +function Odometer(props: { value: string }) { + const digits = () => [...props.value].filter((char) => /\d/.test(char)).length + return ( + + + {(char, index) => { + const position = () => [...props.value].slice(0, index()).filter((item) => /\d/.test(item)).length + const turns = () => (position() === 0 && digits() > 1 ? 1 : 2) + return ( + + } + > + + + ) + }} + + + ) +} + +/** + * Design mode copy over copy with links: the page's own copy keeps its links, and an option links + * the phrases in `links` (homeContent's copyLinks) wherever they appear. + */ +function richCopy(id: CopyId, rich: RichText, links: readonly { text: string; href: string }[]) { + const plain = rich.map((item) => (typeof item === "string" ? item : "code" in item ? item.code : item.text)).join("") + const text = designCopy(id, plain) + return text === plain ? rich : linkPhrases(text, links) +} + +function stripTags(html: string) { + return html.replace(/<[^>]+>/g, "") +} + +/** + * "Get started", before "Bring your own subs": download, start with the free models, then bring a + * subscription or use OpenCode Go (lib/get-started.ts). Laid out like the sections below it, with + * the tools' column settings. Settings › Get started style explores five treatments of the body; + * every one renders and the section's data-style (set before first paint for a saved value) shows + * one. + */ +function GetStarted() { + const i18n = useI18n() + const language = useLanguage() + const content = createMemo(() => localize(language.locale(), "getStarted", getStarted(language.route))) + // On a phone or tablet, Download is that device's app; on a computer, the desktop build. + const platform = useDevicePlatform() + const downloadSlug = () => (isMobile(platform()) ? "mobile" : "desktop") + // On a phone or tablet the lead links only "OpenCode Go"; the other phrases stay plain words (no + // link to tab to or announce), decided from the request's platform so the server renders it. + const leadPhrases = () => + isMobile(platform()) ? content().phrases.filter((phrase) => phrase.text === "OpenCode Go") : content().phrases + const [copied, setCopied] = createSignal(false) + let timer: ReturnType | undefined + onCleanup(() => clearTimeout(timer)) + const copy = () => + void navigator.clipboard.writeText(installs[0].command).then(() => { + clearTimeout(timer) + setCopied(true) + timer = setTimeout(() => setCopied(false), 1500) + }) + // The log-ins as one list in the page's language ("A, B or C"), each a link, inside one sentence. + const subscriptionLinks = () => ( + `[${item.name}](subs)`)), + }), + { subs: content().links.subs, go: content().plans[0].href, goPlus: content().plans[1].href }, + )} + /> + ) + return ( +
+

{content().title}

+
+

+ +

+ + {/* "steps": a numbered path, each step with its action. */} +
    + + {(step, index) => ( +
  1. + +
    +

    {step.title}

    +

    {step.line}

    +
    + +
  2. + )} +
    +
+ + {/* "ladder": three rungs, free first. */} + + + {/* "sentence": the whole path in one large sentence, then the download button. */} +
+

+ +

+ +
+ + {/* "terminal": install, run, pick a free model. */} +
+
+ +
+              
+                
+                  {installs[0].command}
+                
+                {"\n"}
+                opencode
+                {"\n"}
+                /models
+                {"\n\n"}
+                Select model
+                {"\n"}
+                OpenCode
+                
+                  {(model, index) => (
+                    <>
+                      {"\n"}
+                      
+                        {`${index() === 0 ? "●" : " "} ${model.padEnd(28)}Free`}
+                      
+                    
+                  )}
+                
+              
+            
+
+

{subscriptionLinks()}

+
+ + {/* "cards": two cells in the tools grid's borders. */} + +
+
+ ) +} + +/** + * "Bring your own subs", before "Bring your own tools": log in with a subscription you have, or use + * an OpenCode plan (lib/byos.ts). Laid out like that section, and the logos are its grid's tiles + * (logos only, the names as tooltips), so they arrive with the same entrance. Settings › + * Subscriptions style explores three arrangements; every one renders and the section's data-style + * (set before first paint for a saved value) shows one. + */ +function BringYourOwnSubs() { + const i18n = useI18n() + const language = useLanguage() + const subs = createMemo(() => localize(language.locale(), "byos", byos)) + const [tab, setTab] = createSignal<"yours" | "ours">("yours") + const yours = () => + const providers = () => + const goHref = () => subs().plansHref + const select = (next: "yours" | "ours", focus?: boolean) => { + setTab(next) + if (focus) document.getElementById(`byos-tab-${next}`)?.focus() + } + return ( +
+ {/* Laid out like "Bring your own tools" below it, with its column settings. */} +

{subs().title}

+
+

+ {designCopy("home.byos.headline", subs().headline)}{" "} + + ({ text, href: goHref() })), + )} + /> + +

+ + {/* "grid": the providers' grid. */} +
{providers()}
+ + {/* "split": your subscriptions beside the models in OpenCode's plans. */} +
+
+

{subs().yours.label}

+ {yours()} +
+
+

{subs().ours.label}

+ {providers()} +
+
+ + {/* "tabs": one side at a time, in /brand's badge tabs. */} +
+
+ + {(id) => ( + + )} + +
+ + +
+
+
+ ) +} + +/** + * "Bring your own tools": a tile per service. With Settings › Tools animation on, the tiles arrive + * in the shared entrance wash (reveal.ts), diagonally from the top left, the first time the grid + * scrolls into view. Off by default. + */ +function ToolGrid(props: { + items: readonly { + name: string + logo: string + wordmark?: string + metrics?: { aspect: number; density: number; centerY: number } + }[] + /** The list's accessible name. */ + label?: string + /** Logo-only tiles whatever Settings › Tool tiles says: the mark centred, its name as a tooltip. */ + iconTiles?: boolean +}) { + const i18n = useI18n() + let grid: HTMLUListElement | undefined + const animation = () => { + const style = siteSettings.toolsAnimation + if (style === "off") return undefined + return style === "same as logos" ? siteSettings.logoAnimation : style + } + const wash = createWash( + () => grid, + () => animation() !== undefined, + ) + const motion = () => { + const style = animation() + return wash.armed() && style ? { animation: style, vars: revealMotion(style, siteSettings.logoTuning) } : undefined + } + createEffect(on([animation, () => siteSettings.toolsStagger], wash.replay, { defer: true })) + + return ( +
    + + {(tool, index) => { + const delay = () => { + const start = wash.start() + if (!motion() || start === undefined) return undefined + const at = start + washStep(index(), wash.columns() ?? 1, props.items.length) * siteSettings.toolsStagger + return Math.max(0, Math.round(at - performance.now())) + } + return ( +
  • + + + + + {props.iconTiles ? null : tool.name} + + } + > + + + +
  • + ) + }} +
    +
+ ) +} + +// logo-soup's normalisation, as in LogoWall: wide logos grow less than their aspect ratio, and light +// logos grow while heavy ones shrink. Sizes are in multiples of --logo-size. +function balanceLogo(metrics: { aspect: number; density: number; centerY: number }) { + const scale = Math.min(2, Math.max(0.5, (0.35 / metrics.density) ** 0.25)) + const width = metrics.aspect ** 0.5 * scale + const height = width / metrics.aspect + return { + "--width": width.toFixed(3), + "--height": height.toFixed(3), + "--shift": (-metrics.centerY * height).toFixed(3), + } +} + +// Settings › Copy columns: only marked when the copy differs from the body columns, so matching +// widths keep each section's own copy measure (the Console's 34rem at two columns). +function copyColumnsAttribute(copy: "2 columns" | "3 columns", body: "2 columns" | "3 columns") { + return copy === body ? undefined : copy.charAt(0) +} diff --git a/packages/console/app/src/routes/mini.tsx b/packages/console/app/src/routes/mini.tsx new file mode 100644 index 00000000000..b1b6915d2e3 --- /dev/null +++ b/packages/console/app/src/routes/mini.tsx @@ -0,0 +1,5 @@ +import { ProductPage } from "~/component/site/product-page" + +export default function Page() { + return +} diff --git a/packages/console/app/src/routes/mobile.tsx b/packages/console/app/src/routes/mobile.tsx new file mode 100644 index 00000000000..c7fdf8d7ced --- /dev/null +++ b/packages/console/app/src/routes/mobile.tsx @@ -0,0 +1,10 @@ +import { ProductPage } from "~/component/site/product-page" +import { productAreas } from "~/component/site/product-data" +import { productChangelog } from "~/lib/changelog" + +// Hovering or focusing a link here (a carousel card, say) starts loading the page's changelog. +export const route = { preload: () => productChangelog(productAreas.mobile!) } + +export default function Page() { + return +} diff --git a/packages/console/app/src/routes/product/index.css b/packages/console/app/src/routes/product/index.css new file mode 100644 index 00000000000..14f531d8d73 --- /dev/null +++ b/packages/console/app/src/routes/product/index.css @@ -0,0 +1,79 @@ +[data-page="products"] { + /* The carousel's cards in rows, at exactly the home carousel's card width (Settings › Carousel + sets --visible and --gaps per screen width, products.tsx), so going from the home page the cards + keep their x and size: as many as fit per row. Phones: one card across the content width (the + home carousel's peeking 1.1 card there doesn't make a row). Unlike the carousel, the grid stays + inside the page's padding and never scrolls sideways. */ + /* The grid follows the hero directly, with no divider or title, a block's space below it. */ + /* The home carousel's own top margin (products.css), so the first row lands where home's does. */ + [data-component="products"][data-layout="grid"] { + margin: 3rem 0 0; + + [data-slot="grid"] { + display: grid; + grid-template-columns: repeat(auto-fill, calc((100% - var(--gaps) * var(--gutter)) / var(--visible))); + column-gap: var(--gutter); + row-gap: 3.5rem; + } + + /* No real footage yet: plain black in both themes. */ + [data-slot="media"][data-empty] { + background: #000; + } + + @media (max-width: 39.9375rem) { + [data-slot="grid"] { + grid-template-columns: minmax(0, 1fr); + row-gap: 3rem; + } + } + } +} + +/* The hero's subtitle is as wide as two grid cards (the carousel's card width) and the gap between + them, so it ends on the second card's right edge; where the grid shows two cards or one, it spans the content column. */ +[data-site][data-page="products"] [data-component="hero"] p { + max-width: calc(2 * (100% - var(--gaps) * var(--gutter)) / var(--visible) + var(--gutter)); + + @media (max-width: 60rem) { + max-width: none; + } +} + +/* David's call for these sections (overriding "titles above"): from 60rem up the title takes the + first of the page's four columns and the content the others, on the product grid's column math: + every section's content spans columns 2–3 (the lists, the download sections, marked data-columns, + and the FAQ), so all their buttons and toggles end on column 3's right edge. The title and the first row are both trimmed to their cap height, so their tops line + up. Up to 78rem (phones and tablets) the title goes back above and the content takes the full + width. */ +@media (min-width: 78.0625rem) { + [data-site][data-page="products"] + [data-component="block"]:is( + [data-slot="products-extensions"], + [data-slot="products-integrations"], + [data-slot="products-anomaly"], + [data-columns] + ) { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + column-gap: var(--gutter); + align-items: start; + + /* Every section's content spans columns 2–3, so the Install buttons, the download rows' + buttons and the FAQ toggles all end on column 3's right edge. */ + > [data-slot="body"] { + grid-column: 2 / 4; + } + + [data-component="download-list"] { + max-width: none; + } + } +} + +/* Stacked under its title, the first download row needs no pull up to the title's line. */ +@media (max-width: 78rem) { + [data-site][data-page="products"] [data-columns] > [data-slot="body"] > [data-component="download-list"]:first-child { + margin-top: 0; + } +} diff --git a/packages/console/app/src/routes/product/index.tsx b/packages/console/app/src/routes/product/index.tsx new file mode 100644 index 00000000000..3d5c7909aff --- /dev/null +++ b/packages/console/app/src/routes/product/index.tsx @@ -0,0 +1,116 @@ +import "./index.css" +import "~/component/site/hero-title.css" +import { titleCells } from "~/component/site/hero-title" +import { Meta, Title } from "@solidjs/meta" +import { Show } from "solid-js" +import { LocaleLinks } from "~/component/locale-links" +import { ShareMeta } from "~/component/share-meta" +import { ogImage } from "~/lib/og" +import { breadcrumbData, JsonLd } from "~/component/structured-data" +import { DownloadSections } from "~/component/site/download-sections" +import { extensionPages } from "~/component/site/extension-data" +import { SectionHeading } from "~/component/site/on-this-page" +import { ProductGrid } from "~/component/site/products" +import { MoreFromAnomaly, ProductList } from "~/component/site/product-list" +import { BrowseMark, GitHubMark, GitLabMark } from "~/component/site/icons" +import { downloadContent } from "~/lib/download-content" +import "~/component/site/product-list.css" +import { productsOrderScript } from "~/component/site/products-order" +import { Site } from "~/component/site/site" +import { PageTitle } from "~/component/site/sticky-title" +import { designCopy } from "~/component/site/design-copy" +import { useMarkdown } from "~/component/site/use-markdown" +import { useLanguage } from "~/context/language" +import { productsMarkdown } from "~/lib/product-markdown" +import { homeContent } from "~/lib/home-content" +import { useI18n } from "~/context/i18n" +import { localize, useContent } from "~/i18n/content" +import { siteSettings } from "~/component/site/settings" + +export default function Product() { + const language = useLanguage() + const i18n = useI18n() + const content = useContent() + const title = () => i18n.t("product.title") + const description = () => i18n.t("product.meta.description") + const download = () => localize(language.locale(), "download", downloadContent(i18n.t, language.route)) + const markdown = useMarkdown("/product", productsMarkdown) + + return ( + + {title()} + + + + + + {/* The home hero's options and title length, so the title is set at the home title's size + and the cards below land where the home page's do (hero-title.css). */} +
+ +

{designCopy("products.hero.body", i18n.t("product.hero.subtitle"))}

+
+ + + {/* Right after the grid, so a saved order (Design mode, development only) applies before it paints. */} + {import.meta.env.DEV &&