Compare commits

..

2 commits

Author SHA1 Message Date
e0df581f0b Release Kaleido Desktop 0.1.0-beta.7
All checks were successful
Validate Kaleido Desktop / validate (push) Successful in 1m21s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 19:32:35 -07:00
242a1cec1b Replace the startup iris with a kaleidoscope and enlarge the app icon
The splash now gathers a mirrored field of shards into the mark, idles with
circling shards while startup finishes, and flies through the mark's centre
as before. The app icon's mark fills ~77% of the tile (was ~45%); the icon
set is generated from the new app-icon.svg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 19:32:35 -07:00
27 changed files with 223 additions and 236 deletions

View file

@ -1,5 +1,12 @@
# Changelog # Changelog
## 0.1.0-beta.7
A new startup animation and a bolder app icon.
- New startup animation: a kaleidoscope of shards turns and gathers into the Kaleido mark, then the view flies through its centre into the app. If the server is slow to answer, small shards keep circling the mark instead of the animation freezing.
- The app icon's mark is much larger, so it reads clearly on the taskbar and in the Start menu.
## 0.1.0-beta.6 ## 0.1.0-beta.6
RTX Video upscaling, stopped streams and a live bandwidth graph. RTX Video upscaling, stopped streams and a live bandwidth graph.

View file

