Back to the app
The code
The Most Uncomfortable Web Page by Claude Sonnet 5.5
Exactly as the AI wrote it. Shown as text, so nothing runs on this page.
index.html
works · auto-checked (Checked by an automated pass. Not hand-played yet.)<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>A Perfectly Normal Page</title>
<style>
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:#eef1f4;font-family:Georgia,"Times New Roman",serif;color:#222;-webkit-tap-highlight-color:transparent}
body{display:flex;justify-content:center;padding:16px;min-height:100vh;touch-action:manipulation}
#card{width:100%;max-width:560px;background:#fff;border:1px solid #cfd6dd;border-radius:14px;padding:22px 20px 26px;margin:auto;box-shadow:0 6px 20px rgba(0,0,0,.08);transform:rotate(.35deg);position:relative;overflow:hidden;min-height:480px}
h1{font-size:26px;margin:0 0 10px;position:relative;left:1px;top:-1px;line-height:1.2}
p{font-size:17px;line-height:1.5;margin:8px 0}
.w{display:inline-block;position:relative}
.btn{font:inherit;font-size:19px;min-height:54px;padding:12px 24px;border:0;border-radius:12px;background:#2f6fed;color:#fff;cursor:pointer;margin:8px 6px 8px 0;touch-action:manipulation}
.btn.alt{background:#e3e8ee;color:#223}
.arena{position:relative;height:210px;border:2px dashed #c3ccd6;border-radius:10px;margin-top:14px;background:#fafbfc}
#dodge{position:absolute;left:calc(50% - 70px);top:78px;width:140px;transition:left .22s ease-out,top .22s ease-out;margin:0}
ul.tidy{list-style:none;padding:0;margin:12px 0;display:flex;gap:8px;flex-wrap:wrap}
ul.tidy li{background:#f1f4f8;border:1px solid #d4dbe3;border-radius:6px;padding:6px 12px;font-size:15px}
.cookies{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.ck{background:#fff8e6;border:1px solid #e6d29a;border-radius:10px;padding:10px 12px;font-size:15px;animation:pop .35s ease-out}
.ck .btn{min-height:48px;font-size:17px;padding:8px 18px;margin:6px 6px 0 0}
@keyframes pop{from{opacity:0;transform:scale(.9)}to{opacity:1}}
.bar{height:34px;background:#e3e8ee;border-radius:17px;overflow:hidden;margin:18px 0 8px;border:1px solid #cfd6dd}
#fill{height:100%;width:0;background:#2fa36b;transition:width .5s linear;border-radius:17px 0 0 17px}
.big{font-size:44px;margin:6px 0}
.modalback{position:absolute;inset:0;background:rgba(255,255,255,.75);display:flex;align-items:center;justify-content:center;padding:16px;z-index:5}
.modal{background:#fff;border:1px solid #b9c3cd;border-radius:12px;padding:18px;width:100%;box-shadow:0 8px 24px rgba(0,0,0,.15);min-height:230px;position:relative;transform:rotate(-.5deg)}
.modal .btn{position:absolute;margin:0;transition:left .3s,top .3s}
.mini{font-size:13px;color:#667;margin-top:14px}
</style>
</head>
<body>
<div id="card"><div id="stage"></div></div>
<script>
(function(){
var stage=document.getElementById('stage'),card=document.getElementById('card');
var timers=[],demo=location.hash==='#demo',cur=0,st={},speed=demo?0.5:1;
function T(f,ms){var t=setTimeout(f,ms);timers.push(t);return t}
function clearT(){timers.forEach(clearTimeout);timers=[]}
function crooked(root){
root.querySelectorAll('.off').forEach(function(el){
el.innerHTML=el.textContent.split(' ').map(function(w,i){
var dx=(i%3===0)?1:(i%3===1?-1:0),dy=(i%2)?1:-1;
return '<span class="w" style="left:'+dx+'px;top:'+dy+'px">'+w+'</span>';
}).join(' ');
});
root.querySelectorAll('.tilt').forEach(function(el,i){el.style.transform='rotate('+((i%2?1:-1)*(.4+(i%3)*.3))+'deg)'});
}
function go(n){
clearT();cur=n;st={};
[s1,s2,s3,s4,s5][n]();
crooked(stage);
if(demo)demoStep();
}
/* Stage 1: dodging button */
function s1(){
stage.innerHTML='<h1>Welcome to a Perfectly Normal Page</h1>'+
'<p class="off">Everything here is tidy, aligned and completely under control. Please press Start to begin.</p>'+
'<ul class="tidy"><li class="tilt">Tidy</li><li class="tilt">Straight</li><li class="tilt">Definitely level</li></ul>'+
'<div class="arena" id="arena"><button class="btn" id="dodge">Start</button></div>'+
'<div class="mini" id="msg">The button is a little shy.</div>';
st.d=0;
var b=document.getElementById('dodge'),ar=document.getElementById('arena');
b.addEventListener('pointerenter',function(e){if(e.pointerType==='mouse')dodge()});
b.addEventListener('pointerdown',function(e){if(e.pointerType!=='mouse')dodge()});
b.addEventListener('click',function(){if(st.d>=5)go(1)});
}
function dodge(){
if(st.d>=5)return;
var ar=document.getElementById('arena'),b=document.getElementById('dodge'),m=document.getElementById('msg');
st.d++;
var maxX=ar.clientWidth-b.offsetWidth-4,maxY=ar.clientHeight-b.offsetHeight-4;
b.style.left=Math.max(2,Math.random()*maxX)+'px';
b.style.top=Math.max(2,Math.random()*maxY)+'px';
var lines=['Too slow!','Nope, over here.','Almost had it.','Hmm, it moved again.','Okay, it gave up. Press it now.'];
m.textContent=lines[st.d-1];
if(st.d>=5)b.textContent='Fine. Start.';
}
/* Stage 2: multiplying cookies */
function s2(){
stage.innerHTML='<h1>We value your privacy</h1><p class="off">Please deal with these notices. We promise there are not many.</p><div class="cookies" id="ck"></div>';
st.clicks=0;st.total=0;addCk();
}
function addCk(){
var box=document.getElementById('ck');if(!box)return;
var d=document.createElement('div');d.className='ck tilt';
d.style.transform='rotate('+((Math.random()-.5)*1.6)+'deg)';
d.innerHTML='<div>We use cookies (the tiny, crumbly kind) to improve your experience of crumbs.</div><button class="btn acc">Accept</button><button class="btn alt acc">Accept differently</button>';
d.querySelectorAll('.acc').forEach(function(x){x.addEventListener('click',function(){accept(d)})});
box.appendChild(d);st.total++;
}
function accept(d){
st.clicks++;
d.remove();
if(st.clicks>=6){var box=document.getElementById('ck');if(box)box.innerHTML='<div class="ck">All cookies accepted. There were, in the end, only crumbs.</div>';T(function(){go(2)},1100);return}
var k=st.clicks<3?2:(st.clicks<5?1:0);
for(var i=0;i<k;i++)addCk();
var box2=document.getElementById('ck');
if(box2&&!box2.children.length)addCk();
}
/* Stage 3: progress bar */
function s3(){
stage.innerHTML='<h1>Preparing your experience</h1><p class="off" id="cap">Loading...</p><div class="bar"><div id="fill"></div></div><div class="mini" id="pct">0%</div>';
var plan=[99,62,99,81,99,44,100],i=0,v=0;
var caps=['Loading...','Almost there!','Hmm. Recalculating backwards.','Almost there, again!','Found a few misplaced pixels.','Truly almost there.','Done!'];
function step(){
var target=plan[i],fill=document.getElementById('fill');if(!fill)return;
document.getElementById('cap').textContent=caps[i];
var dist=Math.abs(target-v),dur=(target<v?500:dist*55)*speed;
fill.style.transition='width '+(dur/1000)+'s '+(target<v?'ease-in':'linear');
fill.style.width=target+'%';
var t0=Date.now(),from=v;
(function tick(){
var p=document.getElementById('pct');if(!p)return;
var f=Math.min(1,(Date.now()-t0)/Math.max(dur,1));
p.textContent=Math.round(from+(target-from)*f)+'%';
if(f<1)T(tick,60);
})();
v=target;i++;
if(i<plan.length)T(step,dur+(target===99?500:200)*speed);
else T(function(){go(3)},dur+900*speed);
}
T(step,400);
}
/* Stage 4: close chain */
function s4(){
stage.innerHTML='<h1>One last thing</h1><p class="off">A very important message is about to appear. You will want to dismiss it.</p>'+
'<div class="modalback" id="mb"><div class="modal" id="modal"><div class="off" style="font-size:17px;max-width:75%">Important notice: this notice is not very important.</div></div></div>';
st.c=0;spawnClose();
}
function spawnClose(){
var m=document.getElementById('modal');if(!m)return;
var b=document.createElement('button');
b.className='btn alt close';b.textContent=st.c>=5?'Close (really)':'Close';
var w=m.clientWidth-130,h=m.clientHeight-70;
b.style.left=Math.max(8,Math.random()*w)+'px';
b.style.top=Math.max(60,40+Math.random()*(h-40))+'px';
b.addEventListener('click',function(){
b.remove();st.c++;
if(st.c>5){go(4);return}
var n=st.c<3?1:1;
spawnClose();
if(st.c===2)spawnClose();
});
m.appendChild(b);
}
/* Stage 5: thanks */
function s5(){
stage.innerHTML='<h1>Thank you for your patience</h1><div class="big">🎉</div><p class="off">You dodged a button, ate six cookies, waited on a progress bar that kept changing its mind, and closed a notice many times. That is truly impressive.</p>'+
'<ul class="tidy"><li class="tilt">Patient</li><li class="tilt">Persistent</li><li class="tilt">Mostly straight</li></ul>'+
'<button class="btn" id="again">Do it all again</button>';
document.getElementById('again').addEventListener('click',function(){if(demo)return;go(0)});
}
/* Demo driver */
function demoStep(){
var delay=650;
if(cur===0){
if(st.d<5){T(function(){dodge();demoStep()},delay)}
else T(function(){var b=document.getElementById('dodge');if(b)b.click()},delay);
}else if(cur===1){
T(function(){var b=document.querySelector('.ck .acc');if(b){b.click();if(cur===1)demoStep()}},500);
}else if(cur===3){
T(function(){var b=document.querySelector('.close');if(b){b.click();if(cur===3)demoStep()}},600);
}else if(cur===4){
T(function(){if(demo)go(0)},2500);
}
}
window.addEventListener('pointerdown',function(e){
if(demo&&e.isTrusted){demo=false;speed=1;clearT();go(0)}
},true);
window.addEventListener('touchstart',function(e){
if(demo&&e.isTrusted){demo=false;speed=1;clearT();go(0)}
},true);
go(0);
})();
</script>
</body>
</html>
