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 index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<link rel="preload" href="assets/fonts/ibm-plex-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin>
<script src="theme.js?v=c4917c18"></script>
<link rel="stylesheet" href="styles.css?v=091cca93">
<script src="stack.js?v=5869395c" defer></script>
<script src="stack.js?v=fc82b141" defer></script>
<script src="tools.js?v=61399069" defer></script>
</head>
<body>
Expand Down
5 changes: 4 additions & 1 deletion stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
const ROTATE_X = [Math.cos(0.1), Math.sin(0.1)];
const ROTATE_Y = [Math.cos(-0.15), Math.sin(-0.15)];
const TURN_SECONDS = 48;
// The discs turn together, like a planet's body. The brim's strips circle like its rings: the top
// one keeps the discs' pace and each one below lags a little, so nothing moves faster than the discs.
const RING_SPEEDS = [1, 0.85, 0.7];
const SPOKES = 96;
const ROWS = 3;
const RINGS = 5;
Expand Down Expand Up @@ -401,7 +404,7 @@
ctx.clearRect(0, 0, width, canvas.height);
const lit = Math.max(...layers.map((layer) => layer.glow));
const phase = angle / (T1 - T0);
const flows = stripParts.map((part) => part.dots(phase));
const flows = stripParts.map((part) => part.dots(phase * RING_SPEEDS[Math.min(part.strip, RING_SPEEDS.length - 1)]));
// Back to front: the brim behind the column, the column from its base up, then the brim in front.
// Each shape first hides whatever it covers.
const paintStrips = (front) => {
Expand Down