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="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The Patience Test</title>
<style>
:root{
--bg:#f4f1ea;
--ink:#2b2a33;
--muted:#6b6878;
--card:#ffffff;
--accent:#5b4bdb;
--accent-ink:#ffffff;
--line:#d8d3c6;
color-scheme:light;
}
@media (prefers-color-scheme: dark){
:root:not([data-theme="light"]){
--bg:#1b1a22;
--ink:#f1efe8;
--muted:#a7a3b5;
--card:#27252f;
--accent:#9d91ff;
--accent-ink:#14131a;
--line:#3d3a48;
color-scheme:dark;
}
}
:root[data-theme="dark"]{
--bg:#1b1a22;
--ink:#f1efe8;
--muted:#a7a3b5;
--card:#27252f;
--accent:#9d91ff;
--accent-ink:#14131a;
--line:#3d3a48;
color-scheme:dark;
}
[hidden]{display:none !important}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
background:var(--bg);
color:var(--ink);
font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
min-height:100vh;
min-height:100dvh;
overflow-x:hidden;
-webkit-tap-highlight-color:transparent;
}
main{max-width:520px;margin:0 auto;padding:24px 16px 56px}
.brand{margin:0 0 12px;color:var(--muted);font-size:.9rem;letter-spacing:.04em;text-transform:uppercase}
.scene{display:none}
.scene.on{display:block}
.card{
background:var(--card);
border:1px solid var(--line);
border-radius:16px;
padding:22px 20px;
box-shadow:0 2px 0 var(--line);
transform:rotate(.25deg);
}
h1,h2{margin:0 0 12px;line-height:1.15}
h1{font-size:2rem}
h2{font-size:1.5rem}
p{line-height:1.5;margin:0 0 10px}
.hint{color:var(--muted);font-style:italic;min-height:1.5em;margin:12px 0}
.blurry{text-shadow:0.6px 0 0 var(--muted)}
.big{
appearance:none;
border:0;
border-radius:14px;
background:var(--accent);
color:var(--accent-ink);
font:inherit;
font-size:1.1rem;
font-weight:600;
min-height:54px;
min-width:140px;
padding:0 22px;
cursor:pointer;
touch-action:manipulation;
}
.big:disabled{opacity:.45;cursor:not-allowed}
/* Scene 0: dodging start button */
.dodge-area{position:relative;height:220px;margin:16px 0 4px;border:1px dashed var(--line);border-radius:16px}
#startBtn{position:absolute;left:0;top:0;transition:left .12s ease-out,top .12s ease-out}
/* Scene 2: progress bar */
.bar{height:26px;background:var(--line);border-radius:999px;overflow:hidden;margin:16px 0 8px}
#fill{height:100%;width:0%;background:var(--accent);border-radius:999px;transition:width .9s ease-in-out}
/* Scene 3: tidy and crooked */
#offText{transform:translateX(1px);transition:transform .3s}
.tidy{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}
.tidy>div{
background:var(--bg);
border:1px solid var(--line);
border-radius:12px;
padding:14px 8px;
text-align:center;
}
@media (min-width:480px){ .tidy{grid-template-columns:repeat(3,1fr)} }
#next3{transform:rotate(.8deg)}
/* Scene 5: slider */
#slider{width:100%;height:44px;margin:12px 0;accent-color:var(--accent)}
/* Cookie notices (multiply) */
.cookie{
position:fixed;
width:min(290px, calc(100vw - 32px));
background:var(--card);
color:var(--ink);
border:1px solid var(--line);
border-radius:14px;
padding:14px;
box-shadow:0 8px 24px rgba(0,0,0,.18);
z-index:50;
font-size:.95rem;
}
.cookie .row{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.cookie button{
flex:1 1 auto;
min-height:44px;
padding:0 14px;
border-radius:10px;
border:1px solid var(--line);
background:var(--bg);
color:var(--ink);
font:inherit;
cursor:pointer;
}
.cookie button.acc{background:var(--accent);color:var(--accent-ink);border-color:transparent}
/* Close buttons (spawn) */
.modal{
position:fixed;
width:min(300px, calc(100vw - 32px));
background:var(--card);
color:var(--ink);
border:1px solid var(--line);
border-radius:16px;
padding:18px;
box-shadow:0 10px 30px rgba(0,0,0,.22);
z-index:60;
}
#demoBanner{
position:fixed;
left:0;
right:0;
bottom:0;
background:var(--ink);
color:var(--bg);
text-align:center;
padding:10px 16px;
font-size:.95rem;
z-index:90;
}
</style>
</head>
<body>
<main>
<p class="brand">The Patience Test</p>
<!-- Scene 0: a Start button that dodges -->
<section class="scene" data-scene="0">
<div class="card">
<h1>Welcome</h1>
<p>Press Start to enter. Everything will work eventually.</p>
<div class="dodge-area" id="dodgeArea">
<button class="big" id="startBtn" type="button">Start</button>
</div>
<p class="hint" id="hint"></p>
</div>
</section>
<!-- Scene 1: cookie notices that multiply -->
<section class="scene" data-scene="1">
<div class="card">
<h2>One small thing: cookies</h2>
<p>Please deal with the cookie notice. It is not going anywhere.</p>
<p class="hint" id="cookieCount"></p>
<button class="big" id="contCookies" type="button" disabled>Continue</button>
</div>
</section>
<!-- Scene 2: progress bar that slides back at 99 percent -->
<section class="scene" data-scene="2">
<div class="card">
<h2>Installing your patience</h2>
<div class="bar"><div id="fill"></div></div>
<p><strong id="pct">0%</strong></p>
<p class="hint" id="progMsg">Starting...</p>
<button class="big" id="finishBtn" type="button" hidden>Just finish</button>
</div>
</section>
<!-- Scene 3: text one pixel off, tidy things slightly crooked -->
<section class="scene" data-scene="3">
<div class="card">
<h2 class="blurry">Please read carefully</h2>
<p id="offText">These terms are exactly the same as the ones you read before. Nothing has changed. Nothing at all.</p>
<div class="tidy">
<div>Tidy</div>
<div>Neat</div>
<div>Aligned</div>
<div>Level</div>
<div>Straight</div>
<div>Orderly</div>
</div>
<p class="hint">Everything is in its place. Almost everything.</p>
<button class="big" id="next3" type="button">Next</button>
</div>
</section>
<!-- Scene 4: a Close button that spawns another Close button -->
<section class="scene" data-scene="4">
<div class="card">
<h2>A short notice</h2>
<p>Please close the notice that just appeared. You will know when you are done.</p>
</div>
</section>
<!-- Scene 5: slider that slides back -->
<section class="scene" data-scene="5">
<div class="card">
<h2>Final check</h2>
<p>Slide all the way to 100 to prove you are not a robot.</p>
<input type="range" id="slider" min="0" max="100" value="0" step="1" aria-label="Verification slider">
<p class="hint" id="sliderMsg"></p>
<button class="big" id="sliderNext" type="button" hidden>Next</button>
</div>
</section>
<!-- Final scene -->
<section class="scene" data-scene="6">
<div class="card" style="text-align:center">
<h1>Thank you.</h1>
<p>Thank you for your patience. You made it to the end, which was the point.</p>
<p class="hint" id="stats"></p>
<button class="big" id="againBtn" type="button">Start again</button>
</div>
</section>
</main>
<div id="cookieLayer"></div>
<div id="modalLayer"></div>
<div id="demoBanner" hidden>Hands-free demo. Touch the screen to take over.</div>
<script>
(function () {
"use strict";
function $(id) { return document.getElementById(id); }
function rnd(a, b) { return a + Math.random() * (b - a); }
var scenes = [].slice.call(document.querySelectorAll(".scene"));
var cookieLayer = $("cookieLayer");
var modalLayer = $("modalLayer");
var current = -1;
var timers = [];
var demo = false;
var demoTimer = null;
var finalHold = false;
var enter = {};
// ---------- timers and navigation ----------
function later(fn, ms) { var id = setTimeout(fn, ms); timers.push(id); return id; }
function every(fn, ms) { var id = setInterval(fn, ms); timers.push(id); return id; }
function clearTimers() {
while (timers.length) {
var id = timers.pop();
clearTimeout(id);
clearInterval(id);
}
}
function clearLayers() {
cookieLayer.innerHTML = "";
modalLayer.innerHTML = "";
}
function go(i) {
clearTimers();
clearLayers();
current = i;
scenes.forEach(function (s, idx) { s.classList.toggle("on", idx === i); });
window.scrollTo(0, 0);
if (enter[i]) enter[i]();
}
// ---------- scene 0: dodging Start ----------
var dodges = 0;
var HINTS = ["Nope.", "Still no.", "Ha. Nice try.", "Almost... no.", "That one is shy."];
function centerStart() {
var area = $("dodgeArea"), b = $("startBtn");
b.style.left = Math.max(0, (area.clientWidth - b.offsetWidth) / 2) + "px";
b.style.top = Math.max(0, (area.clientHeight - b.offsetHeight) / 2) + "px";
}
function dodgeStart() {
var area = $("dodgeArea"), b = $("startBtn");
var maxX = Math.max(0, area.clientWidth - b.offsetWidth - 8);
var maxY = Math.max(0, area.clientHeight - b.offsetHeight - 8);
b.style.left = (4 + Math.random() * maxX) + "px";
b.style.top = (4 + Math.random() * maxY) + "px";
}
function dodgeOnce() {
dodges++;
dodgeStart();
$("hint").textContent = HINTS[(dodges - 1) % HINTS.length];
}
enter[0] = function () {
dodges = 0;
$("hint").textContent = "";
centerStart();
};
$("startBtn").addEventListener("pointerenter", function (e) {
if (e.pointerType === "mouse" && current === 0 && dodges < 4) dodgeOnce();
});
$("startBtn").addEventListener("click", function () {
if (current !== 0) return;
if (dodges < 4) { dodgeOnce(); return; }
go(1);
});
// ---------- scene 1: cookie notices that multiply ----------
var COOKIE_MAX = 14;
var COOKIE_TEXTS = [
"We use cookies to make things nicer. Accept?",
"Declining cookies is a bold choice. Accept?",
"Cookies help us remember you. Please accept.",
"Are you sure about declining? Accept is right there."
];
var cookieSpawns = 0;
var demoDeclines = 0;
function updateCookies() {
var live = cookieLayer.children.length;
$("cookieCount").textContent = live
? live + (live === 1 ? " notice is" : " notices are") + " still open. Please handle them."
: "All cookie notices handled. Thank you for your cooperation.";
$("contCookies").disabled = live > 0;
}
function spawnCookie() {
cookieSpawns++;
var el = document.createElement("div");
el.className = "cookie";
var w = Math.min(290, window.innerWidth - 32);
el.style.left = (16 + Math.random() * Math.max(0, window.innerWidth - w - 32)) + "px";
el.style.top = (16 + Math.random() * Math.max(0, window.innerHeight - 200)) + "px";
el.style.transform = "rotate(" + rnd(-2, 2).toFixed(2) + "deg)";
var p = document.createElement("p");
p.style.margin = "0";
p.textContent = COOKIE_TEXTS[Math.floor(Math.random() * COOKIE_TEXTS.length)];
var row = document.createElement("div");
row.className = "row";
var acc = document.createElement("button");
acc.type = "button";
acc.className = "acc";
acc.textContent = "Accept";
var dec = document.createElement("button");
dec.type = "button";
dec.textContent = "Decline";
acc.addEventListener("click", function () {
el.remove();
updateCookies();
});
dec.addEventListener("click", function () {
el.remove();
if (cookieSpawns < COOKIE_MAX) { spawnCookie(); spawnCookie(); }
updateCookies();
});
row.appendChild(acc);
row.appendChild(dec);
el.appendChild(p);
el.appendChild(row);
cookieLayer.appendChild(el);
}
enter[1] = function () {
cookieSpawns = 0;
demoDeclines = 0;
spawnCookie();
updateCookies();
};
$("contCookies").addEventListener("click", function () {
if (current === 1 && !this.disabled) go(2);
});
// ---------- scene 2: progress bar that slides back at 99 ----------
var prog = 0, progSlides = 0, sliding = false;
var SLIDE_MSGS = [
"Oops. Some progress was lost. Please wait.",
"We are reinstalling the progress. Thank you for waiting.",
"Your patience is nearly finished. Nearly."
];
function renderProg() {
$("fill").style.width = prog + "%";
$("pct").textContent = prog + "%";
}
function slideBack() {
prog = Math.round(rnd(55, 75));
progSlides++;
sliding = false;
$("progMsg").textContent = SLIDE_MSGS[Math.min(progSlides - 1, SLIDE_MSGS.length - 1)];
if (progSlides >= 3) $("finishBtn").hidden = false;
renderProg();
}
enter[2] = function () {
prog = 0;
progSlides = 0;
sliding = false;
$("finishBtn").hidden = true;
$("progMsg").textContent = "Starting...";
renderProg();
every(function () {
if (sliding) return;
prog += 1;
if (prog === 50) $("progMsg").textContent = "Halfway. Probably.";
if (prog === 80) $("progMsg").textContent = "Nearly there. We promise.";
if (prog >= 99) {
prog = 99;
sliding = true;
$("progMsg").textContent = "Almost there!";
later(slideBack, demo ? 300 : 1400);
}
renderProg();
}, demo ? 20 : 90);
};
$("finishBtn").addEventListener("click", function () {
if (current === 2 && !this.hidden) go(3);
});
// ---------- scene 3: 1px off text and crooked tidy things ----------
enter[3] = function () {
var tiles = document.querySelectorAll(".tidy > div");
for (var i = 0; i < tiles.length; i++) {
tiles[i].style.transform = "rotate(" + rnd(-2.5, 2.5).toFixed(2) + "deg) translateY(" + rnd(-3, 3).toFixed(1) + "px)";
}
var off = 1;
$("offText").style.transform = "translateX(1px)";
every(function () {
off = off === 1 ? 2 : 1;
$("offText").style.transform = "translateX(" + off + "px)";
}, 2200);
};
$("next3").addEventListener("click", function () {
if (current === 3) go(4);
});
// ---------- scene 4: Close spawns another Close ----------
var closesDone = 0;
var CLOSE_LIMIT = 6;
var MODAL_TEXTS = [
"This notice is important. Please close it.",
"Close this one. It is the same as the last one.",
"Notice: you have closed nothing yet.",
"This is another notice. Really, close it.",
"Hello again. Close me."
];
function spawnModal() {
var m = document.createElement("div");
m.className = "modal";
var w = Math.min(300, window.innerWidth - 32);
m.style.width = w + "px";
m.style.left = (16 + Math.random() * Math.max(0, window.innerWidth - w - 32)) + "px";
m.style.top = (16 + Math.random() * Math.max(0, window.innerHeight - 220)) + "px";
m.style.transform = "rotate(" + rnd(-3, 3).toFixed(1) + "deg)";
var p = document.createElement("p");
p.style.margin = "0 0 12px";
p.textContent = MODAL_TEXTS[closesDone % MODAL_TEXTS.length];
var b = document.createElement("button");
b.type = "button";
b.className = "big";
b.style.width = "100%";
b.textContent = closesDone >= 3 ? "Close (really)" : "Close";
b.addEventListener("click", function () {
m.remove();
closesDone++;
if (closesDone < CLOSE_LIMIT) spawnModal();
else later(function () { go(5); }, 500);
});
m.appendChild(p);
m.appendChild(b);
modalLayer.appendChild(m);
}
enter[4] = function () {
closesDone = 0;
spawnModal();
};
// ---------- scene 5: slider that slides back ----------
var sliderResets = 0;
var SLIDER_MSGS = [
"Not quite. Try again, slowly.",
"Oops, it slid back. Slowly, please.",
"Almost. The slider is very tired."
];
enter[5] = function () {
sliderResets = 0;
$("slider").value = 0;
$("sliderNext").hidden = true;
$("sliderMsg").textContent = "Slide all the way to the right.";
};
$("slider").addEventListener("input", function () {
var v = +this.value;
if (v < 99) return;
if (sliderResets < 3) {
sliderResets++;
this.value = 0;
$("sliderMsg").textContent = SLIDER_MSGS[sliderResets - 1];
} else {
this.value = 100;
$("sliderNext").hidden = false;
$("sliderMsg").textContent = "Verified. You are not a robot. Just very patient.";
}
});
$("sliderNext").addEventListener("click", function () {
if (current === 5) go(6);
});
// ---------- scene 6: final thanks ----------
enter[6] = function () {
$("stats").textContent = "Cookie notices seen: " + cookieSpawns +
". Progress bars that slid back: " + progSlides +
". Notices closed: " + closesDone +
". Slider resets: " + sliderResets + ".";
};
$("againBtn").addEventListener("click", function () { go(0); });
// ---------- hands-free demo (#demo) ----------
function demoSchedule(ms) {
clearTimeout(demoTimer);
demoTimer = setTimeout(demoTick, ms);
}
function demoTick() {
demoTimer = null;
if (!demo) return;
var wait = 700;
if (current === 0) {
$("startBtn").click();
} else if (current === 1) {
if (cookieLayer.children.length === 0) {
$("contCookies").click();
wait = 900;
} else if (demoDeclines < 2) {
demoDeclines++;
cookieLayer.querySelector("button:not(.acc)").click();
} else {
cookieLayer.querySelector(".acc").click();
wait = 500;
}
} else if (current === 2) {
if (!$("finishBtn").hidden) { $("finishBtn").click(); wait = 700; }
else { wait = 300; }
} else if (current === 3) {
$("next3").click();
wait = 1200;
} else if (current === 4) {
var mb = modalLayer.querySelector("button");
if (mb) { mb.click(); wait = 450; }
else { wait = 300; }
} else if (current === 5) {
if ($("sliderNext").hidden) {
var s = $("slider");
s.value = 100;
s.dispatchEvent(new Event("input", { bubbles: true }));
wait = 700;
} else {
$("sliderNext").click();
wait = 900;
}
} else if (current === 6) {
if (!finalHold) { finalHold = true; wait = 2500; }
else { finalHold = false; go(0); wait = 700; }
}
demoSchedule(wait);
}
function stopDemo() {
if (!demo) return;
demo = false;
clearTimeout(demoTimer);
demoTimer = null;
finalHold = false;
$("demoBanner").hidden = true;
go(0);
}
["pointerdown", "touchstart", "keydown"].forEach(function (type) {
window.addEventListener(type, function (e) {
if (demo && e.isTrusted) stopDemo();
}, true);
});
// ---------- start ----------
if (location.hash === "#demo") {
demo = true;
$("demoBanner").hidden = false;
go(0);
demoSchedule(800);
} else {
go(0);
}
})();
</script>
</body>
</html>
