Agent skill for creative 3D visualization: turn an idea into a Three.js/Blender scene worth exploring. Claude Code + Codex plugin, 223 recipes, 440 knowledge records, 22 proved kits, 37 runnable studies.
feat(site): CSS-3D cube logo with one-turn load animation
viettranx99cba02614d2
diff --git a/site/src/styles/brand-cube-logo.css b/site/src/styles/brand-cube-logo.cssindex 7d5fd70..56bdb30 100644--- a/site/src/styles/brand-cube-logo.css+++ b/site/src/styles/brand-cube-logo.css@@ -1,25 +1,26 @@/* The nav mark built as a cube. Rest pose is `rotateX(-35.264deg) rotateY(45deg)`: the isometricview whose projection is the mark's hexagon — vertical edges vertical, three faces towards thereader. Every face is `backface-visibility: hidden`, so only the faces turned towards the reader- ever paint; a convex body's front faces never overlap, so the turn reads as a solid body with no- back edges showing through and nothing to z-fight.- Each face is one rim wider than the body, so its rim straddles the cube edge the way the mark's- stroke straddles its path. That is what keeps the line one weight everywhere: an outer edge is- drawn by one face, an inner edge by two faces over the same band (both green, so the overlap is- invisible) rather than by two bands side by side.- Imported by brand-cube-logo.tsx; the reduced-motion guard in app.css stops the turn. */+ ever paint; a convex body's front faces never overlap, so the turn reads as solid — no back+ edges show through, nothing z-fights. Each face is one rim wider than the body, so its rim+ straddles the cube edge the way the mark's stroke straddles its path: that is what keeps the+ line one weight everywhere, an outer edge drawn by one face and an inner edge by two faces over+ the same band (both green, so the overlap does not show) rather than two bands side by side.+ Imported by brand-cube-logo.tsx; the reduced-motion guard in app.css stops the turn.+ Playwright's bundled WebKit paints every preserve-3d subtree flat — a textbook cube too — so it+ shows this mark as one parallelogram. Safari itself is correct: check there before believing a+ screenshot that calls the cube broken. */.brand-cube {- /* Chromium rasterises a 3D subtree at its layout size and resamples the result, which leaves a- 32px cube visibly soft on any screen. So the cube is laid out four times over and scaled back- down: every length below is written at its on-screen size and divided by this. */+ /* Chromium rasters a 3D subtree at its layout size and resamples it, which leaves a 32px cube+ soft. So it is built four times over: every length below is an on-screen size divided by this. */--cube-shrink: 0.25;/* A rim of w reads at 0.71w on screen in this pose, so 2.45px is the mark's 1.73px line. */--cube-rim: calc(2.45px / var(--cube-shrink));/* Isometric projection scales every cube axis by 0.8165, so a body of e plus the rim straddling- it draws a hexagon 1.414(e + w) wide and 1.633(e + w) tall. 18px across the rims, with the- corners blunted below, measures out as the mark's own 24.5 x 27.5px hexagon (which is a shade- squatter than a true isometric one) to within a quarter of a pixel. */+ it draws a hexagon 1.414(e + w) wide and 1.633(e + w) tall. 18px across the rims, corners+ blunted as below, measures out as the mark's own 24.5 x 27.5px hexagon to within a quarter+ pixel — the drawn hexagon is a shade squatter than a true isometric one. */--cube-edge: calc((18px - 2.45px) / var(--cube-shrink));--cube-half: calc(var(--cube-edge) / 2);--cube-swell: calc(var(--cube-shrink) * 1.18);@@ -29,9 +30,7 @@flex: none;width: 32px;height: 32px;- /* Far enough that the resting silhouette stays the flat mark's, near enough that the leading- corner grows a little as it comes round. */- perspective: 340px;+ perspective: 340px; /* keeps the resting silhouette the mark's, still grows the leading corner */}.brand-cube__turn,@@ -41,21 +40,17 @@box-sizing: border-box;}-.brand-cube__turn,-.brand-cube__box {- transform-style: preserve-3d;-}--/* The turn is the outer element, so it turns about the screen diagonal and leaves the pose below- it alone: whatever the animation does, the mark settles back into the drawn mark exactly. The- shrink lives in the keyframes because they own this element's transform. */+/* The turn is the outer element: it turns about the screen diagonal and leaves the pose below it+ alone, so whatever the animation does the mark settles back into the drawn mark exactly. */.brand-cube__turn {inset: 0;+ transform-style: preserve-3d;animation: brand-cube-turn 1.1s var(--cube-ease) 0.15s 1 both;}.brand-cube__box {top: 50%;+ transform-style: preserve-3d;left: 50%;width: var(--cube-edge);height: var(--cube-edge);@@ -64,9 +59,11 @@transition: transform 420ms var(--cube-ease);}-/* A quarter turn under the pointer, and back when it leaves. */+/* Under the pointer the body turns a third of a turn about the corner facing the reader, and back+ when it leaves. That axis is a symmetry of both the cube and the drawn hexagon, so the mark+ spins in place and lands on itself, dot included. */.brand-cube:hover .brand-cube__box {- transform: rotateX(-35.264deg) rotateY(135deg);+ transform: rotateX(-35.264deg) rotateY(45deg) rotate3d(-1, -1, 1, 120deg);}.brand-cube__face {@@ -78,37 +75,19 @@backface-visibility: hidden;}-.brand-cube__face--front {- transform: translateZ(var(--cube-half));-}--.brand-cube__face--back {- transform: rotateY(180deg) translateZ(var(--cube-half));-}--.brand-cube__face--right {- transform: rotateY(90deg) translateZ(var(--cube-half));-}--.brand-cube__face--left {- transform: rotateY(-90deg) translateZ(var(--cube-half));-}--.brand-cube__face--top {- transform: rotateX(90deg) translateZ(var(--cube-half));-}--.brand-cube__face--bottom {- transform: rotateX(-90deg) translateZ(var(--cube-half));-}--/* The mark's lime dot rides the vertex the three visible faces share. It hangs off the box rather- than off a face: `translate3d` puts it on that corner in cube space, the two rotations undo the- pose so it faces the reader as a true circle, and the lift floats the whole disc clear of the- three face planes that cross there (less lift and the browser splits the disc against them,- which shows as a nick in the ring). That corner projects onto the perspective origin, so the lift moves nothing.- The half-size step comes first, before the rotations: it has to cancel the element's layout- offset, which is measured in the cube's plane rather than the reader's. */+.brand-cube__face--front { transform: translateZ(var(--cube-half)); }+.brand-cube__face--back { transform: rotateY(180deg) translateZ(var(--cube-half)); }+.brand-cube__face--right { transform: rotateY(90deg) translateZ(var(--cube-half)); }+.brand-cube__face--left { transform: rotateY(-90deg) translateZ(var(--cube-half)); }+.brand-cube__face--top { transform: rotateX(90deg) translateZ(var(--cube-half)); }+.brand-cube__face--bottom { transform: rotateX(-90deg) translateZ(var(--cube-half)); }++/* The mark's lime dot rides the vertex the three visible faces share, hanging off the box rather+ than off a face: `translate3d` puts it on that corner in cube space, the rotations undo the pose+ so it faces the reader as a true circle, and the lift floats the whole disc clear of the three+ face planes crossing there — under it the browser splits the disc against them and nicks the+ ring, and since the corner projects onto the perspective origin the lift shifts it nowhere. The+ half-size step comes first because it cancels a layout offset in the cube's plane, not ours. */.brand-cube__dot {position: absolute;top: 50%;@@ -125,7 +104,8 @@rotateY(-45deg) rotateX(35.264deg) translateZ(calc(3px / var(--cube-shrink)));}-/* One turn about the screen diagonal, swelling at the halfway point. */+/* One turn about the screen diagonal, swelling at the halfway point. The scale is also what puts+ the four-times-over layout back at 32px, which is why it belongs here. */@keyframes brand-cube-turn {0% {transform: rotate3d(1, 1, 0, 0deg) scale3d(var(--cube-shrink), var(--cube-shrink), var(--cube-shrink));