Skip to content

Commit 32fa520

Browse files
committed
Improve landing contrast across themes and mobile
1 parent e2b6161 commit 32fa520

4 files changed

Lines changed: 310 additions & 54 deletions

File tree

‎DESIGN.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ The homepage is based directly on
3434
`mdbase-connect/docs/mdbase-configurations-v2.html`. Its signature is one field
3535
of 361 record particles. The field begins as a murmuration and becomes concrete
3636
collection, structure, authority, permission, and access diagrams as the reader
37-
scrolls. This is the only expressive visual element.
37+
scrolls. This is the only expressive visual element. Canvas surfaces, labels,
38+
edges, and particles use the same light and dark color roles as the page. The
39+
introductory field uses the soft text and accent roles; later scenes use accent
40+
particles to distinguish metadata, hosted authority, and moving packets.
3841

3942
## Typography
4043

@@ -48,7 +51,9 @@ are compact and leave room for their explanatory text. Reading columns use a
4851
The homepage has six long chapters in a left reading column and a fixed canvas
4952
on the right. On narrow screens, the canvas moves above each chapter. Interior
5053
pages use low, ruled page openings and narrow documentation columns. Navigation,
51-
buttons, tables, callouts, and footer links remain visually quiet.
54+
buttons, tables, callouts, and footer links remain visually quiet. A reading
55+
wash sits between the homepage canvas and its copy, becoming opaque before the
56+
mobile text region begins.
5257

5358
## Motion
5459

‎public/mdbase-murmuration.js‎

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,42 @@
2626
let scrollFrame = 0;
2727
const palette = {
2828
paper: "rgb(252 252 251)",
29+
surface: "rgb(252 252 251)",
30+
surfaceSubtle: "rgb(247 248 249)",
2931
ink: "rgb(25 27 31)",
32+
soft: "rgb(68 73 80)",
3033
muted: "rgb(111 116 124)",
3134
line: "rgb(204 208 213)",
3235
lineSoft: "rgb(226 229 232)",
3336
accent: "rgb(42 104 143)",
3437
particle: "rgb(25 27 31 / 0.88)",
38+
particleIntro: "rgb(25 27 31 / 0.88)",
3539
replica: "rgb(81 87 95 / 0.62)"
3640
};
3741

3842
function syncPalette() {
3943
const styles = getComputedStyle(document.documentElement);
4044
const dark = styles.colorScheme === "dark";
4145
palette.paper = styles.getPropertyValue("--color-surface").trim() || palette.paper;
46+
palette.surface = styles.getPropertyValue("--color-surface").trim() || palette.surface;
47+
palette.surfaceSubtle =
48+
styles.getPropertyValue("--color-surface-subtle").trim() || palette.surfaceSubtle;
4249
palette.ink = styles.getPropertyValue("--color-text").trim() || palette.ink;
50+
palette.soft = styles.getPropertyValue("--color-text-soft").trim() || palette.soft;
4351
palette.muted = styles.getPropertyValue("--color-text-muted").trim() || palette.muted;
44-
palette.line = styles.getPropertyValue("--color-border-strong").trim() || palette.line;
52+
palette.line = dark
53+
? styles.getPropertyValue("--color-text-faint").trim() || palette.muted
54+
: styles.getPropertyValue("--color-text-muted").trim() || palette.muted;
4555
palette.lineSoft = styles.getPropertyValue("--color-border").trim() || palette.lineSoft;
4656
palette.accent = styles.getPropertyValue("--color-accent").trim() || palette.accent;
4757
palette.particle = dark
48-
? styles.getPropertyValue("--color-text-soft").trim() || palette.ink
49-
: "rgb(25 27 31 / 0.88)";
50-
palette.replica = dark
5158
? styles.getPropertyValue("--color-text-muted").trim() || palette.muted
52-
: "rgb(81 87 95 / 0.62)";
59+
: styles.getPropertyValue("--color-text").trim() || palette.ink;
60+
palette.particleIntro = dark
61+
? styles.getPropertyValue("--color-text-soft").trim() || palette.soft
62+
: styles.getPropertyValue("--color-text").trim() || palette.ink;
63+
palette.replica =
64+
styles.getPropertyValue("--color-text-muted").trim() || palette.muted;
5365
}
5466

