Building gianhossle.com
A static-first site on Cloudflare's edge: no servers to run, real-time 3D, an in-browser chess engine. The infrastructure, the trade-offs and the strategy behind it, with live telemetry from your visit.
The brief behind the build
For hiring managers and teams who need proof, not claims: a portfolio that is itself a working product.
Hiring managers and teams in consulting, product and marketing.
Judge skills in a minute, without a call.
Strategy, systems and execution in one artifact you can click through.
A PDF CV asserts, a template site decorates. This one demonstrates.
Live 3D, an engine running on your CPU, a pipeline that ships in about a minute.
Conversations started. No trackers: outcomes, not clicks.
- 01DiscoverCV, LinkedIn, referrals
- 02Hookthe home screen, ten seconds
- 03Proveinteractive pages, no walls of text
- 04Convertone contact action
From a git push to your screen
One static build, no servers to run. Pick a flow and replay it, or click any node to see what it does and why it is there.
Source + Blender
The components, the build config and the Python that builds each 3D model inside Blender live in one repository, written with AI pair-programming (Claude Code). It is the only source of truth: there is no CMS and no database.
- state lives in git and nowhere else
- Blender sources are kept next to the code
- models come from scripts, so they can be re-run and tweaked
GitHub
The repository holds the source, the Blender files and the exported GLB models. Pushing to main is the deploy button: it fires a webhook that starts the build.
- push → webhook → build, no manual step
- binary assets live in the same repository
- the history doubles as the changelog
Workers Builds
Cloudflare's CI clones the repository, installs the dependencies, runs astro build and deploys the generated ./dist folder with Wrangler. From push to live usually takes 40 to 70 seconds.
- output: static HTML, JS, CSS and GLB files
- the build manifest further down is stamped in at this step
- no runtime server is created
Static assets
There is no server code at all. wrangler.jsonc points a Worker at ./dist and Cloudflare serves those files directly. Every deploy is an immutable version, only changed files are uploaded, and unknown URLs get the site's own 404 page.
- assets.directory = ./dist
- not_found_handling = 404-page
- custom domains: the apex and www
Cloudflare edge
The domain resolves to Cloudflare's anycast network, so a request lands in the closest data centre. That machine terminates TLS and answers straight from the asset store: no origin to wake up, so no cold start.
- TLS 1.3 and HTTP/3 where the browser supports it
- static files, with fingerprinted JS and CSS names
- the telemetry above shows which data centre served you
Your browser
The server only ever sends files. Everything that moves runs on your device, and UI state stays there: the open tabs live in sessionStorage, the tab-bar and tile layout in localStorage, and nothing is sent back.
- no tracking scripts and no cookies
- the only third-party request is Google Fonts
- prefers-reduced-motion switches the animation off
Astro HTML + CSS
Pages are rendered to plain HTML once, during the build. build.format: "file" emits a page at /name as name.html, so there is no trailing-slash redirect, and navigation cross-fades with native cross-document view transitions (@view-transition), so no client-side router is needed.
- Astro 7 · output: static
- JavaScript only where a page needs it
- fonts: Space Grotesk and JetBrains Mono
React islands
React is used for exactly one thing: the liquid-glass buttons (shadcn/ui on Base UI with an SVG-refraction material). Tailwind v4 is loaded as theme and utilities only, inside CSS cascade layers, so it can't fight the site's own styles.
- React 19 through @astrojs/react
- the refraction effect is Chromium-only
- everything else is plain Astro and TypeScript
three.js + model-viewer
The 3D models are generated in Blender and shipped as binary glTF. They load in <model-viewer> (three.js underneath) with a camera solver that checks all eight bounding-box corners at every orbit angle, so a frame can never crop a model. The hero chess board is its own three.js scene: PMREM lighting, a custom neon-rim shader and raycast picking.
- 7 GLB models · 8.5 MB in total
- three r183 · model-viewer 4
- dragging is clamped, and reduced motion stops the auto-rotate
Web Worker
The computer opponent searches in a Web Worker: negamax with alpha-beta pruning and captures-first move ordering, with the rules from chess.js. Thinking never blocks the WebGL frame loop, so the board keeps animating while it calculates.
- chess.js 1
- depth 3 in a normal game
- spawned on demand, only once you play
Cloudflare is the whole runtime
DNS, TLS, caching and the file server in one place. Nothing of mine runs per request, so there is nothing to scale, patch or wake up. The panel on the right is not an illustration: it is what happened to the page you are reading.
- DNS + anycastThe domain is proxied, so one address range is answered by the nearest data centre.
- TLS + HTTP/3TLS 1.3 and HTTP/3 (QUIC) end at the edge. The browser never talks to a server of mine.
- Static assetsA Worker config points at the build output and serves it directly. Each deploy is an immutable version.
- CachingHashed files under /_astro are cached for a year. HTML is revalidated on every visit, so a deploy shows up immediately.
- BuildsGit push, build, atomic deploy. A failed build never replaces the live version.
- Diagnostics/cdn-cgi/trace names the data centre that answered. The telemetry above reads it.
measuring…
Every request this page made
This is not a screenshot. It is the browser's own PerformanceResourceTiming data for the page you are looking at, drawn live: which protocol carried each file, what came from cache, and where the time went.
Fingerprinted names such as _astro/…hash.js are what lets Cloudflare and your browser cache the scripts and styles for a long time, while the HTML stays fresh. Lazy files show up here when they are first needed.
A frame that can never crop a model
Every 3D model on the site lives in a fixed frame you can rotate. A fixed camera distance always clips something at some angle, so the solver projects the eight corners of the model's bounding box through the camera at every orbit angle and pushes the camera back until none leaves the frame. Then it locks the distance to the worst case across the whole rotation range. This lab runs the realmakeFit and worstCase. Drag the box.
- distance now
- –
- fixed camera
- –
- locked radius
- –
- frame fill
- –
The green band in the chart is the rotation range a visitor is allowed to drag through; the dashed green line is the radius the page locks the camera to, so dragging can never reveal a clipped corner. A perfectly round model uses a ring of points instead of a box, which is tighter and identical from every side.
Alpha–beta, drawn and then measured
The chess opponent is a negamax search with alpha–beta pruning, and it runs in a Web Worker so thinking never stalls the 3D board. Pruning is the whole trick: once a move is proven worse than one already found, the rest of that branch is never visited. Below is the idea on a toy tree, followed by the real engine running on your own CPU.
Try “best move first”: the better the move ordering, the more gets cut. The chess engine tries captures first for the same reason. Pruning never changes the answer, only how much work it takes to find it.
The bug where Tailwind lost to a reset
Tailwind v4 puts its utilities inside @layer. My own reset (* { padding: 0 }) was unlayered, and unlayered CSS beats every layer, whatever the specificity. So each new glass button rendered with zero padding. Moving the reset into the lowest layer fixed it without touching a single utility. Flip it yourself: the browser works out the winner in the sandbox, live.
Stamped in at build time
This panel is not typed in. While Astro rendered this page it read the repository: line counts, model sizes and the stack, to the major version. Deploy again and the numbers change by themselves.
The real code, not a diagram of it
These blocks are cut out of the repository while the page is built, so they can never drift from what is actually running.
The whole deployment config. There is no server code: a Worker that only serves ./dist, on two custom domains.
{
"$schema": "node_modules/wrangler/config-schema.json",
"compatibility_date": "2026-09-01",
// Static site: Astro builds into ./dist and Cloudflare serves it directly.
"assets": {
"directory": "./dist",
"not_found_handling": "404-page"
},
// The site owns the root domain and www; other hostnames are routed elsewhere.
"routes": [
{ "pattern": "gianhossle.com", "custom_domain": true },
{ "pattern": "www.gianhossle.com", "custom_domain": true }
]
}Static output, clean URLs without redirects, one React integration and Tailwind through Vite.
import { defineConfig } from "astro/config";
import react from "@astrojs/react";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
site: "https://gianhossle.com",
output: "static",
// page.html instead of page/index.html, so /page is served without a
// trailing-slash redirect (the tab bar keys its tabs by path)
build: { format: "file" },
// React is only used for shadcn components (liqui glass button); the rest of the site is plain Astro.
integrations: [react()],
vite: {
plugins: [tailwindcss()],
// @liqui-design/glass imports its own .css, which Node can't load unprocessed during SSR
resolve: { noExternal: ["@liqui-design/glass"] },
},
});The camera solver from section 05, exactly as every model frame runs it.
/** Camera axes for an orbit position (theta = azimuth, phi = polar angle, both in degrees). */
export function cameraBasis(thetaDeg: number, phiDeg: number) {
const T = (thetaDeg * Math.PI) / 180;
const P = (phiDeg * Math.PI) / 180;
const fwd = [-Math.sin(P) * Math.sin(T), -Math.cos(P), -Math.sin(P) * Math.cos(T)];
const right = [Math.cos(T), 0, -Math.sin(T)];
const up = [
fwd[1] * right[2] - fwd[2] * right[1],
fwd[2] * right[0] - fwd[0] * right[2],
fwd[0] * right[1] - fwd[1] * right[0],
];
return { fwd, right, up };
}
/**
* Returns fit(thetaDeg, phiDeg) -> camera distance in metres. "box" checks the 8
* bounding-box corners; "cylinder" checks a ring of points around a round model,
* which is tighter and the same from every side (used for 360° rotation).
*/
export function makeFit(mv: ModelViewer, shape: "box" | "cylinder" = "box", margin = 1.08) {
const d = mv.getDimensions();
const c = mv.getBoundingBoxCenter();
const t = mv.getCameraTarget();
const pts: number[][] = [];
if (shape === "cylinder") {
const rad = Math.max(d.x, d.z) / 2;
for (let k = 0; k < 48; k++) {
const a = (k / 48) * Math.PI * 2;
for (const sy of [-1, 1])
pts.push([c.x + Math.cos(a) * rad - t.x, c.y + (sy * d.y) / 2 - t.y, c.z + Math.sin(a) * rad - t.z]);
}
} else {
for (const sx of [-1, 1]) for (const sy of [-1, 1]) for (const sz of [-1, 1])
pts.push([c.x + (sx * d.x) / 2 - t.x, c.y + (sy * d.y) / 2 - t.y, c.z + (sz * d.z) / 2 - t.z]);
}
return (thetaDeg: number, phiDeg: number) => {
const aspect = mv.clientWidth / Math.max(1, mv.clientHeight);
const tv = Math.tan(FOV / 2);
const th = tv * aspect;
const { fwd, right, up } = cameraBasis(thetaDeg, phiDeg);
let r = 0;
for (const v of pts) {
const x = v[0] * right[0] + v[1] * right[1] + v[2] * right[2];
const y = v[0] * up[0] + v[1] * up[1] + v[2] * up[2];
const z = v[0] * fwd[0] + v[1] * fwd[1] + v[2] * fwd[2];
r = Math.max(r, Math.abs(x) / th - z, Math.abs(y) / tv - z);
}
return r * margin;
};
}
/** Largest distance needed anywhere inside an orbit range, so dragging can't clip the model. */
export function worstCase(fit: (t: number, p: number) => number, theta: [number, number], phi: [number, number]) {
let r = 0;
for (let t = theta[0]; t <= theta[1]; t += 5)
for (let p = phi[0]; p <= phi[1]; p += 2.5) r = Math.max(r, fit(t, p));
return r;
}The search from section 06. The prune flag exists so the benchmark can switch pruning off; normal games always prune.
let nodes = 0;
let prune = true;
function negamax(game: Chess, depth: number, alpha: number, beta: number, sign: number): number {
nodes++;
if (depth === 0) return sign * evaluate(game);
const moves = ordered(game);
if (!moves.length) return game.inCheck() ? -100000 - depth : 0;
let best = -Infinity;
for (const m of moves) {
game.move(m);
const s = -negamax(game, depth - 1, -beta, -alpha, -sign);
game.undo();
if (s > best) best = s;
if (best > alpha) alpha = best;
if (prune && alpha >= beta) break;
}
return best;
}
function bestMove(fen: string, depth: number, noise: number): Move {
const game = new Chess(fen);
const sign = game.turn() === "w" ? 1 : -1;
let best: Move | null = null;
let bestScore = -Infinity;
for (const m of ordered(game)) {
game.move(m);
const s = -negamax(game, depth - 1, -Infinity, Infinity, -sign) + Math.random() * noise;
game.undo();
if (s > bestScore) [bestScore, best] = [s, m];
}
return best!;
}The fix from section 07: the reset sits in the lowest layer, so Tailwind's utilities win.
/* The reset lives in the lowest layer so Tailwind utilities (used by the shadcn glass
buttons) can override it; unlayered rules would otherwise always win. */
@layer theme, base, components, utilities;
@layer base {
* { box-sizing: border-box; margin: 0; padding: 0; }
}Drag-to-reorder without moving the DOM: grid order plus a FLIP animation, so WebGL contexts never reload.
/** Apply a new order. `skip` is the card being dragged (it follows the pointer instead). */
function apply(next: string[], animate: boolean, skip?: HTMLElement) {
const movers = cards.filter((c) => c !== skip);
const first = animate && DUR ? new Map(movers.map((c) => [c, c.getBoundingClientRect()])) : null;
if (first) movers.forEach((c) => { c.style.transition = "none"; c.style.transform = ""; });
order = next;
next.forEach((k, i) => (byKey.get(k)!.style.order = String(i)));
if (first) {
let any = false;
movers.forEach((c) => {
const a = first.get(c)!, b = c.getBoundingClientRect();
const dx = a.left - b.left, dy = a.top - b.top;
if (dx || dy) { c.style.transform = `translate(${dx}px, ${dy}px)`; any = true; }
});
if (any) {
void grid.offsetWidth; // commit the inverted positions before playing
movers.forEach((c) => {
if (!c.style.transform) return;
c.style.transition = `transform ${DUR}ms ${EASE}`;
c.style.transform = "";
});
}
window.setTimeout(() => movers.forEach((c) => { if (c !== dragging?.card) c.style.transition = ""; }), DUR + 40);
}
resetBtn.hidden = next.every((k, i) => k === defaults[i]);
}The only React on the site: a thin wrapper that turns a glass button into a navigation.
* liqui glass button that behaves like a link. The glass variant renders as a
* div with button semantics (see ui/button.tsx), so navigation happens on
* click / Enter / Space instead of through an <a>.
*/
export default function GlassCta({ href, children, variant = "glass", external = false }: Props) {
const go = () => {
if (external) window.open(href, "_blank", "noopener,noreferrer");
else window.location.assign(href);
};
return (
<Button
variant={variant}
onClick={go}
// the accent fill is the site's cyan, so the label is dark like the old primary button
className={variant === "accent" ? "font-mono text-[#05070d]" : "font-mono"}
glass={{ radius: 10 }}
>
{children}
</Button>
);
}Why it is built this way
Static first
Every page is finished HTML before it leaves the build. Nothing renders per request, so there is nothing to scale, patch or wake up.
Workers static assets
A 15-line wrangler.jsonc serves ./dist. If a page ever needs server logic, a Worker can sit in front of the very same assets.
File-style URLs
build.format: "file" writes name.html, so a page is served without a trailing-slash redirect, and the tab bar can key its tabs by path.
Native view transitions
One CSS rule, @view-transition, cross-fades every navigation. The browser bar and tab bar keep their own transition names and never flicker.
Layers over specificity
Third-party CSS (Tailwind, the glass button) lives in cascade layers below the hand-written styles. One moved line replaced an arms race of selectors.
State without a backend
Open tabs are in sessionStorage, the tile layout and tab-bar state in localStorage. Every visitor gets the same HTML and personalises it locally.
Heavy work off the main thread
The chess search runs in a Web Worker. The camera solver only checks eight corners, cheap enough to run on every camera-change event.
Procedural 3D
Models are Python scripts running in Blender, exported as binary glTF and compressed where it pays. Dimensions, materials and animation clips can be regenerated instead of re-modelled.
Accessible by default
Tiles can be reordered with the keyboard and announce their moves, every control on this page is a real button, and prefers-reduced-motion switches the movement off.