Back to the app
The code
The Most Uncomfortable Web Page by Claude Haiku 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="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Un poco de paciencia</title>
<style>
:root{--bg:#f4f1ea;--ink:#222;--btn:#3b5bdb;--btnText:#fff;--card:#fff;--line:#d8d2c4}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--bg:#1d1f24;--ink:#eee;--btn:#7c93ff;--btnText:#111;--card:#2a2d35;--line:#444}}
:root[data-theme="dark"]{--bg:#1d1f24;--ink:#eee;--btn:#7c93ff;--btnText:#111;--card:#2a2d35;--line:#444}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:system-ui,-apple-system,"Segoe UI",sans-serif;overflow-x:hidden}
body{min-height:100vh}
.screen{display:none;padding:24px 16px 40px;min-height:100vh;text-align:center}
.screen.on{display:block}
h1,h2{margin:12px 0;font-weight:700}
p{font-size:18px;line-height:1.5;margin:10px auto;max-width:440px}
button{font:inherit;font-size:20px;min-height:56px;min-width:120px;padding:14px 26px;margin:8px;border:0;border-radius:14px;background:var(--btn);color:var(--btnText);cursor:pointer;touch-action:manipulation;user-select:none}
button.ghost{background:transparent;color:var(--ink);border:2px solid var(--line)}
.tilt{display:inline-block;transform:rotate(.6deg)}
.nudge{position:relative;top:1px}
.box{background:var(--card);border:2px solid var(--line);border-radius:18px;padding:18px;margin:16px auto;max-width:440px}
.dodge{transition:left .18s ease,top .18s ease}
#cookies{max-width:440px;margin:0 auto;min-height:40px}
.cookie{background:var(--card);border:2px solid var(--line);border-radius:14px;padding:12px;margin:10px 0;text-align:left}
.cookie p{font-size:16px;margin:0 0 6px}
.bar-wrap{max-width:440px;height:34px;margin:18px auto;background:var(--card);border:2px solid var(--line);border-radius:999px;overflow:hidden}
.bar{height:100%;width:0;background:var(--btn);transition:width .6s cubic-bezier(.3,1.4,.6,1)}
.hidden{display:none!important}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:440px;margin:16px auto}
.grid div{background:var(--card);border:2px solid var(--line);border-radius:12px;padding:14px;font-size:16px}
.grid div:nth-child(odd){transform:rotate(-.5deg)}
.grid div:nth-child(even){transform:rotate(.4deg) translateY(1px)}
#demo-badge{position:fixed;left:8px;bottom:8px;font-size:12px;opacity:.5}
</style>
</head>
<body>
<section class="screen on" id="s1" data-step="0">
<h1>Bienvenido/a</h1>
<p>Pulsa Empezar para comenzar. Es muy sencillo.</p>
<button id="b-start">Empezar</button>
</section>
<section class="screen" id="s2" data-step="1">
<h2>Aviso de cookies</h2>
<p>Usamos cookies. Así es la vida digital.</p>
<div id="cookies"></div>
<button id="cookie-next" class="hidden">Siguiente</button>
</section>
<section class="screen" id="s3" data-step="2">
<h2>Anuncio importante</h2>
<div class="box" id="close-box">
<p>Este anuncio es muy importante. Por favor, ciérralo.</p>
<div id="close-row"><button class="closeb">Cerrar</button></div>
</div>
<button id="close-next" class="hidden">Siguiente</button>
</section>
<section class="screen" id="s4" data-step="3">
<h2>Cargando tu paciencia</h2>
<div class="bar-wrap"><div class="bar" id="bar"></div></div>
<p id="pct">0 %</p>
<p id="msg">Pulsa Empujar para avanzar.</p>
<button id="push">Empujar</button>
<button id="progress-next" class="hidden">Siguiente</button>
</section>
<section class="screen" id="s5" data-step="4">
<h2>Todo en orden</h2>
<p>Hemos ordenado todo con mucho cuidado. Casi.</p>
<div class="grid">
<div>Nombre</div><div>Correo</div>
<div>Idioma</div><div>Zona horaria</div>
</div>
<button id="tidy-next">Siguiente</button>
</section>
<section class="screen" id="s6" data-step="5">
<h1 class="tilt">Gracias por tu paciencia</h1>
<p class="nudge">De verdad. Has llegado al final.</p>
<button id="restart" class="ghost">Volver al principio</button>
</section>
<div id="demo-badge" class="hidden">demo</div>
<script>
(function () {
var screens = Array.prototype.slice.call(document.querySelectorAll('.screen'));
var demoOn = false, demoTimer = null, demoStart = 0, finishedAt = 0;
function go(n) {
screens.forEach(function (s, i) { s.classList.toggle('on', i === n); });
if (n === 1) spawnCookie();
if (n === 5) { finishedAt = Date.now(); }
}
function current() {
for (var i = 0; i < screens.length; i++) if (screens[i].classList.contains('on')) return i;
return 0;
}
function $(id) { return document.getElementById(id); }
// Step 1: dodging start button
var dodges = 0, startBtn = $('b-start');
function moveAway(el) {
el.classList.add('dodge');
el.style.position = 'fixed';
var w = el.offsetWidth || 120, h = el.offsetHeight || 56;
var x = Math.random() * Math.max(0, window.innerWidth - w - 16) + 8;
var y = Math.random() * Math.max(0, window.innerHeight - h - 16) + 8;
el.style.left = x + 'px';
el.style.top = y + 'px';
}
startBtn.addEventListener('pointerenter', function (e) {
if (e.pointerType === 'mouse' && dodges < 3 && !demoOn) { dodges++; moveAway(startBtn); }
});
startBtn.addEventListener('pointerdown', function (e) {
if (demoOn) return;
if (dodges < 4) { e.preventDefault(); dodges++; moveAway(startBtn); }
});
startBtn.addEventListener('click', function () {
if (dodges >= 4 || demoOn) { startBtn.style.position = ''; startBtn.style.left = ''; startBtn.style.top = ''; go(1); }
});
// Step 2: cookies that multiply
var cookieSpawned = 0, COOKIE_CAP = 8;
function spawnCookie() {
if (cookieSpawned >= COOKIE_CAP) return;
cookieSpawned++;
var host = $('cookies');
var c = document.createElement('div');
c.className = 'cookie';
c.innerHTML = '<p>Aceptamos cookies (' + cookieSpawned + ').</p>';
var a = document.createElement('button');
a.textContent = 'Aceptar';
var b = document.createElement('button');
b.textContent = 'Cerrar';
b.className = 'ghost';
c.appendChild(a); c.appendChild(b);
host.appendChild(c);
a.addEventListener('click', function () { c.remove(); spawnCookie(); spawnCookie(); checkCookies(); });
b.addEventListener('click', function () { c.remove(); spawnCookie(); checkCookies(); });
checkCookies();
}
function checkCookies() {
var empty = $('cookies').children.length === 0;
$('cookie-next').classList.toggle('hidden', !empty);
}
$('cookie-next').addEventListener('click', function () { go(2); });
// Step 3: close button that spawns close buttons
var closeCount = 0;
function closeClick() {
closeCount++;
if (closeCount < 5) {
var b = document.createElement('button');
b.className = 'closeb';
b.textContent = 'Cerrar';
b.addEventListener('click', closeClick);
$('close-row').appendChild(b);
} else {
$('close-box').innerHTML = '<p>Ya cerré. Gracias.</p>';
$('close-next').classList.remove('hidden');
}
}
document.querySelector('.closeb').addEventListener('click', closeClick);
$('close-next').addEventListener('click', function () { go(3); });
// Step 4: progress bar that slides back at 99 percent
var pct = 0, slips = 0;
function setBar(v, text) {
$('bar').style.width = v + '%';
$('pct').textContent = v + ' %';
if (text) $('msg').textContent = text;
}
$('push').addEventListener('click', function () {
if (pct >= 100) return;
if (pct >= 99) {
if (slips < 4) {
slips++;
pct = 92;
setBar(92, 'Casi. Se resbaló un poco (' + slips + ').');
} else {
pct = 100;
setBar(100, 'Listo.');
$('push').classList.add('hidden');
$('progress-next').classList.remove('hidden');
}
return;
}
pct = Math.min(99, pct + 7);
setBar(pct, pct >= 99 ? 'Ya casi... no empujes tanto.' : 'Cargando...');
});
$('progress-next').addEventListener('click', function () { go(4); });
// Step 5 and 6
$('tidy-next').addEventListener('click', function () { go(5); });
$('restart').addEventListener('click', function () { reset(); });
function reset() {
stopDemo(true);
dodges = 0; cookieSpawned = 0; closeCount = 0; pct = 0; slips = 0;
startBtn.style.position = ''; startBtn.style.left = ''; startBtn.style.top = '';
startBtn.classList.remove('dodge');
$('cookies').innerHTML = '';
$('cookie-next').classList.add('hidden');
$('close-box').innerHTML = '<p>Este anuncio es muy importante. Por favor, ciérralo.</p><div id="close-row"><button class="closeb">Cerrar</button></div>';
$('close-row').firstChild.addEventListener('click', closeClick);
$('close-next').classList.add('hidden');
setBar(0, 'Pulsa Empujar para avanzar.');
$('push').classList.remove('hidden');
$('progress-next').classList.add('hidden');
go(0);
}
// Demo mode: #demo runs a hands-free loop until a real touch or press
function demoTick() {
var s = current();
var t = Date.now() - demoStart;
if (s === 0) { startBtn.click(); }
else if (s === 1) {
var btn = document.querySelector('#cookies .cookie button');
if (btn) btn.click(); else $('cookie-next').click();
}
else if (s === 2) {
if (!$('close-next').classList.contains('hidden')) $('close-next').click();
else document.querySelector('#close-row .closeb').click();
}
else if (s === 3) {
if (!$('progress-next').classList.contains('hidden')) $('progress-next').click();
else $('push').click();
}
else if (s === 4) { $('tidy-next').click(); }
else if (s === 5) {
if (Date.now() - finishedAt > 3000) { reset(); demoStart = Date.now(); }
}
if (t > 60000) { demoStart = Date.now(); }
}
function startDemo() {
demoOn = true;
$('demo-badge').classList.remove('hidden');
demoStart = Date.now();
demoTimer = setInterval(demoTick, 600);
}
function stopDemo(silent) {
if (demoTimer) clearInterval(demoTimer);
demoTimer = null;
demoOn = false;
$('demo-badge').classList.add('hidden');
}
function realTouch() { if (demoOn) { stopDemo(); reset(); } }
document.addEventListener('pointerdown', function (e) { if (e.isTrusted) realTouch(); }, true);
document.addEventListener('touchstart', function () { realTouch(); }, { capture: true, passive: true });
if (location.hash === '#demo') { try { startDemo(); } catch (err) {} }
})();
</script>
</body>
</html>
