Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

blank: hide keys behind lid, white blinky wireframe overlay

- Keyboard/trackpad only drawn when lid is behind base (not occluding)
- Wireframe edges back as white semi-transparent lines with sin() blink
- Edges z-sorted with faces for proper layering

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+27 -2
+27 -2
system/public/aesthetic.computer/disks/blank.mjs
··· 199 199 })); 200 200 } 201 201 202 + const halfEdges = [ 203 + [0, 1], [1, 2], [2, 3], [3, 0], 204 + [4, 5], [5, 6], [6, 7], [7, 4], 205 + [0, 4], [1, 5], [2, 6], [3, 7], 206 + ]; 207 + 202 208 const project = ([x, y, z]) => { 203 209 let rx = x * cos(ay) - z * sin(ay); 204 210 let rz = x * sin(ay) + z * cos(ay); ··· 329 335 }); 330 336 } 331 337 338 + // Wireframe edges — white, semi-transparent, blinky 339 + const addEdges = (proj) => { 340 + halfEdges.forEach(([a, b]) => { 341 + const z = (proj[a][2] + proj[b][2]) / 2; 342 + drawList.push({ z, type: "edge", proj, a, b }); 343 + }); 344 + }; 345 + addEdges(projBase); 346 + addEdges(projLid); 347 + for (const hv of hingeVerts) addEdges(hv.map(project)); 348 + 332 349 // Sort back-to-front (highest z = farthest = draw first) 333 350 drawList.sort((a, b) => b.z - a.z); 334 351 ··· 340 357 ink(floor(color[0] * shade), floor(color[1] * shade), floor(color[2] * shade)); 341 358 tri(proj[a][0], proj[a][1], proj[b][0], proj[b][1], proj[c][0], proj[c][1]); 342 359 tri(proj[a][0], proj[a][1], proj[c][0], proj[c][1], proj[d][0], proj[d][1]); 360 + } else if (item.type === "edge") { 361 + const { proj, a, b } = item; 362 + const blink = sin(frame * 0.08 + a * 1.7 + b * 2.3) * 0.5 + 0.5; 363 + const alpha = floor(30 + blink * 50); 364 + ink(255, 255, 255, alpha).line(proj[a][0], proj[a][1], proj[b][0], proj[b][1]); 343 365 } 344 366 } 345 367 346 - // ⌨️ Keyboard keys — drawn after z-sorted loop, always on top of base 347 - if (kbVisible) { 368 + // ⌨️ Keyboard keys — only draw when lid isn't occluding the base 369 + const baseAvgZ = projBase.reduce((s, v) => s + v[2], 0) / projBase.length; 370 + const lidAvgZ = projLid.reduce((s, v) => s + v[2], 0) / projLid.length; 371 + const kbNotOccluded = lidAvgZ > baseAvgZ; // lid is farther = behind base 372 + if (kbVisible && kbNotOccluded) { 348 373 for (const key of kbKeys) { 349 374 const [[x0, y0], [x1, y1], [x2, y2], [x3, y3]] = key.pts; 350 375 const c = key.color || keyColor;