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
2 changes: 1 addition & 1 deletion web/e2e/maps-cards.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ test("cards keep complete names and long times inside at every breakpoint", asyn
(element) =>
getComputedStyle(element).gridTemplateColumns.split(" ").length,
);
expect(columns).toBe(width === 1920 ? 5 : 4);
expect(columns).toBe(3);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion web/e2e/maps-overview.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ test("the overview stays centered and the reset matches the tier columns", async
expect(controls.right).toBeLessThan(1);
expect(controls.separated).toBeGreaterThanOrEqual(20);
expect(controls.frameCenter).toBeLessThan(1);
expect(controls.frameWidth).toBeLessThan(controls.pageWidth);
expect(Math.abs(controls.frameWidth - controls.pageWidth)).toBeLessThan(1);
});

test("the donut has clean sector boundaries, animates hover and has no click focus box", async ({
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
cursor: pointer;
}

/* The window either side of the sheet; pages sit on the sheet (the root layout). */
/* One background across the viewport, with centered content in the root layout. */
body {
background: var(--color-gutter);
color: var(--color-text);
Expand Down
33 changes: 6 additions & 27 deletions web/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Root layout: fonts, global styles, the header and footer, the run dialog, and site-wide metadata.
import type { Metadata } from "next";
import Image from "next/image";
import { Exo_2, Geist } from "next/font/google";
import { Suspense } from "react";
import art from "@/features/site/header-interloper.webp";
import { RunDialogHost } from "@/features/runs/RunDialogHost";
import { SiteFooter } from "@/features/site/SiteFooter";
import { SiteHeader } from "@/features/site/SiteHeader";
Expand Down Expand Up @@ -39,33 +37,14 @@ export default function RootLayout({ children }: LayoutProps<"/">) {
>
<body className="flex min-h-full flex-col">
<NavigationProgress />
{/* What shows in the gutters either side of the sheet: the header's map picture, blurred and darkened
far back, fixed while the page scrolls. Blurred anyway, so a small copy of it is plenty. */}
<div
aria-hidden
className="pointer-events-none fixed inset-0 -z-10 overflow-hidden"
>
<Image
src={art}
alt=""
sizes="640px"
quality={75}
className="size-full scale-110 object-cover opacity-80 blur-lg"
/>
<div className="from-gutter/10 to-gutter/85 absolute inset-0 bg-linear-to-b" />
</div>
{/* The sheet, as the old sourcejump.net had it: one column down the middle of the window, edges lit,
holding the header, the page and the footer, the gutters either side. */}
<div className="bg-bg shadow-sheet max-w-site mx-auto flex w-full flex-1 flex-col">
{/* The header and page fill at least the window, so the footer starts right at the fold: the page
always scrolls, and the scrollbar doesn't come and go between short and long pages. The space
above the footer is padding in here, not a margin on the footer, so it doesn't push it lower. */}
<div className="flex min-h-svh flex-col">
<SiteHeader />
<div className="flex flex-1 flex-col pb-16">{children}</div>
{/* Keep the footer below the fold so short pages don't change the scrollbar width. */}
<div className="flex min-h-svh flex-col">
<SiteHeader />
<div className="max-w-site mx-auto flex w-full flex-1 flex-col pb-16">
{children}
</div>
<SiteFooter />
</div>
<SiteFooter />
{/* The run dialog, over whichever page opened it (`?run=` in the address). */}
<Suspense>
<RunDialogHost />
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/maps/MapList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export async function MapList({ params }: { params: MapListParams }) {
<div className="flex flex-col gap-5">
<h1 className="sr-only">Maps</h1>
{list && (
<Card className="w-full min-w-0 xl:w-fit xl:self-center">
<Card className="w-full min-w-0">
<MapStats
stats={list.stats}
tierCount={list.tier_count}
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/site/SiteFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { communityLinks } from "./navigation";
export function SiteFooter() {
return (
<footer className="border-border bg-gutter/50 border-t">
<div className="flex flex-col items-center justify-center gap-3 px-4 py-5 text-sm sm:flex-row sm:gap-5">
<div className="max-w-site mx-auto flex flex-col items-center justify-center gap-3 px-4 py-5 text-sm sm:flex-row sm:gap-5">
<Link
href="/ruleset"
className="text-accent hover:text-accent-hover inline-flex items-center gap-1.5 underline-offset-4 hover:underline"
Expand Down
4 changes: 2 additions & 2 deletions web/src/features/site/SiteHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// The top of every page: one bar across the top of the sheet, staying in view while the page scrolls. The
// The top of every page: one bar across the window, staying in view while the page scrolls. The
// wordmark and the sections, then the search for players and maps and the account corner. On a phone: the menu,
// the wordmark, the search button and the account corner.
import { Suspense } from "react";
Expand All @@ -14,7 +14,7 @@ export function SiteHeader() {
style={{ viewTransitionName: "site-header" }}
className="bg-gutter border-border sticky top-0 z-10 border-b"
>
<div className="flex h-16 items-center gap-2 px-4 sm:px-6 lg:gap-8">
<div className="max-w-site mx-auto flex h-16 w-full items-center gap-2 px-4 sm:px-6 lg:gap-8">
<Link
href="/"
className="text-base font-bold tracking-wide whitespace-nowrap uppercase sm:text-lg sm:tracking-wider"
Expand Down
42 changes: 18 additions & 24 deletions web/src/ui/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,24 @@
@theme {
--color-*: initial;

/*
* The old sourcejump.net's colors, brought up to date. `gutter` is the window either side of the page's
* sheet; `bg` is the sheet itself, what every page sits on. Then surfaces on it, darkest to lightest.
*/
--color-gutter: #121822;
--color-bg: #1d2636;
--color-surface: #222c40;
--color-surface-raised: #29354b;
--color-surface-overlay: #303d57;
--color-border: #2e3b54;
--color-border-strong: #3d4f70;

--color-text: #e1e9f5;
--color-text-muted: #9db0cc;
--color-text-subtle: #7387a5;
/* `gutter` is the continuous page background, followed by the inset and raised surfaces. */
--color-gutter: #111418;
--color-bg: #171c22;
--color-surface: #1b2129;
--color-surface-raised: #232b35;
--color-surface-overlay: #2b3541;
--color-border: #2b333e;
--color-border-strong: #3b4a5c;

--color-text: #e5ebf2;
--color-text-muted: #a7b4c4;
--color-text-subtle: #919eae;

/* The one accent. `on-accent` is text on an accent fill. */
--color-accent: #00c8f0;
--color-accent-hover: #4dd9f6;
--color-accent-soft: rgb(0 200 240 / 0.12);
--color-on-accent: #002a33;
--color-accent: #55c3f1;
--color-accent-hover: #82d5f5;
--color-accent-soft: rgb(85 195 241 / 0.12);
--color-on-accent: #071b29;

--color-success: #4cc38a;
--color-success-soft: rgb(76 195 138 / 0.12);
Expand All @@ -55,8 +52,8 @@
/* Below 360px (the narrowest common phones) the header and home headline need to shed a little width. */
--breakpoint-xs: 22.5rem;

/* Halfway from the old 72rem sheet to the viewport, without removing the desktop gutters. */
--container-site: calc((100% + 72rem) / 2);
/* Header, page content and footer share one centered width. */
--container-site: 72rem;
--container-content: calc((100% + 56rem) / 2);

--font-*: initial;
Expand Down Expand Up @@ -100,9 +97,6 @@
--shadow-popover: 0 8px 24px rgb(3 8 15 / 0.5), 0 2px 6px rgb(3 8 15 / 0.4);
--shadow-dialog: 0 24px 64px rgb(3 8 15 / 0.6);
--shadow-glow: 0 0 0 1px var(--color-accent), 0 0 16px rgb(0 200 240 / 0.35);
/* The sheet's edges: a hairline and the old site's soft blue halo. */
--shadow-sheet:
0 0 0 1px rgb(61 79 112 / 0.6), 0 0 24px 1px rgb(54 71 100 / 0.45);
/* Text laid over a picture (a map's banner), readable without darkening the picture. */
--text-shadow-over-image:
0 1px 2px rgb(3 8 15 / 0.9), 0 0 12px rgb(3 8 15 / 0.7);
Expand Down