Dolly Zoom
The camera moves back while the lens zooms in: the subject stays the same size and the world warps behind.
AI prompt
Dolly zoom (Vertigo effect) on [subject], camera dollies backwards while the lens zooms in from 24mm to 85mm, subject stays the same size in the centre of the frame, the corridor behind them stretches and compresses unnaturally, 4 second shot, smooth continuous motion, steady and cinematic, shallow tension, muted colours, soft practical lighting. Start wide and end compressed. Negative: handheld shake, cuts, subject changing size, camera only zooming, morphing faces. Variation: reverse the move (dolly forward while zooming out) for a feeling of the walls closing in. Pair with a slow push-in on the face in the next shot to release the tension.About this pattern
Definition
A dolly zoom (the Vertigo or Hitchcock effect) moves the camera toward or away from the subject while zooming the lens the opposite way, so the subject keeps its size but the background stretches or collapses.
When to use it
- Signals a realisation, dread or a sense that the world is closing in or falling away.
- Use sparingly: once per scene, at the emotional peak, over 2 to 4 seconds.
- In AI video, describe both the camera move and the lens change, otherwise models only zoom.
What the controls do
- Slider scrubs the effect by hand; Play runs it forward and back automatically.
Motion & timing
- Autoplay: 2400ms ease-in-out each way, looping once per press.
- Reduced motion: Play is replaced by the slider only, with no automatic movement.
Tips & variations
- Works in any aspect ratio; keep the subject centred so the warp is symmetrical.
- Slow moves feel uneasy, fast ones feel violent.
Code of this live preview
<div class="fr"><div class="bgw" id="bgw"><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div><div class="sub"></div><span class="rd" id="rd"></span></div>
<div class="ctl"><label>Dolly + zoom <input id="t" type="range" min="0" max="100" value="0" aria-valuetext="Start: 24mm"></label><button id="play" type="button">Play</button></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}
.fr{position:relative;width:min(300px,100%);height:170px;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:#eceeef}
.bgw{position:absolute;inset:0;display:flex;justify-content:center;align-items:flex-end;gap:calc(10px * var(--s,1));transform:scale(var(--s,1));transform-origin:50% 60%}
.bgw i{flex:none;width:18px;background:#a6a6a0;height:60%}
.bgw i:nth-child(odd){height:78%}
.sub{position:absolute;left:50%;bottom:16px;width:30px;height:84px;margin-left:-15px;border-radius:15px 15px 4px 4px;background:#171717}
.sub::before{content:"";position:absolute;left:3px;top:-14px;width:24px;height:24px;border-radius:50%;background:#171717}
.rd{position:absolute;left:8px;top:6px;font-size:11px;background:rgba(255,255,255,.88);padding:1px 8px;border-radius:99px}
.ctl{width:min(300px,100%);margin-top:10px;display:flex;gap:10px;align-items:center}
label{flex:1;font-size:12px;color:var(--muted);display:grid;gap:4px}
input[type=range]{width:100%;accent-color:#171717}
#play{height:30px;padding:0 16px;border-radius:99px;border:0;background:var(--accent);color:var(--accent-ink);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
#play:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}const t=document.getElementById('t'),bgw=document.getElementById('bgw'),rd=document.getElementById('rd'),play=document.getElementById('play');
const reduce=matchMedia('(prefers-reduced-motion: reduce)').matches;
function apply(v){const k=v/100,s=1+k*1.9,mm=Math.round(24+k*61),d=(2+k*6).toFixed(1);bgw.style.setProperty('--s',s.toFixed(3));rd.textContent=mm+'mm lens · camera '+d+' m away';t.setAttribute('aria-valuetext',mm+' millimetres, '+d+' metres');}
apply(0);t.addEventListener('input',()=>apply(+t.value));
let raf=0;function run(){cancelAnimationFrame(raf);const t0=performance.now(),D=2400;play.disabled=true;
const f=n=>{const p=Math.min(1,(n-t0)/(2*D)),x=p<.5?p*2:(1-p)*2,e=x<.5?2*x*x:1-Math.pow(-2*x+2,2)/2;t.value=e*100;apply(e*100);if(p<1)raf=requestAnimationFrame(f);else play.disabled=false;};raf=requestAnimationFrame(f);}
if(reduce){play.hidden=true;}else play.addEventListener('click',run);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>Dolly Zoom — 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}}
.fr{position:relative;width:min(300px,100%);height:170px;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:#eceeef}
.bgw{position:absolute;inset:0;display:flex;justify-content:center;align-items:flex-end;gap:calc(10px * var(--s,1));transform:scale(var(--s,1));transform-origin:50% 60%}
.bgw i{flex:none;width:18px;background:#a6a6a0;height:60%}
.bgw i:nth-child(odd){height:78%}
.sub{position:absolute;left:50%;bottom:16px;width:30px;height:84px;margin-left:-15px;border-radius:15px 15px 4px 4px;background:#171717}
.sub::before{content:"";position:absolute;left:3px;top:-14px;width:24px;height:24px;border-radius:50%;background:#171717}
.rd{position:absolute;left:8px;top:6px;font-size:11px;background:rgba(255,255,255,.88);padding:1px 8px;border-radius:99px}
.ctl{width:min(300px,100%);margin-top:10px;display:flex;gap:10px;align-items:center}
label{flex:1;font-size:12px;color:var(--muted);display:grid;gap:4px}
input[type=range]{width:100%;accent-color:#171717}
#play{height:30px;padding:0 16px;border-radius:99px;border:0;background:var(--accent);color:var(--accent-ink);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
#play:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
</style></head>
<body><div class="stage">
<div class="fr"><div class="bgw" id="bgw"><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div><div class="sub"></div><span class="rd" id="rd"></span></div>
<div class="ctl"><label>Dolly + zoom <input id="t" type="range" min="0" max="100" value="0" aria-valuetext="Start: 24mm"></label><button id="play" type="button">Play</button></div>
</div>
<script>
const t=document.getElementById('t'),bgw=document.getElementById('bgw'),rd=document.getElementById('rd'),play=document.getElementById('play');
const reduce=matchMedia('(prefers-reduced-motion: reduce)').matches;
function apply(v){const k=v/100,s=1+k*1.9,mm=Math.round(24+k*61),d=(2+k*6).toFixed(1);bgw.style.setProperty('--s',s.toFixed(3));rd.textContent=mm+'mm lens · camera '+d+' m away';t.setAttribute('aria-valuetext',mm+' millimetres, '+d+' metres');}
apply(0);t.addEventListener('input',()=>apply(+t.value));
let raf=0;function run(){cancelAnimationFrame(raf);const t0=performance.now(),D=2400;play.disabled=true;
const f=n=>{const p=Math.min(1,(n-t0)/(2*D)),x=p<.5?p*2:(1-p)*2,e=x<.5?2*x*x:1-Math.pow(-2*x+2,2)/2;t.value=e*100;apply(e*100);if(p<1)raf=requestAnimationFrame(f);else play.disabled=false;};raf=requestAnimationFrame(f);}
if(reduce){play.hidden=true;}else play.addEventListener('click',run);
</script>
</body></html>