Paper Fold Shading
Valley, mountain and Z folds drawn with flat shading only, with a slider for fold depth.
AI prompt
Flat lay photograph of a cream brochure folded in a Z shape with three panels, the left panel lit and bright, the middle panel in soft shadow, the right panel bright again, a thin soft shadow along each crease, visible paper tooth, window light from the top left, neutral wooden desk, shallow depth of field, calm and tactile. Variants: a two-panel card with a valley fold and one with a mountain fold. Negative: strong 3D bevel, torn edges, text errors, hands, harsh shadows. Reduced motion: static image.About this pattern
Definition
A fold is shown by how light falls on each panel: panels tilted toward the light look brighter and those tilted away look darker, with a thin shadow at the crease. Flat tints and a narrow crease gradient are enough, no 3D transform needed.
When to use it
- Valley fold: the two panels tilt toward each other; mountain fold: they tilt away. The shading swaps.
- Z fold: three panels alternate light, dark, light.
- Keep the tint low and the crease shadow narrow; heavy shading looks like a cheap bevel.
What the controls do
- Three fold types and a Depth slider.
Motion & timing
- Shading updates instantly; there is no animation.
- Reduced motion: nothing to change.
Tips & variations
- Shading must work for any paper colour; use black and white overlays at low opacity.
- Check that text across the fold is still legible.
Code of this live preview
<div class="bx"><div class="fd" id="fd"></div><div class="pre" id="pre" role="group" aria-label="Fold"><button data-p="0" aria-pressed="true">Valley</button><button data-p="1" aria-pressed="false">Mountain</button><button data-p="2" aria-pressed="false">Z-fold</button></div><label class="rw">Depth <b id="dv">50%</b><input id="dp" type="range" min="0" max="100" value="50"></label></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.fd{height:132px;display:flex;border-radius:6px;overflow:hidden;box-shadow:0 6px 16px rgba(0,0,0,.18)}
.fd div{flex:1;background-color:#f3eee3;position:relative;display:grid;place-content:center;gap:2px;text-align:center;font-size:12px;color:#444}.fd b{font-size:15px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const M=[['w','b'],['b','w'],['w','b','w']],fd=document.getElementById('fd'),dp=document.getElementById('dp'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){const i=dp.value/100;fd.innerHTML='';M[p].forEach((t,k)=>{const d=document.createElement('div'),a=(t==='b'?.28:.0)*i,w=(t==='w'?.55:0)*i,n=M[p].length;
const tint=t==='b'?'rgba(0,0,0,'+a.toFixed(3)+')':'rgba(255,255,255,'+w.toFixed(3)+')';
const L=k?'rgba(0,0,0,'+(.18*i).toFixed(3)+')':'transparent',Rr=k<n-1?'rgba(0,0,0,'+(.18*i).toFixed(3)+')':'transparent';
d.style.backgroundImage='linear-gradient('+tint+','+tint+'),linear-gradient(90deg,'+L+' 0,transparent 14%,transparent 86%,'+Rr+' 100%)';d.innerHTML='<b>Panel '+(k+1)+'</b><span>'+(t==='w'?'faces the light':'tilts away')+'</span>';fd.appendChild(d);});
document.getElementById('dv').textContent=dp.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));dp.addEventListener('input',up);up();One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Paper Fold Shading — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.fd{height:132px;display:flex;border-radius:6px;overflow:hidden;box-shadow:0 6px 16px rgba(0,0,0,.18)}
.fd div{flex:1;background-color:#f3eee3;position:relative;display:grid;place-content:center;gap:2px;text-align:center;font-size:12px;color:#444}.fd b{font-size:15px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="fd" id="fd"></div><div class="pre" id="pre" role="group" aria-label="Fold"><button data-p="0" aria-pressed="true">Valley</button><button data-p="1" aria-pressed="false">Mountain</button><button data-p="2" aria-pressed="false">Z-fold</button></div><label class="rw">Depth <b id="dv">50%</b><input id="dp" type="range" min="0" max="100" value="50"></label></div>
</div>
<script>
const M=[['w','b'],['b','w'],['w','b','w']],fd=document.getElementById('fd'),dp=document.getElementById('dp'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){const i=dp.value/100;fd.innerHTML='';M[p].forEach((t,k)=>{const d=document.createElement('div'),a=(t==='b'?.28:.0)*i,w=(t==='w'?.55:0)*i,n=M[p].length;
const tint=t==='b'?'rgba(0,0,0,'+a.toFixed(3)+')':'rgba(255,255,255,'+w.toFixed(3)+')';
const L=k?'rgba(0,0,0,'+(.18*i).toFixed(3)+')':'transparent',Rr=k<n-1?'rgba(0,0,0,'+(.18*i).toFixed(3)+')':'transparent';
d.style.backgroundImage='linear-gradient('+tint+','+tint+'),linear-gradient(90deg,'+L+' 0,transparent 14%,transparent 86%,'+Rr+' 100%)';d.innerHTML='<b>Panel '+(k+1)+'</b><span>'+(t==='w'?'faces the light':'tilts away')+'</span>';fd.appendChild(d);});
document.getElementById('dv').textContent=dp.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));dp.addEventListener('input',up);up();
</script>
</body></html>