Skip to content
Experiment 01 / 20

Pleat Press

Can this
be CSS?

A CSS game for web designers: 20 live effects and four possible techniques. Sometimes the answer is CSS. Often it is not.

Look closely. Which technique powers this effect?

Keys: 1 to 4 to answer, N for the next effect.

Your score0 correct, 0 of 20 played

Effect index

20 experiments
  1. 01Pleat Press
  2. 02Contour Bloom
  3. 03Dot Matrix
  4. 04Liquid Alloy
  5. 05Type Orbit
  6. 06Sleeve Note
  7. 07Night Passage
  8. 08Glass Census
  9. 09Jacquard Tide
  10. 10Overprint Club
  11. 11Facet Quarry
  12. 12Block Shadow
  13. 13Magnetic North
  14. 14Leadlight
  15. 15Solar Aperture
  16. 16Tidal Scan
  17. 17Parcel Stack
  18. 18Ring Foundry
  19. 19Overprint Lens
  20. 20Paper Aperture

Reading a web effect

A folded headline and a polished metal ring can both look three-dimensional on a flat screen. To work out how an effect was built, watch what stays fixed as you move the pointer. Does the whole object turn? Does the lettering bend inside a boundary? Do individual marks change direction while their positions stay put?

Four ways to draw the same idea

CSS
Think in pieces of a page. A strip can crop a word, a shadow can suggest a second surface, and a transform can tilt both. A useful first sketch is to draw a box around each part that needs to move independently.
SVG
Think in outlines. A designer can build a whole motif from one path repeated at different sizes or angles. Follow a single contour through the composition and look for places where that same shape returns.
Canvas
Think in drawing instructions. With the 2D canvas API, a grid of marks can share a rule for spacing while each mark has its own size, color or angle. Changing one rule and redrawing the grid can turn an orderly pattern into an image.
WebGL
Think in samples across a surface. For a lens, a shader can calculate where each visible point should sample the lettering underneath. Altering that mapping near the rim gives a convincing bend even when the lettering itself stays still.

These are clues. More than one technique can produce the same image. Your guess is scored against the implementation you can inspect in this game, where 5 of the 20 effects are CSS, 4 are SVG, 6 use Canvas and 5 use WebGL.

Checks to run after a guess

  • Zoom the page to 300%. CSS and SVG posters redraw from shapes and text, so they stay sharp. In this game, Canvas and WebGL posters paint pixels at a capped resolution and soften as you zoom.
  • Right-click the poster and choose Inspect. Separate elements for each strip, letter or path mean CSS or SVG. A single <canvas> element means Canvas or WebGL.
  • Count the marks. Dots, needles or ridge lines you could count one by one usually come from the 2D canvas API. Smooth light, refraction and glow that change on every pixel point to a WebGL shader.
  • Look for boxes or paths. CSS builds from rectangles: strips, faces, stacked shadows. SVG builds from outlines: closed paths, clip shapes and rings.

Three comparisons to try

Depth from a silhouette. Open Block Shadow and look at the farthest edge of a letter. Then rotate the viewpoint in Ring Foundry. In the first poster, watch the spacing between the face and its shadow. In the second, watch one hoop disappear behind another. Both suggest depth, but they give your eye different evidence.

Lettering as a field of marks. Compare Dot Matrix with Magnetic North. Once you have guessed, enter the same short word in both and pause the motion. Look at the boundary between a letter and its background. In one poster, dot size carries the edge. In the other, the letters emerge from changes in the color and orientation of short strokes.

A distortion with an edge. Move across Glass Census, then try Tidal Scan. Follow one vertical stroke in each. In the lens, you can point to the boundary where the word starts to bend. In the scan, neighboring strips slide by different amounts. That distinction is useful when describing a motion reference to a developer.

From a poster to a design decision

In Inspect effect, start with the first construction step. Add the second and pause before adding the third. Which step first makes the illusion recognizable? That is the part worth prototyping for your own layout.

Try a longer word, lower the strength, and check the result at phone width. A treatment that works for a four-letter event title may swallow the counters in a longer headline. If the effect carries essential copy, make sure the words still read when the motion stops.

Answer key: how all 20 effects are built

Contains spoilers. Play first.

01 Pleat Press CSS

One printed word, three impressions and twelve folded panels. Each strip reveals a different slice of the same typesetting.

Each fold is a copy of the same line of type, cropped to a narrow strip and skewed. The letters are live text, so they stay sharp at any zoom level.

  1. Set the word in a single oversized line.
  2. Repeat the ink across three rows and slice it into twelve equal strips.
  3. Skew neighboring strips in opposite directions and shade their edges.
