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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*Because no code is the best code.*
**Rig** - Readable Independent Grammar.

[RigWorks](https://rig.works) - **Rig** for short, and Rig in all running text - is a shared grammar for real work. It is future-proof, host-independent, and human-readable: open the JSON, change a field, load it in another app. It is a framework you never install - no library to link, no runtime to embed, no API to version. It ships as agreement: a grammar of schema ids and entity/component POD documents. Apps that speak the same schema ids share fields and units, so their content interoperates without either app knowing the other exists.
[RigWorks](https://rig.works) - **Rig** for short, and Rig in all running text - is a **future-proof**, **host-independent**, **human-readable** vocabulary for real work. Open the JSON, change a field, load it in another app. It is a framework you never install - no library to link, no runtime to embed, no API to version. It ships as agreement: a grammar of schema ids and entity/component POD documents. Apps that speak the same schema ids share fields and units, so their content interoperates without either app knowing the other exists.

## It runs

Expand Down
2 changes: 1 addition & 1 deletion docs/design-philosophy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Design philosophy

Rig is a **future-proof**, **host-independent**, **human-readable** vocabulary for creative work.
Rig is a **future-proof**, **host-independent**, **human-readable** vocabulary for real work.

**Rig** - Readable Independent Grammar.

Expand Down
81 changes: 46 additions & 35 deletions site/data/cloud.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ body.cloud .cloud-bar .nav-menu .nav-links {

body.cloud::before { display: none; }

/* Same line bar as landing / .topbar — not the old soft gradient. */
body.cloud nav {
max-width: none;
margin: 0;
padding: 0.8rem 1.25rem 0.15rem;
padding: 0.65rem 1.25rem;
}

.cloud-bar {
Expand All @@ -31,38 +32,36 @@ body.cloud nav {
top: 0;
left: 0;
right: 0;
background: rgba(11, 13, 16, 0.94);
backdrop-filter: blur(10px);
border-bottom: 1px solid var(--line);
pointer-events: none;
}

.cloud-bar::before {
content: "";
.cloud-bar nav { pointer-events: auto; }

/* Crumbs → find → card, same width, under the header on the left. */
.cloud-rail {
position: absolute;
z-index: -1;
left: 0;
right: 0;
top: 0;
bottom: -1.6rem;
z-index: 3;
top: 4.1rem;
left: 1rem;
bottom: 1rem;
width: min(24.5rem, calc(100vw - 2rem));
display: flex;
flex-direction: column;
gap: 0.55rem;
pointer-events: none;
background: linear-gradient(to bottom, rgba(11, 13, 16, 0.94) 62%, rgba(11, 13, 16, 0));
}

.cloud-bar nav,
.cloud-bar .cloud-sub { pointer-events: auto; }

.cloud-sub {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 1rem;
padding: 0.15rem 1.25rem 0;
}
.cloud-rail > * { pointer-events: auto; min-width: 0; }

.cloud-crumbs {
font-family: var(--mono);
font-size: 0.78rem;
color: var(--muted);
min-height: 1.7rem;
padding-top: 0.45rem;
min-height: 1.35rem;
padding: 0 0.1rem;
min-width: 0;
}

Expand All @@ -71,10 +70,11 @@ body.cloud nav {
.cloud-crumbs .here { color: var(--text); }
.cloud-crumbs .sep { color: var(--line); padding: 0 0.35rem; }

.cloud-find { position: relative; flex: none; }
.cloud-find { position: relative; flex: none; width: 100%; }

.cloud-find input {
width: min(18rem, 42vw);
width: 100%;
box-sizing: border-box;
background: var(--surface);
border: 1px solid var(--line);
border-radius: 8px;
Expand All @@ -90,6 +90,7 @@ body.cloud nav {
.cloud-find ul {
position: absolute;
top: calc(100% + 0.35rem);
left: 0;
right: 0;
z-index: 4;
margin: 0;
Expand All @@ -98,8 +99,8 @@ body.cloud nav {
background: rgba(18, 21, 27, 0.97);
border: 1px solid var(--line);
border-radius: 8px;
min-width: min(22rem, 80vw);
max-width: min(28rem, 86vw);
width: 100%;
max-width: none;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

Expand Down Expand Up @@ -154,12 +155,12 @@ body.cloud-ready #labels { opacity: 1; transition: opacity 180ms ease; }
#plot:active { cursor: grabbing; }

.cloud-card {
position: absolute;
position: relative;
z-index: 2;
left: 1rem;
bottom: 1rem;
width: min(24.5rem, calc(100vw - 2rem));
max-height: min(46vh, 28rem);
width: 100%;
flex: 1 1 auto;
min-height: 0;
max-height: none;
overflow: auto;
scrollbar-width: thin;
scrollbar-color: var(--line) transparent;
Expand All @@ -175,7 +176,7 @@ body.cloud-ready #labels { opacity: 1; transition: opacity 180ms ease; }
font-size: 1.12rem;
line-height: 1.25;
letter-spacing: -0.02em;
font-weight: 620;
font-weight: 500;
margin: 0 0 0.4rem;
}

Expand All @@ -187,9 +188,14 @@ body.cloud-ready #labels { opacity: 1; transition: opacity 180ms ease; }
padding: 0;
color: inherit;
font-size: 0.92em;
font-weight: 400;
overflow-wrap: anywhere;
}

.field-rows a code {
color: #c3ccdb;
}

.cloud-card p { max-width: none; margin: 0 0 0.5rem; }

.card-summary { color: #c3ccdb; font-size: 0.92rem; line-height: 1.5; }
Expand Down Expand Up @@ -341,16 +347,21 @@ body.cloud-ready #labels { opacity: 1; transition: opacity 180ms ease; }

body.cloud-failed { overflow: auto; height: auto; }
body.cloud-failed .cloud-stage,
body.cloud-failed .cloud-sub { display: none; }
body.cloud-failed .cloud-rail { display: none; }
body.cloud-failed .cloud-index { display: block; }

@media (prefers-reduced-motion: reduce) {
#plot { transition: none; }
}

@media (max-width: 52rem) {
.cloud-sub { flex-direction: column; align-items: stretch; }
.cloud-find input { width: 100%; }
.cloud-card { max-height: min(32vh, 16rem); }
.cloud-rail {
top: auto;
bottom: 0.75rem;
left: 0.75rem;
right: 0.75rem;
width: auto;
max-height: min(48vh, 22rem);
}
.cloud-index ul { columns: 1; }
}
99 changes: 77 additions & 22 deletions site/data/cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,29 @@ void main() {
requestAnimationFrame(frame);
}

/** Near-camera side of the cloud stays bright; far side falls toward the
* background — even when fully zoomed out, so the mesh keeps depth. */
function depthOf(node, eye) {
const d = Math.hypot(node.x - eye[0], node.y - eye[1], node.z - eye[2]);
const near = cam.dist * 0.55;
const far = cam.dist * 1.55;
const t = clamp((d - near) / Math.max(far - near, 1), 0, 1);
return 1 - 0.62 * t * t;
}

function depthTint(rgb, depth) {
const fog = 1 - depth;
const bg = [0.043, 0.051, 0.063];
return [
rgb[0] + (bg[0] - rgb[0]) * fog * 0.85,
rgb[1] + (bg[1] - rgb[1]) * fog * 0.85,
rgb[2] + (bg[2] - rgb[2]) * fog * 0.85,
];
}

function draw() {
const mvp = viewProjection();
const eye = eyeOf();
const open = focusedSchema(focus);
const close = 1 - reveal();
const spots = open && open.fields.length && close > 0.35 ? fieldSpots(open) : [];
Expand All @@ -691,14 +712,16 @@ void main() {
const hot = hoverSchema && (link.a === hoverSchema || link.b === hoverSchema);
const shown = focusedSchema(focus);
const incident = shown && (link.a === shown || link.b === shown);
const depth = Math.sqrt(depthOf(link.a, eye) * depthOf(link.b, eye));
let alpha = link.same ? 0.55 : 0.7;
alpha *= Math.sqrt(dimOf(link.a) * dimOf(link.b));
alpha *= Math.sqrt(dimOf(link.a) * dimOf(link.b)) * (0.42 + 0.58 * depth);
if (hot || (incident && close > 0.15)) alpha = Math.max(alpha, hot ? 0.95 : 0.55 + 0.4 * close);
else if ((hoverSchema || shown) && close > 0) alpha *= 1 - 0.72 * close;
if (alpha < 0.012) continue;
const rgb = hot || incident
let rgb = hot || incident
? lift(ACCENT, 0.35)
: lift(link.same ? link.a.domain.rgb : ACCENT, 0.32);
if (!hot && !incident) rgb = depthTint(rgb, depth);
pushLine(lines, link.a, link.b, rgb, alpha);
}
for (let i = 0; i < spots.length; i++) {
Expand All @@ -712,10 +735,13 @@ void main() {
const points = [];
for (const schema of allSchemas) {
const hot = hoverSchema === schema || (open && schema === open);
const alpha = Math.min(1, dimOf(schema) * (schema.maturity === "draft" ? 0.72 : 1) * (hot ? 1 : 0.92));
const depth = depthOf(schema, eye);
let alpha = Math.min(1, dimOf(schema) * (schema.maturity === "draft" ? 0.72 : 1) * (hot ? 1 : 0.92));
if (!hot) alpha *= 0.38 + 0.62 * depth;
if (alpha < 0.02) continue;
const size = schema.size * (hot ? 1.45 : 1);
pushPoint(points, schema, schema.domain.rgb, size, alpha, schema.maturity === "experimental" ? 1 : 0);
const size = schema.size * (hot ? 1.45 : 1) * (hot ? 1 : 0.82 + 0.18 * depth);
const rgb = hot ? schema.domain.rgb : depthTint(schema.domain.rgb, depth);
pushPoint(points, schema, rgb, size, alpha, schema.maturity === "experimental" ? 1 : 0);
}
for (const spot of spots) {
const hot = hover === spot.field || focus === spot.field;
Expand Down Expand Up @@ -777,7 +803,7 @@ void main() {
ctx.clearRect(0, 0, width, height);
const mvp = viewProjection();
const mono = monoFont();
ctx.font = `600 12.5px ${mono}`;
ctx.font = `400 12px ${mono}`;
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.lineJoin = "round";
Expand All @@ -797,16 +823,25 @@ void main() {
const q = project(mvp, schema.x, schema.y, schema.z);
if (q) reach = Math.max(reach, Math.hypot(q.x - p.x, q.y - p.y));
}
if (reach < 16) continue;
if (focus.kind === "world" && reach > 520) continue;
queue.push({ text: domain.short, x: p.x, y: p.y, font: 12.5, priority: 3 });
if (reach < 14) continue;
if (focus.kind === "world" && reach > 560) continue;
queue.push({ text: domain.short, x: p.x, y: p.y, font: 12, priority: 3, tone: "domain" });
}
}

const pushSchema = (schema, priority) => {
const p = project(mvp, schema.x, schema.y, schema.z);
if (!p) return;
queue.push({ text: schema.leaf, x: p.x, y: p.y - 12, font: 11.5, priority });
// Light (low-degree) nodes stay visible — just quieter fill.
const tone = schema.degree <= 1 ? "light" : schema.degree <= 3 ? "mid" : "heavy";
queue.push({
text: schema.leaf,
x: p.x,
y: p.y - 11,
font: 11,
priority,
tone,
});
};

if (query) {
Expand All @@ -822,8 +857,9 @@ void main() {
text: spot.field.name,
x: p.x,
y: p.y - 10,
font: 11.5,
font: 10.5,
priority: spot.field === focus ? 5 : 2,
tone: "field",
});
}
for (const schema of neighbors.get(open)) pushSchema(schema, 4);
Expand All @@ -844,29 +880,33 @@ void main() {
}

function stamp(ctx, placed, item, mono) {
const { text, x, y, font } = item;
const { text, x, y, font, tone } = item;
if (x < -20 || y < -12 || x > width + 20 || y > height + 12) return;
ctx.font = `${font > 12 ? 600 : 500} ${font}px ${mono}`;
ctx.font = `400 ${font}px ${mono}`;
const w = ctx.measureText(text).width;
const box = { x: x - w / 2 - 4, y: y - font / 2 - 3, w: w + 8, h: font + 6 };
const box = { x: x - w / 2 - 3, y: y - font / 2 - 2, w: w + 6, h: font + 4 };
if (placed.some((p) => overlaps(p, box))) return;
placed.push(box);
ctx.strokeStyle = "#0b0d10";
ctx.lineWidth = 3.5;
ctx.lineWidth = 2.4;
ctx.strokeText(text, x, y);
ctx.fillStyle = "#d5deea";
ctx.fillStyle =
tone === "light" ? "#8d97a8"
: tone === "mid" ? "#b4becc"
: tone === "field" ? "#a8b4c4"
: "#d5deea";
ctx.fillText(text, x, y);
}

function degreeFloor() {
// Keep light nodes labeled once you are not fully zoomed out.
const d = cam.dist / (model.worldDist || 1);
if (d > 0.82) return 2;
if (d > 0.55) return 1;
if (d > 0.92) return 1;
return 0;
}

function overlaps(a, b) {
const pad = 2;
const pad = 1;
return a.x < b.x + b.w + pad && a.x + a.w + pad > b.x && a.y < b.y + b.h + pad && a.y + a.h + pad > b.y;
}

Expand Down Expand Up @@ -1080,14 +1120,27 @@ void main() {
const px = cam.tx + b.rx * nx * halfW + b.ux * ny * halfH;
const py = cam.ty + b.ry * nx * halfW + b.uy * ny * halfH;
const pz = cam.tz + b.rz * nx * halfW + b.uz * ny * halfH;
const home = model.worldDist * 0.52;
const dist = clamp(cam.dist * factor, 22, model.worldDist * 2.2);
const halfH2 = dist * Math.tan(FOV / 2);
const halfW2 = halfH2 * (width / height);
let tx = px - (b.rx * nx * halfW2 + b.ux * ny * halfH2);
let ty = py - (b.ry * nx * halfW2 + b.uy * ny * halfH2);
let tz = pz - (b.rz * nx * halfW2 + b.uz * ny * halfH2);
const wide = clamp((dist - model.worldDist * 0.62) / (model.worldDist * 0.38), 0, 1);
const rest = focusAnchor();
// Wide zoom used to snap the look-at back onto the focused schema, so
// the far side of the cloud stayed off-screen. Hand framing back to the
// world origin as distance leaves the close orbit.
let rest = focusAnchor();
if (focus && focus.kind !== "world") {
const leaveStart = focus.kind === "domain" ? home * 0.65 : 120;
const leave = clamp((dist - leaveStart) / Math.max(home - leaveStart, 1), 0, 1);
rest = {
x: rest.x * (1 - leave),
y: rest.y * (1 - leave),
z: rest.z * (1 - leave),
};
}
const wide = clamp((dist - home * 0.88) / Math.max(home * 0.55, 1), 0, 1);
tx += (rest.x - tx) * wide;
ty += (rest.y - ty) * wide;
tz += (rest.z - tz) * wide;
Expand Down Expand Up @@ -1159,7 +1212,9 @@ void main() {
function aim(node, immediate) {
let goal;
if (!node || node.kind === "world") {
goal = { x: 0, y: 0, z: 0, dist: model.worldDist };
// Start / Escape inside the framing distance so the mesh has presence
// instead of sitting as a distant ball.
goal = { x: 0, y: 0, z: 0, dist: model.worldDist * 0.52 };
if (!dragging) spin = !query;
} else if (node.kind === "domain") {
const c = centroid(node.schemas);
Expand Down
Loading
Loading