Some checks are pending
Deploy to Cloudflare Workers (OpenNext) / deploy (push) Waiting to run
Use mainwhite.svg on white sections with curvy green transitions into flat green bands, improve text and button contrast, and deploy via OpenNext on Cloudflare Workers. Co-authored-by: Cursor <cursoragent@cursor.com>
71 lines
2.9 KiB
TypeScript
71 lines
2.9 KiB
TypeScript
import type { ChannelBias } from "@/content/rift-page-profiles";
|
|
|
|
export const RIFT_VIEWBOX = { w: 800, h: 1200 } as const;
|
|
|
|
/** Outer bounds of central meandering rift (vertical flow) */
|
|
export const RIFT_CHANNEL_OUTER_LEFT =
|
|
"M 380 1180 C 360 1020, 340 880, 320 760 S 300 620, 310 480 S 330 340, 350 200 S 370 80, 400 40";
|
|
export const RIFT_CHANNEL_OUTER_RIGHT =
|
|
"M 420 1180 C 440 1020, 460 880, 480 760 S 500 620, 490 480 S 470 340, 450 200 S 430 80, 400 40";
|
|
|
|
/** Inner tributary / erosion lines inside channel */
|
|
export const RIFT_CHANNEL_INNER = [
|
|
"M 400 1150 C 395 980, 405 820, 398 680 S 402 520, 408 360 S 404 180, 400 60",
|
|
"M 400 1100 C 388 920, 412 740, 395 580 S 410 420, 402 260 S 406 100, 400 50",
|
|
"M 400 1050 C 402 880, 396 710, 400 550 S 398 390, 404 230 S 400 80, 400 45",
|
|
"M 400 1000 Q 385 800, 415 600 T 400 200",
|
|
] as const;
|
|
|
|
/** Smooth major contours — widely spaced */
|
|
export const CONTOUR_MAJOR = [
|
|
"M 40 200 C 120 180, 200 220, 280 190 S 400 160, 520 200 S 640 170, 760 210",
|
|
"M 60 320 C 180 300, 300 340, 420 310 S 540 280, 660 320 S 740 290, 760 310",
|
|
"M 30 440 C 160 420, 280 460, 400 430 S 520 400, 640 440 S 720 410, 770 430",
|
|
"M 50 560 C 200 540, 340 580, 480 550 S 600 520, 680 560 S 750 530, 770 550",
|
|
"M 40 680 C 180 660, 320 700, 460 670 S 580 640, 700 680 S 760 650, 770 670",
|
|
"M 55 800 C 220 780, 360 820, 500 790 S 620 760, 720 800 S 760 770, 770 790",
|
|
"M 35 920 C 200 900, 350 940, 500 910 S 640 880, 720 920 S 760 890, 770 910",
|
|
"M 45 1040 C 190 1020, 340 1060, 490 1030 S 630 1000, 710 1040 S 760 1010, 770 1030",
|
|
] as const;
|
|
|
|
/** Terrace / tight contours — one flank (right-biased in default coords) */
|
|
export const CONTOUR_MINOR = [
|
|
"M 480 180 L 495 200 L 490 220 L 505 240 L 498 260 L 512 280 L 505 300",
|
|
"M 500 340 L 515 355 L 508 375 L 522 395 L 515 415 L 528 435 L 520 455",
|
|
"M 510 500 L 525 518 L 518 538 L 532 558 L 525 578 L 538 598 L 530 618",
|
|
"M 520 660 L 535 678 L 528 698 L 542 718 L 535 738 L 548 758 L 540 778",
|
|
"M 515 820 L 530 838 L 523 858 L 537 878 L 530 898 L 543 918 L 535 938",
|
|
"M 120 240 L 105 258 L 112 276 L 98 294 L 105 312 L 92 330",
|
|
"M 110 380 L 95 398 L 102 416 L 88 434 L 95 452 L 82 470",
|
|
"M 100 520 L 85 538 L 92 556 L 78 574 L 85 592 L 72 610",
|
|
] as const;
|
|
|
|
/** Stratum lines for pitch / program layers */
|
|
export const STRATUM_LINES = [
|
|
"M 80 400 L 720 400",
|
|
"M 100 480 L 700 480",
|
|
"M 120 560 L 680 560",
|
|
"M 140 640 L 660 640",
|
|
"M 160 720 L 640 720",
|
|
] as const;
|
|
|
|
export function getChannelTransform(bias: ChannelBias): string {
|
|
switch (bias) {
|
|
case "left":
|
|
return "translate(-8%, 0)";
|
|
case "right":
|
|
return "translate(8%, 0)";
|
|
default:
|
|
return "translate(0, 0)";
|
|
}
|
|
}
|
|
|
|
export function contourOpacity(
|
|
density: "low" | "medium" | "high",
|
|
kind: "major" | "minor"
|
|
): number {
|
|
const base = kind === "major" ? 0.14 : 0.22;
|
|
const mult = density === "low" ? 0.7 : density === "high" ? 1.25 : 1;
|
|
return Math.min(0.45, base * mult);
|
|
}
|