.strip { transform: skewY(var(--angle)); }
.strip:nth-child(even) {
  transform: skewY(calc(-1 * var(--angle)));
}

02 Contour Bloom SVG

A flower grows from a stack of closed vector paths. Every contour follows the same five-petal rule, with a different radius and twist.

Fifty-five closed outlines share one center and one five-petal rule. Crisp curves that scale without blur, all built from a repeated shape, point to SVG.

  1. Plot a single five-lobed outline with a closed path.
  2. Nest fifty-five paths around the same center.
  3. Rotate each contour progressively and shift the petal phase.
const radius = base * (1 + depth * Math.cos(5 * angle + phase));
const x = cx + radius * Math.cos(angle + twist);
const y = cy + radius * Math.sin(angle + twist);

03 Dot Matrix Canvas

The sphere and its lettering share one grid of circles. A simulated light sets their sizes, and a text mask changes the ink density.

The sphere and the lettering are one grid of circles with different sizes. Thousands of identical marks redrawn on every frame are a job for a 2D canvas, not thousands of page elements.

  1. Sample a word into a grid and print one circle at every sample.
  2. Compute virtual sphere normals and use the light angle to shade each dot.
  3. Remap dot sizes inside the letter mask so the headline cuts through the sphere.
ctx.moveTo(cx + radius, cy);
ctx.arc(cx, cy, radius, 0, Math.PI * 2);
// Fill all circles in a single batch.
ctx.fill();

04 Liquid Alloy WebGL

A fragment shader bends a stripe field into flowing metallic folds. All the highlights are calculated per pixel.

No shape on the poster has an edge you can trace. The color of every pixel comes from a formula, which is how a fragment shader works.

  1. Draw a gently rippled band field on one full-screen triangle.
  2. Warp the sampling coordinates through four sine-wave passes.
  3. Map the warped bands to shadow, reflected blush and a bright highlight.
for (int i = 0; i < 4; i++) {
  q += .21 * sin(q.yx * 3.5 + float(i) * 1.85 + drift);
  q = rotation * q;
}

05 Type Orbit CSS

Individual letters sit around invisible cylinders. Perspective and backface culling give the four rotating bands their volume.

Every letter is its own element, turned and pushed out with 3D transforms. Letters vanish as they face away from you, which is backface culling in CSS.

  1. Typeset the word on a flat plane.
  2. Turn each letter to a new angle and push it out to a common radius.
  3. Stack four bands at different phases and rotate the whole sculpture.
.letter {
  backface-visibility: hidden;
  transform: rotateY(var(--angle)) translateZ(var(--radius))
             translate(-50%, -50%);
}

06 Sleeve Note CSS

A grooved disc slides behind an angled jacket. The travelling highlight and the circular label move independently.

The disc, the label and the jacket move independently, like stacked boxes. The travelling shine is a conic gradient turning over the grooves.

  1. Cut a disk and print concentric grooves.
  2. Add the center label and overlap the printed sleeve.
  3. Lay a rotating conic reflection across the grooves.
