anim-user-study / static /index.html
Kakituken's picture
IDs become taken 30 min after finishing
7f33d0b verified
Raw History Blame Contribute Delete
2.85 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Animation User Study</title>
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<div class="wrap narrow">
<h1>3D Animation User Study</h1>
<p class="muted">About 10 minutes · 22 questions in two parts</p>
<div class="card" style="margin-top:18px">
<p>Thank you for taking part. You will watch short 3D animations, each generated from a text prompt, and judge them.</p>
<ol class="steps">
<li><b>Part 1 (12 questions)</b>: five animations of the same prompt. Rank them from best to worst, considering how well they follow the prompt and how natural the motion looks.</li>
<li><b>Part 2 (10 questions)</b>: two animations of the same prompt. Choose the one with better motion quality, or "No noticeable difference".</li>
</ol>
<p class="muted">Videos loop automatically; click a video to enlarge it. Your progress is saved after every answer, so you can close the page and come back with the same ID. Please pick an ID nobody else uses; an ID becomes unavailable 30 minutes after its survey is finished.</p>
<form id="f" style="margin-top:18px">
<label for="pid"><b>Your participant ID</b> <span class="muted">(1–5 letters or digits)</span></label>
<div style="display:flex; gap:10px; margin-top:8px">
<input class="id" id="pid" maxlength="5" autocomplete="off" autocapitalize="characters" spellcheck="false" required>
<button class="btn primary" type="submit">Start</button>
</div>
<div class="err" id="err"></div>
</form>
</div>
</div>
<script>
const f = document.getElementById("f"), inp = document.getElementById("pid"), err = document.getElementById("err");
try { const last = localStorage.getItem("us_pid"); if (last) inp.value = last; } catch (e) {}
const TAKEN_MSG = id => `The ID "${id.toUpperCase()}" is already taken. Please choose a different ID.`;
const qp = new URLSearchParams(location.search).get("taken");
if (qp) { err.textContent = TAKEN_MSG(qp); inp.value = ""; }
f.addEventListener("submit", async ev => {
ev.preventDefault();
const v = inp.value.trim();
if (!/^[A-Za-z0-9]{1,5}$/.test(v)) { err.textContent = "Please enter 1–5 letters or digits."; return; }
err.textContent = "";
try {
const r = await fetch("/api/check", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ pid: v }) });
const j = await r.json();
if (j.status === "taken") { err.textContent = TAKEN_MSG(v); inp.select(); return; }
} catch (e) { /* server check failed: /api/start will still refuse a taken ID */ }
try { localStorage.setItem("us_pid", v); } catch (e) {}
location.href = "/survey?pid=" + encodeURIComponent(v);
});
</script>
</body>
</html>