Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ server (`docs/architecture.md`, "The language bar").
every call through `useApi()` with `credentials: 'omit'`, so no cookie lands
on a public page.
- The theme follows the OS by default; `localStorage.theme` holds an explicit
choice. `/black-friday` alone is always dark. The portal is another origin and
keeps its own.
choice. Every page follows it, `/black-friday` and the sale's banner and notice
included: light mode is light throughout, with no dark island. The portal is
another origin and keeps its own.

## Conventions

Expand Down
24 changes: 20 additions & 4 deletions app/Support/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ final class Banner
*/
public const CAMPAIGN_PAGE = 'landing.black-friday';

/**
* Base route names where the sale's banner shows but its notice does not
* open over the page: Pricing already carries the sale on its plan cards.
*
* @var list<string>
*/
public const CAMPAIGN_NOTICE_HIDDEN_ON = ['landing.pricing'];

public const KIND_CAMPAIGN = 'campaign';

public const KIND_LICENSE = 'license';
Expand Down Expand Up @@ -75,15 +83,23 @@ public static function hiddenOnIosDevices(Request $request): bool
/**
* The shared `banner` prop, or null where no banner is on this page. Null
* rather than a flag, so the component renders nothing at all. Only which
* banner and its link: the words are the `banner` and `campaign` catalogs',
* and neither banner can be closed, so there is no version to close it at.
* banner and its link: the words are the `banner` and `campaign` catalogs'.
* The license banner cannot be closed, so there is no version to close it at.
*
* The sale's carries `notice`: whether its notice (`CampaignNotice`) may
* open over this page on load. Whether it does is the reader's browser's
* call, since the page sits in the edge cache.
*
* @return array{kind: string, href: string}|null
* @return array{kind: string, href: string, notice?: bool}|null
*/
public static function forRequest(Request $request): ?array
{
return match (self::kind($request)) {
self::KIND_CAMPAIGN => ['kind' => self::KIND_CAMPAIGN, 'href' => '/black-friday'],
self::KIND_CAMPAIGN => [
'kind' => self::KIND_CAMPAIGN,
'href' => '/black-friday',
'notice' => ! in_array(self::page($request), self::CAMPAIGN_NOTICE_HIDDEN_ON, true),
],
self::KIND_LICENSE => ['kind' => self::KIND_LICENSE, 'href' => (string) config('banner.href')],
default => null,
};
Expand Down
6 changes: 5 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ Events keep the names the Plausible goals had: `download_click` (`location`,
`newsletter_signup_clicked` (`source`). The license banner adds
`license_banner_view` and `license_banner_click`, without parameters, so a
banner's clicks can be compared with its views and with `checkout_started`.
It cannot be closed, so there is no dismiss event. GA4 stores the parameters
It cannot be closed, so there is no dismiss event. The dated sale's banner sends
`campaign_banner_view`, `campaign_banner_click` and `campaign_banner_close`;
its notice (`CampaignNotice`) sends `campaign_notice_view` (`kind`: `dialog`
or `card`), `campaign_notice_click` (`action`: `buy`, `both` or `deal`) and
`campaign_notice_close` (`action`: what closed it). GA4 stores the parameters
from the first hit but only shows them in reports once each is registered as
an event-scoped custom dimension under Admin → Custom definitions. Page changes
between Inertia visits are counted by enhanced measurement's "page changes
Expand Down
11 changes: 5 additions & 6 deletions docs/rebuild/design/design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,19 @@ Every row of the §2.3 table becomes an assertion. Add a gamut assertion: no tok
if (t === 'dark' || t === 'system' || t === 'light') { choice = t; }
} catch (e) {}
var root = document.documentElement;
var forced = root.dataset.themeForced === 'dark';
var dark = forced || choice === 'dark' || (choice === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
var dark = choice === 'dark' || (choice === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
if (dark) { root.classList.add('dark'); }
root.dataset.themeChoice = choice; /* drives the control's icon without hydration */
root.style.colorScheme = dark ? 'dark' : 'light';
var m = document.querySelector('meta[name="theme-color"]');
if (m) { m.setAttribute('content', forced ? '#060606' : dark ? '#121212' : '#ffffff'); }
if (m) { m.setAttribute('content', dark ? '#121212' : '#ffffff'); }
})();
</script>
```

`#ffffff` and `#121212` are the two `--background` values in §2.2.

**The one forced page.** `/black-friday` is dark in both themes, from the banner to the footer (owner decision, 2026-11-18). Blade stamps `html[data-theme-forced="dark"]` and `LandingLayout`'s `alwaysDark` holds it across visits inside the app. The reader's stored choice is untouched, the theme control is hidden there, and `--background`, `--surface` and `--raised` drop to `oklch(0.12 0 0)` (`#060606`), `oklch(0.15 0 0)` and `oklch(0.18 0 0)`.
**No forced page.** Every page and every part of one follows the reader's theme, `/black-friday`, the sale's banner and its notice included (owner decision, 2026-11-28, replacing the always-dark sale page of 2026-11-18): light mode is light throughout, with no dark island in it.

**Rules:**

Expand Down Expand Up @@ -1040,6 +1039,7 @@ One shared file, `components/shared/theme-control.tsx` (architecture §1.10 and
- Actions are right-aligned: **Cancel** (`quiet`, default focus on destructive dialogs), then **confirm** (`danger` or `primary`).
- Below 480 the actions stack full width in the same order.
- Escape cancels. The confirm button shows a busy state; on error the dialog stays open with an inline `Callout danger`.
- The dated sale's notice (`CampaignNotice`, positioning "Dated sales") is the one dialog outside this shape: 520px, on `--raised` in the reader's theme, focus on the dialog itself when it opens, one `primary` action full width and `Not now` as `quiet`. Escape, the backdrop and every action close it.

**Toast:**

Expand Down Expand Up @@ -1321,11 +1321,10 @@ The ceiling drops from 320ms to 240ms, and `--dur-row` goes with the row bar.
- autoplay video
- hover lifts (`translateY`) or shadow blooms

**The dated sale is the exception** (owner decision, 2026-11-06: "ban the AI look, not motion"). On the sale's black ground only (`/black-friday` and its banner), and never under reduced motion:
**The dated sale is the exception** (owner decision, 2026-11-06: "ban the AI look, not motion"). On the sale's own ground only (`/black-friday` and its banner), and never under reduced motion:

- **The load sequence,** once per visit: the headline settles (`sale-rise`, 560ms, `--ease-panel`), a drawn line strikes the list prices, then the sale prices arrive. Under a second in all.
- **The countdown digits roll**, each one only when it changes (`roll-in`, `roll-out`, 320ms).
- **The light under the pointer** (`campaign-spot`): a 30rem accent radial at 13% that follows a mouse, never a finger, and fades out when the pointer leaves.
- **The Pro capture crossfade** (`sale-stage`, `--dur-panel`): only when the reader picks another feature.

**Pricing** (owner decision, 2026-11-06), on the plan block wherever it shows (/pricing, the homepage, /teams), never under reduced motion:
Expand Down
16 changes: 13 additions & 3 deletions docs/rebuild/design/positioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,16 @@ prices, with a code that works only inside the window (`App\Support\Pricing\Camp
- **Where, while it is live:** the banner slot on every page but the sale's own, and the plan cards of the cycles it
covers. No band above a page's hero (owner, 2026-11-23). Checkout from the site attaches the code.
Before and after the window, only the sale's own page mentions it.
- **The sale's own page,** `/black-friday`, keeps one URL from year to year and is black throughout, in both themes. Before the sale it states the window and
- **The notice** (owner, 2026-11-28, `CampaignNotice`): once per page load, as the page opens. From 640px a modal
dialog in the reader's theme: the percentage off, the two offers as ruled rows with their struck prices, the
countdown, a button that buys Pro one-time at its sale price, a link to the sale's page and "Not now". Below
640px a card at the bottom of the screen that blocks nothing (Google's guidance on intrusive dialogs): the
percentage, Pro one-time's sale price, the countdown and the sale's page. It never opens on the sale's page or
Pricing, while the consent bar is asking (one thing asks at a time), for a reader whose regional discount takes
more off, or again once the reader has answered it, a click on an offer included: closing it or the banner closes
it for the rest of the sale (`tablepro:campaign-closed`). No coloured dot, glow or accent rule on it; the accent
is the one button.
- **The sale's own page,** `/black-friday`, keeps one URL from year to year and follows the reader's theme like every other page. Before the sale it states the window and
the prices, and offers a calendar file for the start instead of a button that cannot be pressed; during it the offers
can be bought from it; after it, its title, heading and description say the sale has ended, and nothing on it is
offered. Its copy stays near 150 words: the offers as two ruled rows, Pro one-time first and larger, then the Pro
Expand All @@ -466,8 +475,9 @@ prices, with a code that works only inside the window (`App\Support\Pricing\Camp
- **The regional discount** stays as above: never named outside the plan block. Checkout takes one discount per
order, so the site sends the sale's code only when it takes at least as much off as the reader's regional
discount.
- **The black ground** is an island of the dark theme (`.dark` on the element), so the design system's text pairs
hold on it in either theme.
- **The theme:** the banner, the notice and the sale's page follow the reader's theme (owner, 2026-11-28, replacing
the always-black sale of 2026-11-18): light mode is light throughout. Only the share card, an image shown off the
site, keeps its black ground.

---

Expand Down
77 changes: 11 additions & 66 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,15 @@ html.has-language-bar .support-banner {
* reader's clock passes the end, so nothing offers a code checkout no longer
* takes.
*
* The banner and the sale page's ground are an island of the dark theme
* whatever the reader chose: the element carries `.dark`, so every token
* inside resolves to its dark value and the design system's text pairs hold.
* The glow is the brand hue thinning out from the top right. Positioning §12.2.
* The banner, the notice and the sale page follow the reader's theme like
* every other part of the site: light mode is light throughout (owner,
* 2026-11-28). Flat: no glow and no light under the pointer, as the accent
* never colours a glow (design-system §1). Positioning §12.2.
*
* The slot holds one bar: the language bar, when it shows, takes it from the
* sale's banner as it does from the license banner. The rule names all three
* classes so it outweighs the one that shows the banner; with only
* `has-language-bar` it lost on specificity and both bars stacked.
*/
.campaign-banner {
display: none;
Expand All @@ -233,47 +238,11 @@ html.has-banner.campaign-live .campaign-banner {
height: var(--banner-h);
}

html.has-language-bar .campaign-banner {
display: none;
}

.campaign-surface {
background-color: oklch(0.12 0 0);
color: var(--foreground);
}

/* /black-friday is black from the banner to the footer in either theme, so its hero's ground is the page's. */
@media screen {
html[data-theme-forced] {
--background: oklch(0.12 0 0);
--surface: oklch(0.15 0 0);
--raised: oklch(0.18 0 0);
}
}

html[data-theme-forced] .theme-setting {
html.has-language-bar.has-banner.campaign-live .campaign-banner {
display: none;
}

.campaign-banner {
border-bottom: 1px solid color-mix(in oklab, var(--accent) 45%, var(--rule));
}

.campaign-glow {
background-image: radial-gradient(
56rem 28rem at 100% 0%,
color-mix(in oklab, var(--accent) 16%, transparent),
transparent 70%
);
}

@media (forced-colors: active) {
.campaign-glow {
background-image: none;
}
}

/* The global rails are drawn in the page's theme; on the black ground they would be a light line in the light theme. */
/* The sale's own rails, drawn over its banner and ground, which sit above the global ones. */
.campaign-rails {
position: absolute;
inset: 0;
Expand Down Expand Up @@ -302,30 +271,6 @@ html[data-theme-forced] .theme-setting {
}
}

/* The light under the pointer on the sale's black ground. Mouse only. */
.campaign-spot {
position: absolute;
inset: 0;
pointer-events: none;
opacity: 0;
background: radial-gradient(
30rem circle at var(--spot-x, 50%) var(--spot-y, 50%),
color-mix(in oklab, var(--accent) 13%, transparent),
transparent 70%
);
transition: opacity var(--dur-panel) var(--ease-feedback);
}

[data-spot="on"] > .campaign-spot {
opacity: 1;
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce), (forced-colors: active) {
.campaign-spot {
display: none;
}
}

.sale-display {
font-size: clamp(3.5rem, 15vw, 9.5rem);
line-height: 0.92;
Expand Down
21 changes: 9 additions & 12 deletions resources/js/components/campaign/campaign-banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { trackEvent } from '@/lib/analytics';
import { PRICING } from '@/lib/data/pricing';
import Countdown from './countdown';

// Local storage: the id of the sale whose banner the reader closed. Listed in the privacy policy.
// Local storage: the id of the sale whose banner the reader closed, or `{id}:notice` once they closed only its notice
// (`noticeClosedValue`, CampaignNotice). Listed in the privacy policy as the closed sale notice.
export const CLOSED_KEY = 'tablepro:campaign-closed';

// Closable, because its countdown updates by itself on every page (WCAG 2.2.2).
Expand Down Expand Up @@ -47,27 +48,23 @@ export default function CampaignBanner() {
}

return (
<div role="region" aria-label={copy.label} className="campaign-banner campaign-surface dark relative">
<div role="region" aria-label={copy.label} className="campaign-banner relative border-b border-rule bg-surface">
<div aria-hidden="true" className="campaign-rails">
<div />
</div>
<Container className="relative flex h-full items-center gap-3">
<LocaleLink
href={banner.href}
onClick={() => trackEvent('campaign_banner_click')}
className="type-small flex h-full min-w-0 flex-1 items-center gap-x-3 whitespace-nowrap no-underline"
className="type-small flex h-full min-w-0 flex-1 items-center gap-x-2 whitespace-nowrap no-underline sm:gap-x-3"
>
<span className="flex items-center gap-2 font-semibold">
<span aria-hidden="true" className="size-1.5 rounded-full bg-accent" />
{m.campaign.name}
</span>
<span className="font-semibold">{m.campaign.name}</span>
<span className="max-lg:hidden">{fmt(copy.message, { percent: campaign.percent })}</span>
<span className="lg:hidden">{fmt(copy.short, { percent: campaign.percent })}</span>
{/* Below 360px the name and the call to action are what fits. */}
<span className="max-[359px]:hidden lg:hidden">{fmt(copy.short, { percent: campaign.percent })}</span>
<Countdown to="end" variant="inline" className="text-muted-foreground max-sm:hidden" />
<span className="ml-auto font-medium text-accent-text">
<span className="max-lg:sr-only">{copy.cta} </span>
<span aria-hidden="true">→</span>
</span>
{/* Written out at every width, with no arrow or dot: the words say where it leads. */}
<span className="ml-auto font-medium text-accent-text">{copy.cta}</span>
</LocaleLink>
<button
type="button"
Expand Down
26 changes: 3 additions & 23 deletions resources/js/components/campaign/campaign-ground.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PointerEvent, ReactNode } from 'react';
import type { ReactNode } from 'react';
import { cn } from '@/lib/utils';

interface CampaignGroundProps {
Expand All @@ -7,30 +7,10 @@ interface CampaignGroundProps {
children: ReactNode;
}

function follow(event: PointerEvent<HTMLElement>): void {
if (event.pointerType !== 'mouse') {
return;
}

const ground = event.currentTarget;
const box = ground.getBoundingClientRect();
ground.style.setProperty('--spot-x', `${event.clientX - box.left}px`);
ground.style.setProperty('--spot-y', `${event.clientY - box.top}px`);
ground.dataset.spot = 'on';
}

// The sale's black ground: an island of the dark theme in either theme, with its own rails and the light under the pointer.
// The sale's ground: the page's own, in the reader's theme, with its own rails. Flat: no glow, no light under the pointer.
export default function CampaignGround({ labelledBy, className, children }: CampaignGroundProps) {
return (
<section
aria-labelledby={labelledBy}
onPointerMove={follow}
onPointerLeave={(event) => {
event.currentTarget.dataset.spot = 'off';
}}
className={cn('campaign-surface campaign-glow dark relative overflow-hidden', className)}
>
<div aria-hidden="true" className="campaign-spot" />
<section aria-labelledby={labelledBy} className={cn('campaign-ground relative overflow-hidden', className)}>
<div aria-hidden="true" className="campaign-rails">
<div />
</div>
Expand Down
Loading