5567
class Particle {
@@ -842,7 +854,8 @@
842854
if (!points || points.length < 2) return;
843855

844856
context.save();
845-
context.strokeStyle = "rgb(113 120 129 / 0.48)";
857+
context.strokeStyle = palette.muted;
858+
context.globalAlpha = 0.88;
846859
context.lineWidth = 1;
847860
context.setLineDash(edge.dashed ? [4, 5] : []);
848861
context.beginPath();
@@ -854,7 +867,8 @@
854867
const finalPoint = points[points.length - 1];
855868
const previousPoint = points[points.length - 2];
856869
const angle = Math.atan2(finalPoint.y - previousPoint.y, finalPoint.x - previousPoint.x);
857-
context.fillStyle = "rgb(113 120 129 / 0.62)";
870+
context.fillStyle = palette.muted;
871+
context.globalAlpha = 0.95;
858872
context.beginPath();
859873
context.moveTo(finalPoint.x, finalPoint.y);
860874
context.lineTo(
@@ -882,7 +896,7 @@
882896
context.font =
883897
`${compact ? 8 : 9}px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`;
884898
const metrics = context.measureText(edge.label);
885-
context.fillStyle = "rgb(252 252 251 / 0.96)";
899+
context.fillStyle = palette.surface;
886900
context.fillRect(x - metrics.width / 2 - 4, y - 7, metrics.width + 8, 12);
887901
context.fillStyle = palette.muted;
888902
context.textAlign = "center";
@@ -895,18 +909,18 @@
895909
context.save();
896910

897911
if (node.kind === "boundary") {
898-
context.fillStyle = "rgb(252 252 251 / 0.42)";
899-
context.strokeStyle = "rgb(126 133 142 / 0.48)";
912+
context.fillStyle = palette.surface;
913+
context.strokeStyle = palette.line;
900914
context.setLineDash([5, 5]);
915+
} else if (node.kind === "authority") {
916+
context.fillStyle = palette.surfaceSubtle;
917+
context.strokeStyle = palette.accent;
918+
context.setLineDash([]);
901919
} else {
902920
context.fillStyle =
903-
node.kind === "authority"
904-
? "rgb(247 250 251 / 0.94)"
905-
: "rgb(252 252 251 / 0.90)";
921+
node.kind === "service" ? palette.surfaceSubtle : palette.surface;
906922
context.strokeStyle =
907-
node.kind === "authority"
908-
? "rgb(42 104 143 / 0.62)"
909-
: "rgb(152 158 166 / 0.56)";
923+
node.kind === "replica" ? palette.muted : palette.line;
910924
context.setLineDash(node.kind === "replica" ? [4, 4] : []);
911925
}
912926

@@ -950,8 +964,30 @@
950964
context.restore();
951965
}
952966

967+
function particleFill(particle) {
968+
if (particle.role === "packet" || particle.role === "metadata") {
969+
return palette.accent;
970+
}
971+
if (activeScene === "intro") {
972+
return particle.index % 17 === 0
973+
? palette.accent
974+
: palette.particleIntro;
975+
}
976+
if (activeScene === "modes" && particle.index >= 181) {
977+
return palette.accent;
978+
}
979+
if (
980+
activeScene === "access"
981+
&& particle.index >= 151
982+
&& particle.index < 301
983+
) {
984+
return palette.accent;
985+
}
986+
return palette.particle;
987+
}
988+
953989
function drawParticle(particle, compact) {
954-
const baseSize = compact ? 2.25 : 3.25;
990+
const baseSize = compact ? 2.5 : 3.25;
955991
const size =
956992
particle.role === "packet"
957993
? baseSize * 1.5
@@ -961,14 +997,11 @@
961997

962998
if (particle.role === "replica") {
963999
context.strokeStyle = palette.replica;
964-
context.lineWidth = 0.8;
965-
context.strokeRect(x, y, Math.max(1.5, size), Math.max(1.5, size));
1000+
context.lineWidth = 0.9;
1001+
context.strokeRect(x, y, Math.max(1.75, size), Math.max(1.75, size));
9661002
} else {
967-
context.fillStyle =
968-
particle.role === "packet" || particle.role === "metadata"
969-
? palette.accent
970-
: palette.particle;
971-
context.fillRect(x, y, Math.max(1.5, size), Math.max(1.5, size));
1003+
context.fillStyle = particleFill(particle);
1004+
context.fillRect(x, y, Math.max(1.75, size), Math.max(1.75, size));
9721005
}
9731006
}
9741007

0 commit comments

Comments
 (0)