@ -31,6 +31,12 @@ Playback tests change real Plex progress; resume an in-progress title near its s
position, or restore it afterwards. Selecting audio or subtitle tracks is saved to Plex position, or restore it afterwards. Selecting audio or subtitle tracks is saved to Plex
for that file. for that file.
## App icon
`src-tauri/icons/app-icon.svg` is the source. Render it to a 1024×1024 `app-icon.png`
with a transparent background, run `npx tauri icon src-tauri/icons/app-icon.png -o <temp dir>`,
and copy back only the files already in `src-tauri/icons` (the Android and iOS sets aren't used).
## Releases ## Releases
Releases are built and published from this Windows machine. CI only validates; it never Releases are built and published from this Windows machine. CI only validates; it never

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "kaleido-desktop", "name": "kaleido-desktop",
"version": "0.1.0-beta.6", "version": "0.1.0-beta.7",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "kaleido-desktop", "name": "kaleido-desktop",
"version": "0.1.0-beta.6", "version": "0.1.0-beta.7",
"dependencies": { "dependencies": {
"@fontsource-variable/inter": "^5.3.0", "@fontsource-variable/inter": "^5.3.0",
"@tanstack/react-query": "^5.105.0", "@tanstack/react-query": "^5.105.0",

View file

@ -1,7 +1,7 @@
{ {
"name": "kaleido-desktop", "name": "kaleido-desktop",
"private": true, "private": true,
"version": "0.1.0-beta.6", "version": "0.1.0-beta.7",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

2
src-tauri/Cargo.lock generated
View file

@ -2173,7 +2173,7 @@ dependencies = [
[[package]] [[package]]
name = "kaleido" name = "kaleido"
version = "0.1.0-beta.6" version = "0.1.0-beta.7"
dependencies = [ dependencies = [
"fs2", "fs2",
"futures-util", "futures-util",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "kaleido" name = "kaleido"
version = "0.1.0-beta.6" version = "0.1.0-beta.7"
description = "Kaleido — a Plex client for Windows" description = "Kaleido — a Plex client for Windows"
authors = ["Elijah"] authors = ["Elijah"]
edition = "2021" edition = "2021"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 447 KiB

Before After
Before After

View file

@ -0,0 +1,35 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
<!-- Source for app-icon.png: the brand mark filling ~77% of the tile. Regenerate the
icon set with `npx tauri icon` (see docs/development.md → App icon). -->
<defs>
<radialGradient id="teal" cx="900" cy="110" r="920" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#3D7C7B" stop-opacity="0.38"/>
<stop offset="1" stop-color="#3D7C7B" stop-opacity="0"/>
</radialGradient>
<radialGradient id="warm" cx="110" cy="950" r="820" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#D0A977" stop-opacity="0.17"/>
<stop offset="1" stop-color="#D0A977" stop-opacity="0"/>
</radialGradient>
<radialGradient id="core" cx="512" cy="512" r="300" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#71B9B0" stop-opacity="0.12"/>
<stop offset="1" stop-color="#71B9B0" stop-opacity="0"/>
</radialGradient>
<clipPath id="tile">
<rect width="1024" height="1024" rx="200"/>
</clipPath>
</defs>
<g clip-path="url(#tile)">
<rect width="1024" height="1024" fill="#0d1011"/>
<rect width="1024" height="1024" fill="url(#teal)"/>
<rect width="1024" height="1024" fill="url(#warm)"/>
<rect width="1024" height="1024" fill="url(#core)"/>
</g>
<g transform="translate(64 64) scale(14)">
<path fill="#C3E8D3" d="M33,4 L55.5,17 L42.5,24.5 L33,19 Z"/>
<path fill="#71B9B0" d="M56.5,19 L56.5,45 L43.5,37.5 L43.5,26.5 Z"/>
<path fill="#3D7C7B" d="M55.5,47 L33,60 L33,45 L42.5,39.5 Z"/>
<path fill="#D0A977" d="M31,60 L8.5,47 L21.5,39.5 L31,45 Z"/>
<path fill="#E9D8AE" d="M7.5,45 L7.5,19 L20.5,26.5 L20.5,37.5 Z"/>
<path fill="#EEF2DD" d="M8.5,17 L31,4 L31,19 L21.5,24.5 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Before After
Before After

View file

@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Kaleido", "productName": "Kaleido",
"version": "0.1.0-beta.6", "version": "0.1.0-beta.7",
"identifier": "tv.kaleido.desktop", "identifier": "tv.kaleido.desktop",
"build": { "build": {
"beforeDevCommand": "npm run dev", "beforeDevCommand": "npm run dev",

View file

@ -2,11 +2,11 @@ import { useEffect, useRef } from 'react';
import { useSettings } from '../app/settings'; import { useSettings } from '../app/settings';
/** /**
* The cold-start brand sequence, the same as Kaleido for TV: a closed iris lit * The cold-start brand sequence: a kaleidoscope. A mirrored field of shards
* from behind twists open, light catches the facets and the wordmark slides out * turns and gathers into the mark's six facets; if startup is still going,
* of the mark. Once startup is ready the camera flies through the aperture's * small shards keep circling the mark. Once startup is ready the camera flies
* dark centre, revealing the app drawn beneath (which settles from a slight * through the mark's open centre, revealing the app drawn beneath (which
* zoom, `html.splash-arrival`). * settles from a slight zoom, `html.splash-arrival`).
*/ */
type Point = { x: number; y: number }; type Point = { x: number; y: number };
@ -41,73 +41,85 @@ const Emphasized = bezier(0.2, 0, 0, 1);
const EmphasizedDecelerate = bezier(0.05, 0.7, 0.1, 1); const EmphasizedDecelerate = bezier(0.05, 0.7, 0.1, 1);
const Standard = bezier(0.4, 0, 0.2, 1); const Standard = bezier(0.4, 0, 0.2, 1);
const InOut = bezier(0.45, 0, 0.55, 1); const InOut = bezier(0.45, 0, 0.55, 1);
// A mechanical iris: the blades gather, snap open and overshoot slightly as they lock.
const IrisOpen = bezier(0.55, 0, 0.15, 1);
const IrisTwist = bezier(0.5, 0, 0.18, 1.1);
// Applied in log space: a brief pull back, then an accelerating flight. // Applied in log space: a brief pull back, then an accelerating flight.
const Flight = bezier(0.55, -0.06, 0.8, 0.36); const Flight = bezier(0.55, -0.06, 0.8, 0.36);
const phase = (time: number, start: number, end: number) => Math.min(1, Math.max(0, (time - start) / (end - start))); const phase = (time: number, start: number, end: number) => Math.min(1, Math.max(0, (time - start) / (end - start)));
const mix = (from: number, to: number, amount: number) => from + (to - from) * amount; const mix = (from: number, to: number, amount: number) => from + (to - from) * amount;
const rad = (deg: number) => (deg * Math.PI) / 180;
const PALETTE = ['#C3E8D3', '#71B9B0', '#3D7C7B', '#D0A977', '#E9D8AE', '#EEF2DD'];
// The brand mark's facets, centred on its 64-unit viewport, each with the // The brand mark's facets, centred on its 64-unit viewport, each with the
// outward normal of its hexagon edge for the iris motion. // angle of its hexagon edge's outward normal and its centroid.
const FACETS = ( const FACETS = [
[ [33, 4, 55.5, 17, 42.5, 24.5, 33, 19],
[[33, 4, 55.5, 17, 42.5, 24.5, 33, 19], '#C3E8D3'], [56.5, 19, 56.5, 45, 43.5, 37.5, 43.5, 26.5],
[[56.5, 19, 56.5, 45, 43.5, 37.5, 43.5, 26.5], '#71B9B0'], [55.5, 47, 33, 60, 33, 45, 42.5, 39.5],
[[55.5, 47, 33, 60, 33, 45, 42.5, 39.5], '#3D7C7B'], [31, 60, 8.5, 47, 21.5, 39.5, 31, 45],
[[31, 60, 8.5, 47, 21.5, 39.5, 31, 45], '#D0A977'], [7.5, 45, 7.5, 19, 20.5, 26.5, 20.5, 37.5],
[[7.5, 45, 7.5, 19, 20.5, 26.5, 20.5, 37.5], '#E9D8AE'], [8.5, 17, 31, 4, 31, 19, 21.5, 24.5],
[[8.5, 17, 31, 4, 31, 19, 21.5, 24.5], '#EEF2DD'], ].map((pts, i) => {
] as [number[], string][]
).map(([pts, color], i) => {
const angle = ((-60 + 60 * i) * Math.PI) / 180;
const points: Point[] = []; const points: Point[] = [];
for (let k = 0; k < pts.length; k += 2) points.push({ x: pts[k] - 32, y: pts[k + 1] - 32 }); for (let k = 0; k < pts.length; k += 2) points.push({ x: pts[k] - 32, y: pts[k + 1] - 32 });
return { points, color, normal: { x: Math.cos(angle), y: Math.sin(angle) } }; const centroid = { x: points.reduce((s, p) => s + p.x, 0) / 4, y: points.reduce((s, p) => s + p.y, 0) / 4 };
return { points, centroid, color: PALETTE[i], angle: rad(-60 + 60 * i) };
}); });
type Facet = (typeof FACETS)[number];
// Loose shards around each facet: angle offset from the facet's normal, starting
// radius (px), size, palette offset and how far they tumble on the way in.
const SHARDS = [
{ angle: 20, radius: 170, scale: 0.42, color: 2, spin: 1.2 },
{ angle: -20, radius: 170, scale: 0.42, color: 4, spin: -1.2 },
{ angle: 36, radius: 320, scale: 0.3, color: 3, spin: 2.1 },
{ angle: -36, radius: 320, scale: 0.3, color: 1, spin: -2.1 },
{ angle: 8, radius: 420, scale: 0.2, color: 5, spin: 3 },
{ angle: -8, radius: 420, scale: 0.2, color: 5, spin: -3 },
];
// The inner hexagon traced by the facets' inner edges: the aperture the exit flies through. // The inner hexagon traced by the facets' inner edges: the aperture the exit flies through.
const INNER_RADIUS = 13.6; const INNER_RADIUS = 13.6;
const INNER_APOTHEM = 11.8; const MARK_BOX = 140;
const INTRO_BOX = 132; // Timeline (ms): the mark has formed at INTRO_END; the sequence then idles until startup is ready.
// The settled lockup is the header brand scaled up, so it reads as the same mark. const INTRO_END = 1700;
const LOCK_SCALE = 2.75;
const LOCK_BOX = 29 * LOCK_SCALE;
const LOCK_GAP = 7 * LOCK_SCALE;
// Timeline (ms): held at GATHER_END until startup is ready (at most HOLD_MAX),
// complete at INTRO_END; the slow settle runs on to TIMELINE_END.
const GATHER_END = 260;
const INTRO_END = 2260;
const TIMELINE_END = 2900;
const HOLD_MAX = 700;
const EXIT_MS = 640; const EXIT_MS = 640;
// The mark is larger than the old lockup, so it zooms less to end the flight at the same size.
const FLIGHT_ZOOM = 30;
const INK = '#090a0c'; const INK = '#090a0c';
const WORDMARK = '#F1F1F1';
const SEA_GLASS = [113, 185, 176]; const SEA_GLASS = [113, 185, 176];
const LIGHT = [238, 242, 221];
const rgba = (c: number[], a: number) => `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${Math.max(0, a)})`; const rgba = (c: number[], a: number) => `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${Math.max(0, a)})`;
interface Iris { /** A facet turned `rot` about the mark centre, shrunk and spun about its own centroid, then offset. */
inward: number; function facetPath(ctx: CanvasRenderingContext2D, f: Facet, o: Point, unit: number, rot: number, scale: number, spin: number, offset: Point) {
theta: number; const cr = Math.cos(rot);
grow: number; const sr = Math.sin(rot);
} const cs = Math.cos(spin);
function irisAt(time: number): Iris { const ss = Math.sin(spin);
const p = phase(time, 140, 1180); f.points.forEach((p, i) => {
return { inward: INNER_APOTHEM * (1 - IrisOpen(p)), theta: ((-44 * (1 - IrisTwist(p))) * Math.PI) / 180, grow: mix(0.64, 1, Emphasized(p)) }; const rx = p.x - f.centroid.x;
const ry = p.y - f.centroid.y;
const x = f.centroid.x + (rx * cs - ry * ss) * scale;
const y = f.centroid.y + (rx * ss + ry * cs) * scale;
const px = o.x + (x * cr - y * sr) * unit + offset.x;
const py = o.y + (x * sr + y * cr) * unit + offset.y;
if (i === 0) ctx.moveTo(px, py);
else ctx.lineTo(px, py);
});
ctx.closePath();
} }
function facetPath(ctx: CanvasRenderingContext2D, facet: (typeof FACETS)[number], iris: Iris, unit: number, o: Point) { /** A loose facet shape with its centroid at `pos`. */
const c = Math.cos(iris.theta); function shardPath(ctx: CanvasRenderingContext2D, f: Facet, pos: Point, size: number, angle: number) {
const s = Math.sin(iris.theta); const c = Math.cos(angle);
const k = unit * iris.grow; const s = Math.sin(angle);
facet.points.forEach((p, i) => { f.points.forEach((p, i) => {
const x = p.x - facet.normal.x * iris.inward; const x = p.x - f.centroid.x;
const y = p.y - facet.normal.y * iris.inward; const y = p.y - f.centroid.y;
const px = o.x + (x * c - y * s) * k; const px = pos.x + (x * c - y * s) * size;
const py = o.y + (x * s + y * c) * k; const py = pos.y + (x * s + y * c) * size;
if (i === 0) ctx.moveTo(px, py); if (i === 0) ctx.moveTo(px, py);
else ctx.lineTo(px, py); else ctx.lineTo(px, py);
}); });
@ -116,7 +128,7 @@ function facetPath(ctx: CanvasRenderingContext2D, facet: (typeof FACETS)[number]
function hexagon(ctx: CanvasRenderingContext2D, o: Point, radius: number) { function hexagon(ctx: CanvasRenderingContext2D, o: Point, radius: number) {
for (let i = 0; i < 6; i++) { for (let i = 0; i < 6; i++) {
const a = ((-90 + 60 * i) * Math.PI) / 180; const a = rad(-90 + 60 * i);
const x = o.x + Math.cos(a) * radius; const x = o.x + Math.cos(a) * radius;
const y = o.y + Math.sin(a) * radius; const y = o.y + Math.sin(a) * radius;
if (i === 0) ctx.moveTo(x, y); if (i === 0) ctx.moveTo(x, y);
@ -125,41 +137,17 @@ function hexagon(ctx: CanvasRenderingContext2D, o: Point, radius: number) {
ctx.closePath(); ctx.closePath();
} }
interface Letters { function draw(ctx: CanvasRenderingContext2D, w: number, h: number, time: number, q: number) {
font: string; const o = { x: w / 2, y: h / 2 };
chars: string[];
x: number[];
width: number;
cap: number;
}
function draw(ctx: CanvasRenderingContext2D, w: number, h: number, time: number, q: number, letters: Letters) {
const center = { x: w / 2, y: h / 2 };
ctx.clearRect(0, 0, w, h); ctx.clearRect(0, 0, w, h);
const lockup = Emphasized(phase(time, 1250, 2000)); const zoom = q > 0 ? Math.exp(Math.log(FLIGHT_ZOOM) * Flight(q)) : 1;
const lockWidth = LOCK_BOX + LOCK_GAP + letters.width; const unit = (MARK_BOX / 64) * zoom;
const box = mix(INTRO_BOX, LOCK_BOX, lockup); const gather = Emphasized(phase(time, 0, 1450));
// A slow push-in keeps the settled frame alive. // The whole field turns a little less than half a revolution as it gathers.
const drift = 1 + 0.025 * InOut(phase(time, 1900, 2900)); const field = rad(-150) * (1 - Emphasized(phase(time, 0, 1550)));
let cx = mix(center.x, center.x - lockWidth / 2 + LOCK_BOX / 2, lockup);
let cy = center.y;
let zoom = 1;
let textAlpha = 1;
let textShift = 0;
let hole = 0;
if (q > 0) {
zoom = Math.exp(Math.log(52) * Flight(q));
const recenter = Standard(Math.min(1, q / 0.75));
cx = mix(cx, center.x, recenter);
cy = mix(cy, center.y, recenter);
textAlpha = 1 - Standard(phase(q, 0, 0.4));
textShift = -14 * Standard(phase(q, 0, 0.4));
hole = InOut(phase(q, 0.12, 0.5));
}
const unit = (box / 64) * drift * zoom;
const o = { x: cx, y: cy };
// The surface: ink everywhere, with the aperture's centre cut away on exit. // The surface: ink everywhere, with the aperture's centre cut away on exit.
const hole = InOut(phase(q, 0.12, 0.5));
ctx.globalCompositeOperation = 'source-over'; ctx.globalCompositeOperation = 'source-over';
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
ctx.fillStyle = INK; ctx.fillStyle = INK;
@ -175,161 +163,121 @@ function draw(ctx: CanvasRenderingContext2D, w: number, h: number, time: number,
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
} }
const iris = irisAt(time); // The kaleidoscope's mirror lines, turning with the field.
const lightUp = EmphasizedDecelerate(phase(time, 0, 620)); const lines = InOut(phase(time, 0, 450)) * (1 - Standard(phase(time, 1100, 1700)));
const light = lightUp * (1 - Standard(phase(time, 620, 1250))); if (lines > 0) {
const ambient = 0.03 * InOut(phase(time, 300, 900)) * (1 - Standard(phase(time, 1500, 2300))); ctx.lineWidth = 1;
// Light behind the blades: a soft bloom, a hot core, and rays leaking for (let s = 0; s < 6; s++) {
// through the six gaps while the iris turns. const a = field + rad(-90 + 60 * s);
if (light > 0.001 || ambient > 0.001) { const end = { x: o.x + Math.cos(a) * 640, y: o.y + Math.sin(a) * 640 };
const g = ctx.createLinearGradient(o.x, o.y, end.x, end.y);
g.addColorStop(0, rgba(LIGHT, 0.2 * lines));
g.addColorStop(1, rgba(LIGHT, 0));
ctx.strokeStyle = g;
ctx.beginPath();
ctx.moveTo(o.x, o.y);
ctx.lineTo(end.x, end.y);
ctx.stroke();
}
}
const bloom = 0.09 * InOut(phase(time, 200, 1000)) * (1 - Standard(phase(time, 1500, 2600)));
if (bloom > 0.001) {
ctx.globalCompositeOperation = 'lighter'; ctx.globalCompositeOperation = 'lighter';
const bloom = 250; const g = ctx.createRadialGradient(o.x, o.y, 0, o.x, o.y, 300);
let g = ctx.createRadialGradient(o.x, o.y, 0, o.x, o.y, bloom); g.addColorStop(0, rgba(SEA_GLASS, bloom));
g.addColorStop(0, rgba(SEA_GLASS, 0.16 * light + ambient)); g.addColorStop(0.45, rgba(SEA_GLASS, bloom * 0.3));
g.addColorStop(0.45, rgba(SEA_GLASS, 0.04 * light + ambient * 0.3));
g.addColorStop(1, rgba(SEA_GLASS, 0)); g.addColorStop(1, rgba(SEA_GLASS, 0));
ctx.fillStyle = g; ctx.fillStyle = g;
ctx.beginPath(); ctx.beginPath();
ctx.arc(o.x, o.y, bloom, 0, Math.PI * 2); ctx.arc(o.x, o.y, 300, 0, Math.PI * 2);
ctx.fill(); ctx.fill();
if (light > 0.001) {
const core = ((26 * unit) / 2.0625) * mix(0.6, 1, light);
g = ctx.createRadialGradient(o.x, o.y, 0, o.x, o.y, core);
g.addColorStop(0, `rgba(255, 250, 236, ${0.95 * light})`);
g.addColorStop(0.35, `rgba(238, 242, 221, ${0.55 * light})`);
g.addColorStop(1, 'rgba(238, 242, 221, 0)');
ctx.fillStyle = g;
ctx.beginPath();
ctx.arc(o.x, o.y, core, 0, Math.PI * 2);
ctx.fill();
const rays = light * Math.min(1, IrisOpen(phase(time, 140, 1180)) * 2.5);
for (let i = 0; i < 6; i++) {
const angle = ((-90 + 60 * i) * Math.PI) / 180 + iris.theta;
const length = mix(40, 250, lightUp) * (0.75 + 0.25 * Math.sin(i * 2.1 + 1));
const end = { x: o.x + Math.cos(angle) * length, y: o.y + Math.sin(angle) * length };
g = ctx.createLinearGradient(o.x, o.y, end.x, end.y);
g.addColorStop(0, `rgba(255, 248, 230, ${0.42 * rays})`);
g.addColorStop(0.25, `rgba(214, 236, 226, ${0.12 * rays})`);
g.addColorStop(1, 'rgba(214, 236, 226, 0)');
ctx.fillStyle = g;
ctx.beginPath();
ctx.moveTo(o.x, o.y);
ctx.lineTo(o.x + Math.cos(angle - 0.014) * length, o.y + Math.sin(angle - 0.014) * length);
ctx.lineTo(o.x + Math.cos(angle + 0.014) * length, o.y + Math.sin(angle + 0.014) * length);
ctx.closePath();
ctx.fill();
}
}
ctx.globalCompositeOperation = 'source-over'; ctx.globalCompositeOperation = 'source-over';
} }
// Facets. Short echoes of earlier frames act as motion blur while the // Shards spiral inward, faster than the field turns, and vanish into the centre.
// blades turn; they disappear beneath the facets once the iris is still. ctx.globalCompositeOperation = 'screen';
const facetAlpha = (i: number) => EmphasizedDecelerate(phase(time, 40 + i * 34, 380 + i * 34)); const inward = Emphasized(phase(time, 0, 1350));
if (time < 1400) { FACETS.forEach((f, s) => {
for (const [delay, alpha] of [ SHARDS.forEach((d, j) => {
[84, 0.07], const appear = Standard(phase(time, j * 50 + s * 25, j * 50 + s * 25 + 420));
[56, 0.12], const vanish = Standard(phase(time, 750 + j * 45, 1350 + j * 45));
[28, 0.2], if (appear <= 0 || vanish >= 1) return;
]) { const a = f.angle + rad(d.angle) + field * 1.5;
const echo = irisAt(time - delay); const r = d.radius * (1 - 0.88 * inward);
FACETS.forEach((f, i) => { ctx.globalAlpha = appear * (1 - vanish) * 0.9;
ctx.globalAlpha = alpha * facetAlpha(i); ctx.fillStyle = PALETTE[(s + d.color) % 6];
ctx.fillStyle = f.color; ctx.beginPath();
ctx.beginPath(); shardPath(ctx, f, { x: o.x + Math.cos(a) * r, y: o.y + Math.sin(a) * r }, unit * d.scale * (1 - 0.6 * vanish), field * 2 + d.spin * (1 - gather));
facetPath(ctx, f, echo, unit, o); ctx.fill();
ctx.fill(); });
}); });
} ctx.globalAlpha = 1;
} ctx.globalCompositeOperation = 'source-over';
FACETS.forEach((f, i) => {
ctx.globalAlpha = facetAlpha(i); // The six facets ride in from the field and lock into the mark.
FACETS.forEach((f, s) => {
const r = 240 * (1 - gather);
const a = f.angle + field;
ctx.globalAlpha = Standard(phase(time, s * 25, s * 25 + 420));
ctx.fillStyle = f.color; ctx.fillStyle = f.color;
ctx.beginPath(); ctx.beginPath();
facetPath(ctx, f, iris, unit, o); facetPath(ctx, f, o, unit, field, mix(0.55, 1, gather), rad(-60) * (1 - gather), { x: Math.cos(a) * r, y: Math.sin(a) * r });
ctx.fill(); ctx.fill();
}); });
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
const sheen = phase(time, 980, 1560); // A ring pulses out as the facets lock.
if (light > 0.01 || (sheen > 0 && sheen < 1)) { const pulse = phase(time, 1380, 2050);
ctx.save(); if (pulse > 0 && pulse < 1) {
ctx.strokeStyle = rgba(SEA_GLASS, 0.45 * (1 - pulse));
ctx.lineWidth = 1.5;
ctx.beginPath(); ctx.beginPath();
FACETS.forEach((f) => facetPath(ctx, f, iris, unit, o)); hexagon(ctx, o, (30 + 24 * EmphasizedDecelerate(pulse)) * unit);
ctx.clip(); ctx.stroke();
// Backlight tints the blades while the core is hot, so they read as glass.
if (light > 0.01) {
const radius = (36 * unit) / 2.0625;
const g = ctx.createRadialGradient(o.x, o.y, 0, o.x, o.y, radius);
g.addColorStop(0, `rgba(255, 252, 240, ${0.26 * light})`);
g.addColorStop(1, 'rgba(255, 252, 240, 0)');
ctx.fillStyle = g;
ctx.fillRect(o.x - radius, o.y - radius, radius * 2, radius * 2);
}
// One diagonal band of light crosses the settled mark.
if (sheen > 0 && sheen < 1) {
const reach = 34 * unit;
const a = (36 * Math.PI) / 180;
const d = { x: Math.cos(a), y: Math.sin(a) };
const pos = mix(-1.25, 1.25, InOut(sheen)) * reach;
const width = 10 * unit;
const peak = 0.42 * Math.sin(Math.min(1, sheen * 1.1) * Math.PI);
const g = ctx.createLinearGradient(o.x + d.x * (pos - width), o.y + d.y * (pos - width), o.x + d.x * (pos + width), o.y + d.y * (pos + width));
g.addColorStop(0, 'rgba(255, 255, 255, 0)');
g.addColorStop(0.5, `rgba(255, 255, 255, ${peak})`);
g.addColorStop(1, 'rgba(255, 255, 255, 0)');
ctx.fillStyle = g;
ctx.fillRect(o.x - reach, o.y - reach, reach * 2, reach * 2);
}
ctx.restore();
} }
// The wordmark slides out from behind the mark as it moves into the lockup. // Still starting: small shards keep circling the mark.
if (time >= 1400 && textAlpha > 0) { const idle = Standard(phase(time, 2300, 2900)) * (1 - phase(q, 0, 0.25));
const scale = (box / LOCK_BOX) * drift; if (idle > 0) {
const textLeft = cx - (box * drift) / 2 + (LOCK_BOX + LOCK_GAP) * scale; ctx.globalCompositeOperation = 'screen';
const slide = EmphasizedDecelerate(phase(time, 1400, 2050)); ctx.globalAlpha = 0.4 * idle;
const baseline = cy + (letters.cap / 2) * scale; for (let s = 0; s < 6; s++) {
for (const side of [-1, 1]) {
const a = rad(-60 + 60 * s) + side * rad(11) + (time - 2300) * 0.00032;
ctx.fillStyle = PALETTE[(s + (side > 0 ? 2 : 4)) % 6];
ctx.beginPath();
shardPath(ctx, FACETS[s], { x: o.x + Math.cos(a) * 50 * unit, y: o.y + Math.sin(a) * 50 * unit }, unit * 0.16, a * 2);
ctx.fill();
}
}
ctx.globalAlpha = 1;
ctx.globalCompositeOperation = 'source-over';
}
// A band of light crosses the settled mark, then again every few seconds while it waits.
const sheen = time < 1500 ? 0 : ((time - 1500) % 3600) / 900;
if (q === 0 && sheen > 0 && sheen < 1) {
ctx.save(); ctx.save();
ctx.beginPath(); ctx.beginPath();
const clipLeft = cx + 24.5 * unit + 2 * scale; FACETS.forEach((f) => facetPath(ctx, f, o, unit, 0, 1, 0, { x: 0, y: 0 }));
ctx.rect(clipLeft, 0, w - clipLeft, h);
ctx.clip(); ctx.clip();
ctx.font = letters.font; const reach = 40 * unit;
ctx.fillStyle = WORDMARK; const a = rad(36);
ctx.textBaseline = 'alphabetic'; const d = { x: Math.cos(a), y: Math.sin(a) };
letters.chars.forEach((ch, i) => { const pos = mix(-1.25, 1.25, InOut(sheen)) * reach;
const start = 1460 + i * 45; const width = 10 * unit;
const reveal = Standard(phase(time, start, start + 320)); const peak = 0.42 * Math.sin(Math.min(1, sheen * 1.1) * Math.PI);
if (reveal <= 0) return; const g = ctx.createLinearGradient(o.x + d.x * (pos - width), o.y + d.y * (pos - width), o.x + d.x * (pos + width), o.y + d.y * (pos + width));
ctx.save(); g.addColorStop(0, 'rgba(255, 255, 255, 0)');
ctx.globalAlpha = reveal * textAlpha; g.addColorStop(0.5, `rgba(255, 255, 255, ${peak})`);
ctx.translate(textLeft + (letters.x[i] - (1 - slide) * letters.width * 0.42) * scale + textShift, baseline); g.addColorStop(1, 'rgba(255, 255, 255, 0)');
ctx.scale(scale, scale); ctx.fillStyle = g;
ctx.fillText(ch, 0, 0); ctx.fillRect(o.x - reach, o.y - reach, reach * 2, reach * 2);
ctx.restore();
});
ctx.restore(); ctx.restore();
} }
} }
async function measureLetters(): Promise<Letters> {
const size = 19 * LOCK_SCALE;
const font = `700 ${size}px 'Inter Variable', 'Segoe UI', sans-serif`;
await document.fonts?.load(font).catch(() => {});
const ctx = document.createElement('canvas').getContext('2d')!;
ctx.font = font;
const tracking = 1.4 * LOCK_SCALE;
const chars = 'KALEIDO'.split('');
const x: number[] = [];
let at = 0;
for (const ch of chars) {
x.push(at);
at += ctx.measureText(ch).width + tracking;
}
return { font, chars, x, width: at - tracking, cap: size * 0.711 };
}
export function Splash({ ready, onDone }: { ready: boolean; onDone: () => void }) { export function Splash({ ready, onDone }: { ready: boolean; onDone: () => void }) {
const reduced = useSettings((s) => s.reducedMotion); const reduced = useSettings((s) => s.reducedMotion);
const canvas = useRef<HTMLCanvasElement>(null); const canvas = useRef<HTMLCanvasElement>(null);
@ -349,7 +297,6 @@ export function Splash({ ready, onDone }: { ready: boolean; onDone: () => void }
const ctx = el.getContext('2d')!; const ctx = el.getContext('2d')!;
let raf = 0; let raf = 0;
let stopped = false; let stopped = false;
let letters: Letters | null = null;
const size = () => { const size = () => {
const dpr = window.devicePixelRatio || 1; const dpr = window.devicePixelRatio || 1;
el.width = Math.round(window.innerWidth * dpr); el.width = Math.round(window.innerWidth * dpr);
@ -359,37 +306,29 @@ export function Splash({ ready, onDone }: { ready: boolean; onDone: () => void }
size(); size();
window.addEventListener('resize', size); window.addEventListener('resize', size);
// Timeline time advances with the clock, except while held at GATHER_END.
let last = 0; let last = 0;
let time = 0; let time = 0;
let held = 0;
let exitStart = 0; let exitStart = 0;
const frame = (now: number) => { const frame = (now: number) => {
if (stopped) return; if (stopped) return;
const dt = last ? Math.min(64, now - last) : 0; // Clamp long frames so a stall doesn't skip the gather.
time += last ? Math.min(64, now - last) : 0;
last = now; last = now;
if (time < GATHER_END) time = Math.min(GATHER_END, time + dt);
else if (time === GATHER_END && !readyRef.current && held < HOLD_MAX) held += dt;
else time = Math.min(TIMELINE_END, time + dt);
if (!exitStart && time >= INTRO_END && readyRef.current) { if (!exitStart && time >= INTRO_END && readyRef.current) {
exitStart = now; exitStart = now;
document.documentElement.classList.add('splash-arrival'); document.documentElement.classList.add('splash-arrival');
} }
const q = exitStart ? Math.min(1, (now - exitStart) / EXIT_MS) : 0; const q = exitStart ? Math.min(1, (now - exitStart) / EXIT_MS) : 0;
if (letters) draw(ctx, window.innerWidth, window.innerHeight, time, q, letters); draw(ctx, window.innerWidth, window.innerHeight, time, q);
if (q >= 1) { if (q >= 1) {
done.current(); done.current();
return; return;
} }
raf = requestAnimationFrame(frame); raf = requestAnimationFrame(frame);
}; };
// Draw the first (dark) frame at once; start the clock once the wordmark's font is ready. // Draw the first (dark) frame at once so the app never shows through.
ctx.fillStyle = INK; draw(ctx, window.innerWidth, window.innerHeight, 0, 0);
ctx.fillRect(0, 0, window.innerWidth, window.innerHeight); raf = requestAnimationFrame(frame);
measureLetters().then((l) => {
letters = l;
if (!stopped) raf = requestAnimationFrame(frame);
});
return () => { return () => {
stopped = true; stopped = true;
cancelAnimationFrame(raf); cancelAnimationFrame(raf);