Haze & Atmospheric Depth
Four mountain layers fade toward the haze colour with distance; a slider sets how thick the atmosphere is.
AI prompt
Misty mountain valley at dawn in four overlapping ridgelines, each layer paler and bluer than the one in front, the farthest ridge almost dissolving into soft cool-grey haze, the nearest ridge dark green with sharp pine silhouettes, a low pale sun glowing through the fog, calm and quiet mood, strong sense of depth through atmospheric perspective, wide landscape, soft gradients, photographic realism. Variants: warm golden haze for sunrise, dense grey fog hiding the middle layers for a mysterious look. Negative: all layers equally dark, hard edges at distance, oversaturated colours, text.About this pattern
Definition
Atmospheric (aerial) perspective makes distant objects lighter, bluer and lower in contrast because of haze. Layering silhouettes with increasing haze is a quick way to create depth and a quiet mood.
When to use it
- Thicker haze feels dreamy, cold or mysterious; thin haze feels crisp and clear.
- Haze colour sets the mood: cool blue for calm, warm gold for sunrise, neutral grey for fog.
- State the number of layers and how pale the farthest one is in prompts.
What the controls do
- Haze slider from 0 to 100 and three haze colours.
Motion & timing
- Layers update live with the slider.
- Reduced motion: no difference.
Tips & variations
- Depth reads best with at least three layers and a clear contrast step between them.
- Avoid pure white distance on bright screens; keep a hint of tone.
Code of this live preview
<div class="bx"><div class="sc" id="sc"><i class="sun"></i><i class="ly" data-d="0"></i><i class="ly" data-d="1"></i><i class="ly" data-d="2"></i><i class="ly" data-d="3"></i></div>
<div class="pre" id="pre" role="group" aria-label="Haze colour"><button data-c="#a9bfd6" aria-pressed="true">Cool</button><button data-c="#f3d9a6" aria-pressed="false">Golden</button><button data-c="#cfd2d4" aria-pressed="false">Grey fog</button></div>
<label class="ctl">Haze <b id="hv">55%</b><input id="hz" type="range" min="0" max="100" value="55"></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}
.bx{width:min(320px,100%);display:grid;gap:8px}
.sc{position:relative;height:150px;border-radius:12px;overflow:hidden;background:var(--sky,#a9bfd6)}
.sun{position:absolute;left:62%;top:26px;width:30px;height:30px;border-radius:50%;background:#fff6dc;box-shadow:0 0 30px 12px rgba(255,246,220,.6)}
.ly{position:absolute;left:-5%;right:-5%;bottom:0;display:block}
.ly[data-d="3"]{height:46%;clip-path:polygon(0 100%,0 40%,15% 18%,30% 44%,50% 6%,70% 38%,85% 20%,100% 42%,100% 100%)}
.ly[data-d="2"]{height:40%;clip-path:polygon(0 100%,0 50%,22% 14%,40% 48%,62% 8%,80% 44%,100% 20%,100% 100%)}
.ly[data-d="1"]{height:32%;clip-path:polygon(0 100%,0 40%,18% 10%,36% 44%,58% 0,78% 40%,100% 16%,100% 100%)}
.ly[data-d="0"]{height:24%;clip-path:polygon(0 100%,0 30%,10% 0,22% 36%,34% 8%,48% 42%,64% 6%,80% 38%,92% 4%,100% 30%,100% 100%)}
.pre{display:flex;gap:5px}.pre button{flex:1;height:28px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11.5px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.ctl{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.ctl b{color:var(--text)}input[type=range]{width:100%;accent-color:#171717}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none}}const sc=document.getElementById('sc'),hz=document.getElementById('hz'),ls=[...sc.querySelectorAll('.ly')],bs=[...document.querySelectorAll('#pre button')];let hc='#a9bfd6';
const base=[[22,48,40],[34,66,58],[52,82,76],[72,100,96]];
function mix(a,b,t){return a.map((v,i)=>Math.round(v+(b[i]-v)*t));}
function hex(h){return [1,3,5].map(i=>parseInt(h.slice(i,i+2),16));}
function up(){const h=hz.value/100,H=hex(hc);ls.forEach((l,i)=>{const t=Math.min(.88,h*(.3+i*.28)),c=mix(base[i],H,t);l.style.background='rgb('+c.join(',')+')';});sc.style.setProperty('--sky',hc);document.getElementById('hv').textContent=hz.value+'%';}
bs.forEach(b=>b.addEventListener('click',()=>{hc=b.dataset.c;bs.forEach(x=>x.setAttribute('aria-pressed',String(x===b)));up();}));hz.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>Haze & Atmospheric Depth — 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}}
.bx{width:min(320px,100%);display:grid;gap:8px}
.sc{position:relative;height:150px;border-radius:12px;overflow:hidden;background:var(--sky,#a9bfd6)}
.sun{position:absolute;left:62%;top:26px;width:30px;height:30px;border-radius:50%;background:#fff6dc;box-shadow:0 0 30px 12px rgba(255,246,220,.6)}
.ly{position:absolute;left:-5%;right:-5%;bottom:0;display:block}
.ly[data-d="3"]{height:46%;clip-path:polygon(0 100%,0 40%,15% 18%,30% 44%,50% 6%,70% 38%,85% 20%,100% 42%,100% 100%)}
.ly[data-d="2"]{height:40%;clip-path:polygon(0 100%,0 50%,22% 14%,40% 48%,62% 8%,80% 44%,100% 20%,100% 100%)}
.ly[data-d="1"]{height:32%;clip-path:polygon(0 100%,0 40%,18% 10%,36% 44%,58% 0,78% 40%,100% 16%,100% 100%)}
.ly[data-d="0"]{height:24%;clip-path:polygon(0 100%,0 30%,10% 0,22% 36%,34% 8%,48% 42%,64% 6%,80% 38%,92% 4%,100% 30%,100% 100%)}
.pre{display:flex;gap:5px}.pre button{flex:1;height:28px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11.5px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.ctl{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.ctl b{color:var(--text)}input[type=range]{width:100%;accent-color:#171717}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="sc" id="sc"><i class="sun"></i><i class="ly" data-d="0"></i><i class="ly" data-d="1"></i><i class="ly" data-d="2"></i><i class="ly" data-d="3"></i></div>
<div class="pre" id="pre" role="group" aria-label="Haze colour"><button data-c="#a9bfd6" aria-pressed="true">Cool</button><button data-c="#f3d9a6" aria-pressed="false">Golden</button><button data-c="#cfd2d4" aria-pressed="false">Grey fog</button></div>
<label class="ctl">Haze <b id="hv">55%</b><input id="hz" type="range" min="0" max="100" value="55"></label></div>
</div>
<script>
const sc=document.getElementById('sc'),hz=document.getElementById('hz'),ls=[...sc.querySelectorAll('.ly')],bs=[...document.querySelectorAll('#pre button')];let hc='#a9bfd6';
const base=[[22,48,40],[34,66,58],[52,82,76],[72,100,96]];
function mix(a,b,t){return a.map((v,i)=>Math.round(v+(b[i]-v)*t));}
function hex(h){return [1,3,5].map(i=>parseInt(h.slice(i,i+2),16));}
function up(){const h=hz.value/100,H=hex(hc);ls.forEach((l,i)=>{const t=Math.min(.88,h*(.3+i*.28)),c=mix(base[i],H,t);l.style.background='rgb('+c.join(',')+')';});sc.style.setProperty('--sky',hc);document.getElementById('hv').textContent=hz.value+'%';}
bs.forEach(b=>b.addEventListener('click',()=>{hc=b.dataset.c;bs.forEach(x=>x.setAttribute('aria-pressed',String(x===b)));up();}));hz.addEventListener('input',up);up();
</script>
</body></html>