step 1 is information only: no hours gate, every game open
Browse filesFiles changed (4)
- app.js+12-15
- data.json+8-36
- index.html+1-1
- style.css+1-2
60 unmodified lines6162636465666768697 unmodified lines77787980818283107 unmodified lines1911921931941951961971981992002012022032042052062072 unmodified lines21021121221321421521621721821960 unmodified linesif (!kinds.length) return {ok: false, message: msg("need_genre")};if (kinds.some(g => !genres[g])) return {ok: false, message: msg("need_hours_answer")};if (!modding) return {ok: false, message: msg("need_modding_answer")};const ok = kinds.filter(g => genres[g] !== "lt10" || D.makers.includes(modding));if (!ok.length) return {ok: false, message: msg("too_new")};return {ok: true, games: knownGames(ok), skipped: kinds.filter(g => !ok.includes(g))};}const videoSeconds = f => new Promise(res => { const v = document.createElement("video"); v.preload = "metadata";v.onloadedmetadata = () => { URL.revokeObjectURL(v.src); res(v.duration); }; v.onerror = () => res(NaN); v.src = URL.createObjectURL(f); });7 unmodified linesif (!/^https?:\/\/\S+$/.test(g.link)) errors.push(msg("new_link"));if (n < na || n > nb) errors.push(msg("new_modding_len", {a: na, b: nb, n})); else if (lowEffort(g.modding)) errors.push(msg("low_effort", {x: g.modding.slice(0, 44)}));if (!g.help) errors.push(msg("new_help")); }else if (!D.game_track[v.game]) errors.push(msg("game")); else if (!screenState.games.includes(v.game)) errors.push(msg("game_not_known"));if (v.mod_link && !/^https?:\/\/\S+$/.test(v.mod_link)) errors.push(msg("mod_link"));if (modFiles.length > L.mod_files) errors.push(msg("mod_files_max", {m: L.mod_files, n: modFiles.length}));for (const f of modFiles) { const k = kind(f.name);107 unmodified linesps.forEach(p => box.appendChild(pointRow(d, p))); }labelRows();}function fillGames(preferred) { // every game as a tile; the ones whose kind is not ticked with enough hours are lockedconst cur = preferred || radio("game"), open = screenState ? screenState.games : [];$("#game").innerHTML = [...D.game_ids].sort((a, b) => open.includes(b) - open.includes(a)).map(id => {const label = D.choices.games[lang].find(([, g]) => g === id)[0], m = label.match(/[((](.*)[))]/), ok = open.includes(id);const note = (m ? m[1] : "").replace(/^(open source|开源)[,,]\s*/, "");return `<label class="tile${ok ? "" : " locked"}"><input type="radio" name="game" value="${id}"${ok ? "" : " disabled"}${ok && cur === id ? " checked" : ""}>` +`<img src="data/games/${id}.jpg" alt="" loading="lazy"><div><b>${esc(D.game_short[lang][id])}</b><span>${esc(note)}</span>` +`<i>${ok ? (D.game_track[id] === "core" ? t("open_source") : "") : t("game_locked")}</i></div></label>`;}).join("") + `<label class="tile new"><input type="radio" name="game" value="${D.new_game}"${cur === D.new_game ? " checked" : ""}>` +`<span class="plus" aria-hidden="true">+</span><div><b>${t("game_new")}</b><span>${t("game_new_sub")}</span><i>${t("game_new_tag")}</i></div></label>`;$("#game_locked_info").hidden = open.length === D.game_ids.length; showNew();}const showNew = () => { $("#newgame").hidden = radio("game") !== D.new_game; };const showMod = () => { $("#modbox").hidden = !isMaker(); };2 unmodified lines$$("#mod_filelist button").forEach(b => b.onclick = () => { modFiles.splice(+b.dataset.i, 1); renderModFiles(); stale(); });}function showVerdict() {const g = genreHours(), s = screen(g, radio("modding")), label = Object.fromEntries(D.choices.genres[lang].map(([l, id]) => [id, l.split(" → ")[0]]));$("#verdict").innerHTML = !s.ok ? `${rich(t("v_no"))}${esc(s.message)}`: rich(("other" in g && !s.skipped.includes("other") ? t("v_ok_other") : t("v_ok", {games: s.games.map(x => D.game_short[lang][x]).join(", ")})) +(s.skipped.length ? t("v_skipped", {kinds: s.skipped.map(k => label[k]).join(", ")}) : ""));$("#verdict").className = "verdict " + (s.ok ? "ok" : "wait"); return s;}function renderFiles() {60 unmodified lines61626364656667687 unmodified lines76777879808182107 unmodified lines1901911921931941951961971981992002012022032042052062 unmodified lines20921021121221321421521660 unmodified linesif (!kinds.length) return {ok: false, message: msg("need_genre")};if (kinds.some(g => !genres[g])) return {ok: false, message: msg("need_hours_answer")};if (!modding) return {ok: false, message: msg("need_modding_answer")};const first = knownGames(kinds); // nobody is turned away: every game is open, those of the ticked kinds firstreturn {ok: true, games: [...first, ...D.game_ids.filter(id => !first.includes(id))]};}const videoSeconds = f => new Promise(res => { const v = document.createElement("video"); v.preload = "metadata";v.onloadedmetadata = () => { URL.revokeObjectURL(v.src); res(v.duration); }; v.onerror = () => res(NaN); v.src = URL.createObjectURL(f); });7 unmodified linesif (!/^https?:\/\/\S+$/.test(g.link)) errors.push(msg("new_link"));if (n < na || n > nb) errors.push(msg("new_modding_len", {a: na, b: nb, n})); else if (lowEffort(g.modding)) errors.push(msg("low_effort", {x: g.modding.slice(0, 44)}));if (!g.help) errors.push(msg("new_help")); }else if (!D.game_track[v.game]) errors.push(msg("game"));;if (v.mod_link && !/^https?:\/\/\S+$/.test(v.mod_link)) errors.push(msg("mod_link"));if (modFiles.length > L.mod_files) errors.push(msg("mod_files_max", {m: L.mod_files, n: modFiles.length}));for (const f of modFiles) { const k = kind(f.name);107 unmodified linesps.forEach(p => box.appendChild(pointRow(d, p))); }labelRows();}function fillGames(preferred) { // every game as a tile, the games of the ticked kinds firstconst cur = preferred || radio("game"), order = screenState ? screenState.games : D.game_ids;$("#game").innerHTML = order.map(id => {const label = D.choices.games[lang].find(([, g]) => g === id)[0], m = label.match(/[((](.*)[))]/);const note = (m ? m[1] : "").replace(/^(open source|开源)[,,]\s*/, "");return `<label class="tile"><input type="radio" name="game" value="${id}"${cur === id ? " checked" : ""}>` +`<img src="data/games/${id}.jpg" alt="" loading="lazy"><div><b>${esc(D.game_short[lang][id])}</b><span>${esc(note)}</span>` +`<i>${D.game_track[id] === "core" ? t("open_source") : ""}</i></div></label>`;}).join("") + `<label class="tile new"><input type="radio" name="game" value="${D.new_game}"${cur === D.new_game ? " checked" : ""}>` +`<span class="plus" aria-hidden="true">+</span><div><b>${t("game_new")}</b><span>${t("game_new_sub")}</span><i>${t("game_new_tag")}</i></div></label>`;showNew();}const showNew = () => { $("#newgame").hidden = radio("game") !== D.new_game; };const showMod = () => { $("#modbox").hidden = !isMaker(); };2 unmodified lines$$("#mod_filelist button").forEach(b => b.onclick = () => { modFiles.splice(+b.dataset.i, 1); renderModFiles(); stale(); });}function showVerdict() {const s = screen(genreHours(), radio("modding"));$("#verdict").innerHTML = s.ok ? rich(t("v_ok")) : esc(s.message);$("#verdict").className = "verdict " + (s.ok ? "ok" : "wait"); return s;}function renderFiles() {
120 unmodified lines12112212312412512612712824 unmodified lines15315415515615715815916015 unmodified lines17617717817918018118218318418518618718818919019119219319419519611 unmodified lines208209210211212213214215216217218219220221376 unmodified lines5985996006016026036046056066076086096107 unmodified lines618619620621622623624625626627120 unmodified lines"关于你"],"s1_sub": ["A few quick questions, so we can offer you the right games.","几个小问题,方便我们给你列出合适的游戏。"],"q_genres": ["Which of these kinds of games do you know well? (select all that apply)",24 unmodified lines"勾选的每一类,你大约各玩了多少小时?"],"q_hours_info": ["A rough figure is fine; Steam shows your hours on each game's library page. You can set a challenge for a kind you have played for 10 hours or more.","大概的数字就行,Steam 库里每款游戏都显示游玩时间。玩过 10 小时以上的类型才能出题。"],"q_hours_none": ["Tick a kind above first.",15 unmodified lines"Continue","继续"],"v_skipped": [" Left out for now (under 10 hours): {kinds}.","暂时没有列入(不到 10 小时):{kinds}。"],"v_ok": ["**Great, thank you!** Next, pick your game below. Open to you: {games}.","**太好了,谢谢你!** 接下来请在下面选游戏。你可以选:{games}。"],"v_ok_other": ["**Great, thank you!** Next, pick your game below. You chose “Other”, so every game is open: pick the one closest to what you know.","**太好了,谢谢你!** 接下来请在下面选游戏。你选了“其他”,所以全部游戏都可以选,挑一款和你熟悉的最接近的。"],"v_no": ["**Thank you for your interest.** ","**谢谢你的关注。** "],"s2": ["Your challenge",11 unmodified lines"Pick this first: everything else you write is about this game.","请先选这一项:后面填的内容都围绕这款游戏。"],"game_locked": ["Locked","未解锁"],"game_locked_info": ["Greyed-out games need their kind ticked in step 1 with 10 hours or more. Change it there and they unlock at once.","灰色的游戏需要在第 1 步勾选对应类型,并且玩过 10 小时以上。回到第 1 步改一下,这里会立刻解锁。"],"game_none": ["Please pick a game first.","请先选一款游戏。"376 unmodified lines"One more thing: the question about mods.","还差一题:关于 mod 的那一题。"],"too_new": ["We are really glad you want to help. Writing a task leans on knowing a game's main systems well, which usually takes around 10 hours of play, so this may be a little early. Please come back after some more time with the game: we would love to see your idea then.","很高兴你愿意参与。出题需要比较熟悉一款游戏的主要系统,通常要玩上 10 小时左右,所以现在可能稍早了一点。欢迎多玩一阵再回来,我们很期待到时看到你的想法。"],"screen_first": ["Please answer the questions in step 1 first (at least one kind of game with 10 hours or more).","请先回答第 1 步的问题(至少有一类游戏玩过 10 小时以上)。"],"nickname": ["Enter the name to credit (1–40 characters).",7 unmodified lines"Pick the game the AI should build in.","请选想让 AI 在哪款游戏里做。"],"game_not_known": ["This game is locked: its kind is not ticked in step 1 with 10 hours or more. Change it there, or pick another game.","这款游戏还没解锁:第 1 步里没有勾选它的类型,或不到 10 小时。回到第 1 步改一下,或者换一款游戏。"],"category": ["Choose what the AI should mainly recreate (a place, rules or a story).","请选主要想让 AI 还原什么(地方、规则或故事)。"120 unmodified lines12112212312412512612712824 unmodified lines15315415515615715815916015 unmodified lines17617717817918018118218318411 unmodified lines196197198199200201376 unmodified lines5785795805815825835845855867 unmodified lines594595596597598599120 unmodified lines"关于你"],"s1_sub": ["A few quick questions, so we know who is taking part. Whatever you answer, you can go on.","几个小问题,只是想了解一下参与的朋友。怎么答都可以继续。"],"q_genres": ["Which of these kinds of games do you know well? (select all that apply)",24 unmodified lines"勾选的每一类,你大约各玩了多少小时?"],"q_hours_info": ["A rough figure is fine; Steam shows your hours on each game's library page.","大概的数字就行,Steam 库里每款游戏都显示游玩时间。"],"q_hours_none": ["Tick a kind above first.",15 unmodified lines"Continue","继续"],"v_ok": ["**Great, thank you!** Next, pick your game below. The games of the kinds you ticked come first; every game is open.","**太好了,谢谢你!** 接下来请在下面选游戏。你勾选的类型对应的游戏排在前面,所有游戏都可以选。"],"s2": ["Your challenge",11 unmodified lines"Pick this first: everything else you write is about this game.","请先选这一项:后面填的内容都围绕这款游戏。"],"game_none": ["Please pick a game first.","请先选一款游戏。"376 unmodified lines"One more thing: the question about mods.","还差一题:关于 mod 的那一题。"],"screen_first": ["Please answer the questions in step 1 first.","请先回答第 1 步的问题。"],"nickname": ["Enter the name to credit (1–40 characters).",7 unmodified lines"Pick the game the AI should build in.","请选想让 AI 在哪款游戏里做。"],"category": ["Choose what the AI should mainly recreate (a place, rules or a story).","请选主要想让 AI 还原什么(地方、规则或故事)。"
92 unmodified lines9394959697989992 unmodified lines<section class="panel" id="sec_game"><h3 class="sec"><span data-t="nav2"></span></h3><fieldset><legend data-t="game"></legend><p class="info" data-t="game_info"></p><div id="game" class="tiles"></div><p class="info lockinfo" id="game_locked_info" data-t="game_locked_info"></p></fieldset><fieldset id="newgame" class="sub" hidden><legend data-t="new_title"></legend><p class="info" data-t="new_info"></p><div class="row"><div class="grow"><label class="q" for="new_name" data-t="new_name"></label><input id="new_name" type="text" maxlength="60" data-ph="new_name_ph"></div>92 unmodified lines9394959697989992 unmodified lines<section class="panel" id="sec_game"><h3 class="sec"><span data-t="nav2"></span></h3><fieldset><legend data-t="game"></legend><p class="info" data-t="game_info"></p><div id="game" class="tiles"></div></fieldset><fieldset id="newgame" class="sub" hidden><legend data-t="new_title"></legend><p class="info" data-t="new_info"></p><div class="row"><div class="grow"><label class="q" for="new_name" data-t="new_name"></label><input id="new_name" type="text" maxlength="60" data-ph="new_name_ph"></div>
169 unmodified lines170171172173174175176177178179180181182183169 unmodified lines.tile img, .tile .plus { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface); }.tile .plus { display: grid; place-items: center; font: 400 44px/1 var(--pixel); color: var(--accent); background: var(--accent-soft); }.tile div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; flex: 1; }.tile:hover:not(.locked) { border-color: var(--accent-mid); }.tile input { position: absolute; opacity: 0; } .tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }.tile:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }.tile:has(input:checked)::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; }.tile b { font-size: 15px; line-height: 1.25; } .tile span { font-size: 13px; color: var(--muted); line-height: 1.35; }.tile i { margin-top: auto; padding-top: 4px; font: 600 11px/1 var(--sans); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--good); min-height: 15px; }.tile.locked { cursor: not-allowed; border-style: dashed; } .tile.locked img { filter: grayscale(1); opacity: .45; } .tile.locked div { opacity: .6; } .tile.locked i { color: var(--dim); }.tile.new i { color: var(--accent); }.lockinfo { margin: 10px 0 0; }.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }169 unmodified lines170171172173174175176177178179180181182169 unmodified lines.tile img, .tile .plus { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface); }.tile .plus { display: grid; place-items: center; font: 400 44px/1 var(--pixel); color: var(--accent); background: var(--accent-soft); }.tile div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; flex: 1; }.tile:hover { border-color: var(--accent-mid); }.tile input { position: absolute; opacity: 0; } .tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }.tile:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }.tile:has(input:checked)::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; }.tile b { font-size: 15px; line-height: 1.25; } .tile span { font-size: 13px; color: var(--muted); line-height: 1.35; }.tile i { margin-top: auto; padding-top: 4px; font: 600 11px/1 var(--sans); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--good); min-height: 15px; }.tile.new i { color: var(--accent); }.lockinfo { margin: 10px 0 0; }.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
app.js+12-15
data.json+8-36
index.html+1-1
style.css+1-2