.disc { background: repeating-radial-gradient(circle, #111 0, #47443f .13cqw, #171813 var(--pitch)); }
.glint { background: conic-gradient(from var(--shine), transparent, #ffebcb50, transparent 29%); }

07 Night Passage Canvas

Successive ridge lines cover each other, carrying a flat sunset into a moving field of illuminated contours.

Twenty-five ridge lines are redrawn every time the viewpoint shifts. Many overlapping lines repainted on each frame point to a canvas.

  1. Place the sun above one landscape silhouette.
  2. Stack twenty-five ridges with increasing separation.
  3. Shift the nearer ridges farther as the viewpoint moves.
const depth = i / 24;
const base = 225 + depth * depth * 305;
const drift = (depth * depth + .15) * (pointerX * 1.7 + time * .18);

08 Glass Census WebGL

A virtual lens passes over a sheet of printed words. Refraction stretches the type inside its circular boundary; each color channel takes a slightly different path near the rim.

The type bends only inside the lens, and the color channels split near the rim. Sampling the same sheet at a shifted position for each pixel is a shader technique.

  1. Print a repeating sheet of type.
  2. Refract the sheet through a circular lens.
  3. Split the ink channels and polish the rim.
vec2 normal = delta / radius;
float depth = sqrt(max(0.0, 1.0 - dot(normal, normal)));
vec2 lensUV = p - normal * depth * bend;
float cyan = printSheet(lensUV + normal * spread);

09 Jacquard Tide SVG

A woven panel made from reusable paths. Each warp thread gets its own narrow clipping window so alternate weft ribbons can cross over it.

Every warp thread has its own narrow clipping window, so the ribbons can pass over and under. Reused paths and clip paths are SVG territory.

  1. Draw six curved ribbons with fine parallel filaments.
  2. Pass a vertical field of warp threads over the ribbons.
  3. Reprint alternating ribbon segments through a clip at each crossing.
<g clip-path="url(#crossing)">
  <use href="#weft" fill="none" stroke="#ed635b" stroke-width="25"/>
</g>

10 Overprint Club Canvas

Three translucent print plates share the same sheet. The overlaps create secondary colors, and misregistration splits the edges of the type.

Three color plates multiply where they overlap, and the edges split when the plates slip out of register. All three are painted onto one bitmap.

  1. Print the yellow circle and headline.
  2. Multiply the magenta plate and the striped cyan plate over it.
  3. Shift the three plates out of register.
ctx.globalCompositeOperation = 'multiply';
for (const plate of plates) {
  ctx.drawImage(plate.image, plate.offsetX, plate.offsetY);
}

11 Facet Quarry WebGL

A field of drifting seed points cuts a block of type into mineral fragments. The nearest seed determines each face, while the gap to its runner-up traces its seam.

Each fragment belongs to its nearest seed point, a Voronoi pattern. Finding the nearest seed for every pixel on every frame is work for the GPU.

  1. Set pale lettering in a deep blue field.
  2. Split the surface by nearest seed.
  3. Shift the letter fragments and light the seams.
if (distanceToSeed < closest) {
  second = closest;
  closest = distanceToSeed;
  face = seed;
}
float seam = second - closest;

12 Block Shadow CSS

Closely spaced flat shadows turn a line of lettering into a printed wooden block. The last few impressions act as its dark registration edge.

The depth is thirty copies of the word's own text-shadow, each nudged one step further. The word is still live text, so it stays sharp when you zoom in.

  1. Set a single oversized line of type.
  2. Build depth from thirty offset text shadows.
  3. Apply the ink border and a ruled printing ground.
.word {
  color: #fff2ce;
  -webkit-text-stroke: .17cqw #20382f;
  paint-order: stroke fill;
  text-shadow:
    0.28cqw 0.28cqw #112822,
    0.55cqw 0.57cqw #112822,
    0.83cqw 0.85cqw #e9674c,
    1.10cqw 1.13cqw #e9674c,
    1.38cqw 1.42cqw #e9674c,
    1.66cqw 1.70cqw #e9674c,
    1.93cqw 1.98cqw #e9674c,
    2.21cqw 2.26cqw #e9674c,
    2.48cqw 2.55cqw #e9674c,
    2.76cqw 2.83cqw #e9674c,
    3.04cqw 3.11cqw #e9674c,
    3.31cqw 3.40cqw #e9674c,
    3.59cqw 3.68cqw #e9674c,
    3.86cqw 3.96cqw #e9674c,
    4.14cqw 4.25cqw #e9674c,
    4.42cqw 4.53cqw #e9674c,
    4.69cqw 4.81cqw #e9674c,
    4.97cqw 5.09cqw #e9674c,
    5.24cqw 5.38cqw #e9674c,
    5.52cqw 5.66cqw #e9674c,
    5.80cqw 5.94cqw #e9674c,
    6.07cqw 6.23cqw #e9674c,
    6.35cqw 6.51cqw #20382f,
    6.62cqw 6.79cqw #20382f,
    6.90cqw 7.08cqw #20382f,
    7.18cqw 7.36cqw #20382f,
    7.45cqw 7.64cqw #20382f,
    7.73cqw 7.92cqw #20382f,
    8.00cqw 8.21cqw #20382f,
    8.28cqw 8.49cqw #20382f;
}

13 Magnetic North Canvas

An array of short compass needles holds a word in its spacing, color and orientation. The pointer steers a moving magnetic pole.

The word exists only in the angle and color of thousands of short needles. A field of marks recalculated as the pole moves points to a canvas.

  1. Lay out evenly spaced needles on a dark field.
  2. Sample a text mask to brighten and turn the letter strokes.
  3. Bend the needle directions around a moving pole.
const bearing = Math.atan2(y - poleY, x - poleX);
const angle = base + strength * Math.sin(bearing + .5);
const dx = length * Math.cos(angle), dy = length * Math.sin(angle);

14 Leadlight SVG

An arched window combines radial glass panes with opaque lead seams. Moving slivers of light stay inside the same arch as the colored panes.

Colored panes and lead seams sit inside one arched clip path. Hard vector edges that share a clipping shape point to SVG.

  1. Lay out polygon panes inside an arched clipping path.
  2. Color the panes and thicken their lead seams.
  3. Move narrow highlights over the clipped glass.
<clipPath id="arch"><path d="M93 543V272a307 261 0 0 1 614 0v271Z"/></clipPath>
<g clip-path="url(#arch)">
  <polygon points="…" stroke="#253333" stroke-width="4"/>
</g>

15 Solar Aperture WebGL

An occulting disk passes in front of a hot spectral ring. Angular harmonics stretch its corona into thousands of fine rays against a dark sky.

The corona breaks into thousands of fine rays that change per pixel. A radial falloff modulated by angle is a classic fragment shader pattern.

  1. Cut a black disk into the night sky.
  2. Expose the offset disk of light behind it.
  3. Modulate a radial falloff into fine coronal rays.
float angle = atan(p.y, p.x);
float ray = pow(0.5 + 0.5*cos(97.0*angle + drift), 5.0);
float corona = exp(-distanceFromRim / rayLength);
color += spectralInk * corona;

16 Tidal Scan Canvas

A fluorescent type specimen becomes a wave when neighboring slices of the original bitmap rise and stretch by different amounts.

Neighboring vertical slices of the same image rise and stretch by different amounts. Copying narrow strips of an offscreen bitmap is a canvas technique.

  1. Print three lines onto an offscreen sheet.
  2. Copy the sheet in narrow strips and shift their height on a sine wave.
  3. Stretch each strip independently around the midline.
const rise = Math.sin(phase) * amplitude;
const y = (height - height * zoom) / 2 + rise;
ctx.drawImage(sheet, x, 0, 3, height, x, y, 3, height * zoom);

17 Parcel Stack CSS

A stack of tiny shipping cartons built from flat planes. A skew on each face establishes the shared isometric projection.

Every carton is three flat faces skewed into an isometric view. Flat boxes bent with transforms are CSS, and the CARGO labels are live text.

  1. Build one carton from three flat faces.
  2. Arrange cartons on a staggered four-by-four grid.
  3. Wrap a strip of tape across each lid and print the front faces.
.face { transform: skewY(25deg); transform-origin: right top; }
.side { transform: skewY(-25deg); transform-origin: left top; }
.top { clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }

18 Ring Foundry WebGL

A distance field describes a stack of mint-green metal hoops. A ray walks from the camera toward the sculpture until it hits a surface; a second sample reveals the direction of the light.

The hoops hide behind each other with correct depth and lighting, yet there are no polygons. Ray marching a distance field happens in a fragment shader.

  1. March camera rays toward a single hoop.
  2. Stack and twist five hoops.
  3. Estimate surface normals and light the casting.
for (int i = 0; i < 64; i++) {
  float d = scene(camera + ray * travel);
  if (d < 0.002 || travel > 8.0) break;
  travel += d * 0.82;
}

19 Overprint Lens SVG

Two displaced ring plates interfere inside one circular aperture. The open paper letters cut a quiet channel across the pattern.

Two ring patterns are offset and blended with multiply inside one circular clip. The rings are vector strokes and the letters are knocked out in the paper color.

  1. Print a single set of equally spaced rings.
  2. Offset a second ink plate and multiply the two colors.
  3. Knock the lettering out in the paper color.
<g clip-path="url(#aperture)">
  <g fill="none" stroke="navy">…</g>
  <g transform="translate(12 3)" style="mix-blend-mode:multiply">…</g>
</g>

20 Paper Aperture Canvas

Nested hexagons form an iris with a dark core. The edges appear to curl when each ring turns a little farther than the last.

Eleven nested hexagons each turn a little farther than the last. Simple shapes redrawn with a per-layer rotation on each frame point to a canvas.

  1. Cut a single hexagonal field behind the title.
  2. Nest eleven colored hexagons with shrinking radii.
  3. Twist each layer in proportion to its depth.
const radius = 425 * Math.pow(.83, ring);
const angle = spin + vertex * Math.PI / 3;
ctx.lineTo(cx + radius * Math.cos(angle), cy + radius * Math.sin(angle));

How to play

Explore the poster, then pick the technique used to render it. Only your first guess counts.

The answer is CSS for only some of the 20 effects, so look before you pick. After the reveal, inspect the layers, change the lettering and compare the result with the code. Your score stays in this browser.

Your result