Spaces:
Running
Running
Download index.html from GameAnything/GameAnything-Trial: direct link, hf CLI and curl.
- Browser
- Download file 35.2 kB
-
https://huggingface.co/spaces/GameAnything/GameAnything-Trial/resolve/main/index.html
- Command line
-
hf download hf://spaces/GameAnything/GameAnything-Trial/index.html
-
curl -L -o index.html https://huggingface.co/spaces/GameAnything/GameAnything-Trial/resolve/main/index.html
35.2 kB
| <html lang="zh-CN"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"> | |
| <style>body{margin:0}[hidden]{display:none}img,video{max-width:100%}</style> | |
| <title>GameAnything Trial Sign-up</title> | |
| <meta name="claude:viewport-fit-sides" content="cover"> | |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Jersey+25&family=Source+Code+Pro:wght@500&family=Source+Sans+3:wght@400..700&family=Source+Serif+4:opsz,wght@8..60,600..700&family=Noto+Sans+SC:wght@400;500;700&family=Noto+Serif+SC:wght@600;700&display=swap"> | |
| <style> | |
| /* Layout: hero with the pitch and a swipeable strip of real demo cases (reference -> in-game), then the form as four steps in one card with a progress rail. */ | |
| :root{ | |
| /* palette and type of the GameAnything project page (from the paper): violet #5b3a9e, indigo #5a66a2, lavender tints, ink #111418, white ground */ | |
| color-scheme:light; | |
| --bg:#ffffff; --card:#f7f5fc; --ink:#111418; --muted:#5b6470; --line:#e2ddf0; --chip:#ece7f7; | |
| --accent:#5b3a9e; --accent-ink:#ffffff; --accent-soft:#ece7f7; --sky:#5a66a2; --ok:#2e7d4f; --err:#c23a3a; | |
| --bar:linear-gradient(90deg,#5a66a2,#5b3a9e); | |
| --disp:"Source Serif 4","Noto Serif SC","Songti SC",Georgia,serif; | |
| --pixel:"Jersey 25","Source Sans 3","Noto Sans SC",system-ui,sans-serif; | |
| --body:"Source Sans 3","Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif; | |
| --mono:"Source Code Pro",ui-monospace,Menlo,monospace; | |
| } | |
| *{box-sizing:border-box} | |
| body{background:var(--bg);color:var(--ink);font:15px/1.65 var(--body);padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:20px 56px} | |
| .wrap{max-width:760px;margin:0 auto;display:flex;flex-direction:column;gap:22px} | |
| .top{display:flex;justify-content:space-between;align-items:center;gap:12px} | |
| .brand{font:400 26px/1 var(--pixel);color:var(--accent);display:flex;align-items:center;gap:8px} | |
| .brand i{display:none} | |
| .lang{display:flex;border:1px solid var(--line);border-radius:999px;overflow:hidden} | |
| .lang button{border:0;background:transparent;color:var(--muted);font:500 13px var(--body);padding:5px 12px;cursor:pointer} | |
| .lang button[aria-pressed="true"]{background:var(--ink);color:var(--bg)} | |
| /* hero */ | |
| .hero{display:flex;flex-direction:column;gap:18px} | |
| .hero h1{font:700 clamp(28px,5.2vw,44px)/1.12 var(--disp);letter-spacing:-.018em;margin:0 0 12px;text-wrap:balance} | |
| .hero h1 em{font:400 1.12em/1 var(--pixel);font-style:normal;color:var(--accent)} | |
| .hero p{margin:0;color:var(--muted);max-width:44ch} | |
| .perks{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px} | |
| .perk{font:500 12.5px var(--body);background:var(--chip);border-radius:999px;padding:4px 11px} | |
| .perk b{color:var(--accent);font-weight:700} | |
| .wall{position:relative;border-radius:20px;overflow:hidden;min-height:340px;display:flex;align-items:flex-end;background:var(--card)} | |
| .wall video,.wall img.poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover} | |
| .wall::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.05) 0%,rgba(255,255,255,.72) 42%,rgba(255,255,255,.95) 100%)} | |
| .wall .over{position:relative;z-index:1;padding:clamp(18px,4vw,34px);color:var(--ink);display:flex;flex-direction:column;gap:12px} | |
| .wall h1{color:var(--ink);margin:0} | |
| .wall h1 em{color:var(--accent)} | |
| .wall p{color:#2c333c;margin:0;max-width:56ch} | |
| .wall .perk{background:var(--accent-soft);color:var(--ink);border:1px solid #cbc0e8} | |
| .wall .perk b{color:var(--accent)} | |
| .wall .tag{align-self:flex-start;font:600 12.5px var(--body);letter-spacing:.1em;color:var(--accent);text-transform:uppercase;background:rgba(255,255,255,.92);border-radius:4px;padding:2px 8px} | |
| .galhead{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap} | |
| .galhead b{font:700 16px var(--disp)} | |
| .galhead small{font:500 12px var(--mono);color:var(--muted)} | |
| .gal{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px} | |
| .case{margin:0;display:flex;flex-direction:column;gap:6px;min-width:0;cursor:pointer} | |
| .shot{position:relative;border-radius:12px;overflow:hidden;aspect-ratio:16/9;background:var(--chip);max-width:100%} | |
| .shot img,.shot video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block} | |
| .shot video{opacity:0;transition:opacity .2s}.case.on .shot video{opacity:1} | |
| .shot .mod{position:absolute;top:8px;left:8px;font:700 10.5px var(--body);background:rgba(0,0,0,.62);color:#fff;border-radius:4px;padding:1px 7px} | |
| .case figcaption{font-size:13px;line-height:1.4} | |
| .case figcaption b{display:block;font-weight:700} | |
| .case figcaption span{color:var(--muted);font-size:12.5px} | |
| @media (max-width:720px){.gal{grid-template-columns:repeat(2,minmax(0,1fr))}} | |
| @media (max-width:420px){.wall{min-height:300px}} | |
| /* card */ | |
| .card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:22px clamp(16px,4vw,32px) 26px} | |
| .rail{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:6px} | |
| .rail button{all:unset;display:block;height:6px;border-radius:3px;background:var(--line);transition:background .25s,transform .15s;padding-block:7px;background-clip:content-box;cursor:default} | |
| .rail button.on{background-color:var(--accent);background-clip:content-box} | |
| .rail button.go{cursor:pointer}.rail button.go:hover{transform:scaleY(1.6)} | |
| .rail button:focus-visible{outline:2px solid var(--sky);outline-offset:2px} | |
| .stepname{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:6px} | |
| .stepname h2{font:700 20px/1.3 var(--disp);margin:0} | |
| .stepname small{font:500 12px var(--mono);color:var(--muted);letter-spacing:.04em} | |
| .lead{color:var(--muted);font-size:13.5px;margin:0 0 6px} | |
| .q{display:flex;flex-direction:column;gap:8px;padding:18px 0;border-top:1px solid var(--line)} | |
| .q:first-of-type{border-top:0} | |
| .q label.t,.q .t{font-weight:700;font-size:15px} | |
| .q .req{color:var(--accent)} | |
| .q .hint{font-size:12.5px;color:var(--muted);margin-top:-4px} | |
| .q.star{background:var(--accent-soft);border-radius:12px;padding:16px;border-top:0;margin-top:8px} | |
| .badge{display:inline-block;font:700 11px var(--body);background:var(--accent);color:var(--accent-ink);border-radius:4px;padding:1px 7px;margin-left:6px;vertical-align:2px} | |
| .opts{display:flex;flex-wrap:wrap;gap:8px} | |
| .opt{position:relative} | |
| .opt input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer} | |
| .opt span{display:inline-block;border:1.5px solid var(--line);border-radius:10px;padding:7px 12px;font-size:13.5px;background:var(--card);transition:border-color .15s,background .15s;cursor:pointer} | |
| .opt input:checked+span{border-color:var(--accent);background:var(--accent-soft);font-weight:500} | |
| .opt input:focus-visible+span{outline:2px solid var(--sky);outline-offset:2px} | |
| .opts.col{flex-direction:column}.opts.col .opt span{display:block} | |
| input[type=text],input[type=email],input[type=url],textarea,select{width:100%;font:14.5px var(--body);color:var(--ink);background:var(--bg);border:1.5px solid var(--line);border-radius:10px;padding:9px 12px} | |
| textarea{min-height:110px;resize:vertical} | |
| input:focus,textarea:focus{outline:none;border-color:var(--sky)} | |
| .games3{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:8px} | |
| .count{font:500 12px var(--mono);color:var(--muted);text-align:right} | |
| .err{color:var(--err);font-size:12.5px} | |
| .q.bad .opt span,.q.bad input,.q.bad textarea{border-color:var(--err)} | |
| .nav{display:flex;justify-content:space-between;gap:10px;margin-top:18px} | |
| .btn{font:700 15px var(--body);border-radius:12px;padding:11px 22px;cursor:pointer;border:1.5px solid var(--line);background:transparent;color:var(--ink)} | |
| .btn.go{background:var(--bar);border-color:transparent;color:var(--accent-ink)} | |
| .btn:focus-visible{outline:2px solid var(--sky);outline-offset:2px} | |
| .fast{display:flex;gap:12px;align-items:flex-start;background:var(--chip);border-radius:12px;padding:12px 14px;font-size:13.5px} | |
| .fast b{color:var(--sky)} | |
| .done{text-align:center;padding:24px 0} | |
| .done h2{font:800 28px var(--disp);margin:8px 0} | |
| .done p{color:var(--muted);margin:0 auto;max-width:46ch} | |
| .foot{font-size:12px;color:var(--muted);text-align:center} | |
| @media (prefers-reduced-motion:reduce){*{transition:none}} | |
| </style> | |
| </head> | |
| <body> | |
| <div class="wrap"> | |
| <div class="top"> | |
| <div class="brand"><i></i>GameAnything</div> | |
| <div class="lang" role="group" aria-label="Language"> | |
| <button type="button" id="lzh" aria-pressed="true">中文</button><button type="button" id="len" aria-pressed="false">English</button> | |
| </div> | |
| </div> | |
| <section class="hero"> | |
| <div class="wall"> | |
| <img class="poster" src="media/wall.jpg" alt=""> | |
| <video id="wallv" src="media/wall.mp4" poster="media/wall.jpg" muted loop playsinline autoplay preload="auto" aria-hidden="true"></video> | |
| <div class="over"> | |
| <span class="tag" id="walltag"></span> | |
| <h1 id="h1"></h1> | |
| <p id="intro"></p> | |
| <div class="perks" id="perks"></div> | |
| </div> | |
| </div> | |
| <div class="galhead"><b id="galt"></b><small id="galh"></small></div> | |
| <div class="gal" id="gal"></div> | |
| </section> | |
| <form class="card" id="form" novalidate> | |
| <div class="rail" id="rail"><button type="button" data-s="0"></button><button type="button" data-s="1"></button><button type="button" data-s="2"></button><button type="button" data-s="3"></button></div> | |
| <div class="stepname"><h2 id="stitle"></h2><small id="scount"></small></div> | |
| <p class="lead" id="slead"></p> | |
| <div id="qs"></div> | |
| <input type="text" id="website" name="website" tabindex="-1" autocomplete="off" aria-hidden="true" style="position:absolute;left:-9999px;width:1px;height:1px;opacity:0"> | |
| <p class="err" id="senderr" hidden></p> | |
| <div class="nav"><button type="button" class="btn" id="back"></button><button type="submit" class="btn go" id="next"></button></div> | |
| </form> | |
| <p class="foot" id="foot"></p> | |
| </div> | |
| <script> | |
| const L = { | |
| zh:{h1:'把一段视频、几张图或一段文字,<em>做进你最熟的游戏</em>', | |
| intro:'给 AI 一段视频、几张图或一段文字,它会把里面的内容做成你熟悉的游戏里能玩的 mod。现在招募第一批体验者,特别欢迎在一款游戏里泡了几百小时的老玩家,以及自己做过 mod、地图或关卡的创作者。', | |
| perks:['约 <b>3 分钟</b>','入选可<b>免费</b>体验','有作品链接?<b>直接贴</b>就行'], | |
| back:'上一步',next:'下一步',submit:'提交报名',sending:'提交中…',sendFail:'没提交成功,请稍后再试。你的回答还在,不用重填。',rate:'提交太频繁了,请过一会儿再试。',req:'这题需要回答',email:'请填一个有效的邮箱', | |
| foot:'你填的内容只用于这次招募和研究统计,不会公开,也不会转给第三方。', | |
| done:'报名收到了!',doneP:'我们会看完所有报名,入选的话会通过你留的邮箱联系你。也欢迎把这个页面转给身边会玩、会做 mod 的朋友。', | |
| fast:'<b>已经有作品?</b>把链接贴在第 2 步,后面的题可以写得很简单,我们会优先看作品。', | |
| steps:[['你玩什么','你熟悉的游戏和玩得多深'],['你做过什么','mod、地图、关卡或演示视频'],['你想做什么','这是我们最看重的一步'],['怎么联系你','最后一步']], | |
| other:'其他(请填写)', otherWhere:'在哪里看到的?(选填)', hours:'小时', game:'游戏名', words:'字', galt:'精选作品', galh:'鼠标移上去或点一下播放', walltag:'上面每一格都是 AI 做出来的 mod'}, | |
| en:{h1:'Turn a video, a few images or a text <em>into the game you know best</em>', | |
| intro:'Give the AI a video, a few images or a piece of text, and it builds what is in it into a game you already know, as a mod you can play. We are looking for our first testers, especially players who have spent hundreds of hours in one game and people who have made their own mods, maps or levels.', | |
| perks:['About <b>3 minutes</b>','<b>Free</b> trial if selected','Have a link to your work? <b>Just paste it</b>'], | |
| back:'Back',next:'Next',submit:'Sign up',sending:'Sending…',sendFail:'That did not go through. Please try again in a moment; your answers are kept.',rate:'Too many tries. Please wait a while and try again.',req:'Please answer this one',email:'Please enter a valid email address', | |
| foot:'Your answers are used only for this selection and for research statistics. They are not published or passed to anyone else.', | |
| done:'You are signed up!',doneP:'We will read every sign-up and contact selected people by email. Feel free to pass this page to friends who play deep or make mods.', | |
| fast:'<b>Already made something?</b> Paste the link in step 2 and keep the other answers short. We look at the work first.', | |
| steps:[['What you play','The games you know and how deep you go'],['What you have made','Mods, maps, levels or demo videos'],['What you would make','The answer we weigh most'],['How to reach you','Last step']], | |
| other:'Other (please name)', otherWhere:'Where did you see it? (optional)', hours:'hours', game:'Game', words:'words', galt:'Featured builds', galh:'Hover or tap to play', walltag:'Every tile above is a mod built by the AI'} | |
| }; | |
| const DEMO = [ | |
| {id:'p09e2febf', t:['圣米歇尔山','Mont-Saint-Michel'], game:'Minecraft', m:1, d:['几张照片 → 一座潮间带上的修道院小岛','A few photos become the tidal abbey island']}, | |
| {id:'p648efc54', t:['2026 米兰冬奥冰球','Milano Cortina 2026 ice hockey'], game:'Minecraft', m:0, d:['比赛视频 → 能打的冰球赛,有记分牌和节次','A match video becomes a playable game with a scoreboard and periods']}, | |
| {id:'p52b0b528', t:['阿布辛贝神庙','Abu Simbel'], game:'VoxeLibre', m:2, d:['一段文字描述 → 尼罗河边的四座巨像','A written description becomes the four colossi on the Nile']}, | |
| {id:'p3cbc2113', t:['卡帕多奇亚的清晨','Cappadocia dawn'], game:'VoxeLibre', m:0, d:['航拍视频 → 满天热气球的岩石山谷','Drone footage becomes a rock valley full of balloons']}, | |
| {id:'p777c8c31', t:['北京:老城与新天际线','Beijing old city and new skyline'], game:'VoxeLibre', m:0, d:['城市视频 → 中轴线宫殿和背后的高楼','City footage becomes the palace axis and the towers behind it']}, | |
| {id:'p8d1a7217', t:['物料传送线','Material handling line'], game:'VoxeLibre', m:1, d:['几张工厂照片 → 会自己运转的分拣线','Factory photos become a sorting line that runs by itself']}, | |
| ]; | |
| const MODS = [['视频','Video'],['图片','Images'],['文字','Text']]; | |
| // question spec: id, step, type, required, zh/en text, options [[zh,en],...] | |
| const Q = [ | |
| {id:'genres',s:0,type:'multi',req:1,other:1,t:['你熟悉哪些类型的游戏?','Which kinds of games do you know well?'],h:['可多选','Select all that apply'],o:[ | |
| ['方块沙盒(我的世界等)','Voxel sandbox (Minecraft etc.)'],['农场、生活模拟(星露谷物语等)','Farming and life sim (Stardew Valley etc.)'],['2D 沙盒冒险(泰拉瑞亚等)','2D sandbox adventure (Terraria etc.)'],['3D 生存探索(英灵神殿等)','3D survival (Valheim etc.)'],['城市建造(城市:天际线等)','City builder (Cities: Skylines etc.)'],['经营、生产链(纪元、异星工厂等)','Settlement and factory builders (Anno, Factorio etc.)'],['竞速(马里奥赛车等)','Kart and arcade racing (Mario Kart etc.)'],['平台跳跃(马里奥、蔚蓝等)','Platformer (Mario, Celeste etc.)'],['捉怪养成 RPG(宝可梦等)','Creature-collecting RPG (Pokémon etc.)'],['动作 RPG(暗黑破坏神等)','Action RPG (Diablo etc.)'],['射击','Shooter'],['战棋、回合策略(火焰纹章、文明等)','Turn-based strategy (Fire Emblem, Civilization etc.)'],['即时战略(星际争霸、帝国时代等)','Real-time strategy (StarCraft, Age of Empires etc.)']]}, | |
| {id:'top3',s:0,type:'top3',req:1,t:['玩得最多的三款游戏,各玩了多久?','Your three most-played games, with rough hours'],h:['Steam 库里每款游戏都显示游玩时间。至少填一款','Steam shows hours on each game\'s page. Fill in at least one']}, | |
| {id:'deeds',s:0,type:'multi',req:1,t:['这些事你做过哪些?','Which of these have you done?'],h:['可多选','Select all that apply'],o:[ | |
| ['打完过一款游戏的主要内容','Finished the main content of a game'],['全成就或接近 100% 完成度','All achievements or close to 100%'],['写过攻略、wiki 或做过游戏视频','Written a guide or wiki entry, or made game videos'],['高段位、比赛或速通','High-tier ranked, tournaments or speedruns'],['参加过游戏测试','Taken part in a game test (beta, early access)'],['管理过游戏社区','Moderated or run a game community'],['以上都没有','None of these']]}, | |
| {id:'profile',s:0,type:'url',t:['游戏主页链接','A link to your gaming profile'],h:['选填。Steam、小黑盒、B 站等,帮我们核实经历','Optional. Steam, YouTube, Bilibili etc.']}, | |
| {id:'modlevel',s:1,type:'single',req:1,t:['你在 mod 方面走到了哪一步?','How far does your experience with mods go?'],h:['选符合的最高一项','Pick the highest that applies'],o:[ | |
| ['没用过 mod','Never used mods'],['装过、玩过 mod 或自定义地图','Installed and played mods or custom maps'],['改过别人的 mod(参数、整合包、材质)','Edited someone else\'s mod (settings, modpacks, textures)'],['自己做过 mod、地图或关卡','Made my own mod, map or level'],['发布过,并且有人下载或订阅','Published one that people downloaded']]}, | |
| {id:'works',s:1,type:'text',req:1,maker:1,t:['给哪些游戏做过什么?','Which games did you make things for, and what?'],h:['一两句话就行。例:我的世界,一个加了十几种机器的科技 mod','A sentence or two. Example: Minecraft, a tech mod that adds a dozen machines']}, | |
| {id:'tools',s:1,type:'multi',maker:1,other:1,t:['做的时候用过什么?','What did you use to make them?'],h:['可多选','Select all that apply'],o:[ | |
| ['游戏自带编辑器','The game\'s own editor'],['配置文件、数据包(JSON、XML 等)','Config or data files (JSON, XML etc.)'],['脚本(Lua、Python、GDScript 等)','Scripting (Lua, Python, GDScript etc.)'],['编程 + mod 框架(Fabric、BepInEx、SMAPI 等)','Code with a mod framework (Fabric, BepInEx, SMAPI etc.)'],['美术工具(像素画、Blender)','Art tools (pixel art, Blender)'],['AI 写代码或做素材','AI tools for code or assets']]}, | |
| {id:'downloads',s:1,type:'single',maker:1,t:['最受欢迎的作品大约有多少下载或订阅?','Downloads or subscribers of your most popular work'],o:[['没发布过','Never published'],['不到 100','Under 100'],['100–1000','100–1,000'],['1000–1 万','1,000–10,000'],['1 万以上','Over 10,000']]}, | |
| {id:'links',s:1,type:'links',t:['作品或演示链接','Links to your work or a demo'],h:['发布过的请务必填写。创意工坊、CurseForge、Modrinth、MC百科、Nexus、GitHub,或一段演示视频都可以','Required if you have published. Steam Workshop, CurseForge, Modrinth, Nexus, GitHub or a demo video']}, | |
| {id:'code',s:1,type:'single',req:1,t:['你会写代码吗?','Can you write code?'],o:[['完全不会','Not at all'],['能看懂、改现成脚本','I can read and tweak scripts'],['能自己写小程序','I can write small programs'],['以编程为工作或专业','I program for work or study']]}, | |
| {id:'ai',s:1,type:'single',req:1,t:['你用 AI 工具到什么程度?','How much do you use AI tools?'],h:['ChatGPT、Claude、豆包、Cursor 等','ChatGPT, Claude, Cursor etc.'],o:[['没用过','Never'],['偶尔聊天查东西','Now and then'],['经常用来写东西或写代码','Often, for writing or coding'],['用 AI 编程助手做过完整项目','Built whole projects with an AI coding agent']]}, | |
| {id:'idea',s:2,type:'idea',req:1,star:1,t:['如果 AI 能把任何东西做进游戏,你想做什么?','If an AI could build anything into a game for you, what would it be?'],h:['写清三件事:素材(哪部电影、哪本书、哪个地方)、做进哪款游戏、玩家在里面能做什么。50–200 字','Say three things: the source (a film, a book, a place), which game, and what the player does in it. 30–150 words']}, | |
| {id:'owned',s:2,type:'multi',req:1,t:['你电脑上有哪些游戏?','Which of these games do you have?'],h:['可多选。没有也没关系,体验时我们会安排','Select all that apply. None is fine too'],o:[['我的世界 Java 版','Minecraft (Java Edition)'],['星露谷物语','Stardew Valley'],['泰拉瑞亚','Terraria'],['英灵神殿','Valheim'],['城市:天际线','Cities: Skylines'],['都没有','None of these']]}, | |
| {id:'os',s:2,type:'single',req:1,t:['你的电脑系统','Your computer\'s system'],o:[['Windows','Windows'],['macOS','macOS'],['Linux','Linux'],['只有手机或平板','Phone or tablet only']]}, | |
| {id:'time',s:2,type:'single',req:1,t:['体验期间每周能拿出多少时间?','How much time could you give each week?'],o:[['不到 1 小时','Under 1 hour'],['1–3 小时','1–3 hours'],['3–6 小时','3–6 hours'],['6 小时以上','Over 6 hours']]}, | |
| {id:'feedback',s:2,type:'multi',req:1,t:['体验后愿意怎么反馈?','How would you give feedback afterwards?'],h:['可多选','Select all that apply'],o:[['反馈问卷(约 10 分钟)','A feedback form (about 10 min)'],['线上访谈(约 30 分钟)','An online interview (about 30 min)'],['允许研究我的使用记录','You may study my usage records'],['允许展示我的作品(署昵称)','You may show what I made, with my nickname'],['都不愿意','None of these']]}, | |
| {id:'extra',s:2,type:'multi',t:['还想参与哪些?','Anything else you would like to do?'],h:['选填','Optional'],o:[['给评测出题(入选可在论文致谢署名)','Propose benchmark challenges (accepted ones are credited in the paper)'],['推荐新游戏并帮忙接入','Suggest a new game and help connect it'],['暂时只想体验','Just the trial for now']]}, | |
| {id:'check',s:3,type:'single',req:1,t:['为了确认你在认真填写,这道题请选“泰拉瑞亚”。','To show you are reading the questions, please choose “Terraria” here.'],o:[['我的世界','Minecraft'],['星露谷物语','Stardew Valley'],['泰拉瑞亚','Terraria'],['英灵神殿','Valheim']]}, | |
| {id:'email',s:3,type:'email',req:1,t:['邮箱','Email'],h:['入选通知会发到这里','We will contact you here']}, | |
| {id:'im',s:3,type:'text1',t:['其他联系方式','Another way to reach you'],h:['选填。微信、QQ 或 Discord','Optional. WeChat, QQ or Discord']}, | |
| {id:'region',s:3,type:'single',req:1,t:['你所在的地区','Your region'],o:[['中国大陆','Mainland China'],['亚洲其他地区','Elsewhere in Asia'],['欧洲','Europe'],['北美','North America'],['其他','Other']]}, | |
| {id:'adult',s:3,type:'single',req:1,t:['你是否已满 18 岁?','Are you 18 or older?'],o:[['是','Yes'],['否','No']]}, | |
| {id:'source',s:3,type:'single',oth:7,t:['从哪里知道这次招募?','Where did you hear about this?'],h:['选填','Optional'],o:[['B 站','Bilibili'],['贴吧、NGA、小黑盒','Tieba, NGA, Xiaoheihe'],['mod 站(MC百科、CurseForge、Nexus 等)','A mod site (CurseForge, Modrinth, Nexus)'],['Reddit','Reddit'],['Discord','Discord'],['QQ 群或微信群','A group chat'],['朋友推荐','A friend'],['其他','Other']]}, | |
| ]; | |
| let lang = 'zh', step = 0, maxStep = 0, done = false; const A = {}; | |
| try { const s = JSON.parse(localStorage.getItem('ga-signup') || 'null'); if (s) { Object.assign(A, s.A || {}); lang = s.lang || lang; } } catch (e) {} | |
| const save = () => { try { localStorage.setItem('ga-signup', JSON.stringify({A, lang})); } catch (e) {} }; | |
| const $ = id => document.getElementById(id); | |
| const esc = s => String(s ?? '').replace(/[&<>"]/g, c => ({'&':'&','<':'<','>':'>','"':'"'}[c])); | |
| const li = lang === 'zh' ? 0 : 1, T = () => L[lang]; | |
| const isMaker = () => ['3','4'].includes(String(A.modlevel)); | |
| const visible = q => q.s === step && (!q.maker || isMaker()); | |
| function optHTML(q, type) { | |
| const li = lang === 'zh' ? 0 : 1, cur = A[q.id]; | |
| const items = q.o.map((o, i) => { | |
| const on = type === 'radio' ? String(cur) === String(i) : (cur || []).includes(i); | |
| return `<label class="opt"><input type="${type}" name="${q.id}" id="${q.id}_${i}" value="${i}" ${on ? 'checked' : ''}><span>${esc(o[li])}</span></label>`; }).join(''); | |
| const oth = q.other ? `<input type="text" id="${q.id}_other" placeholder="${esc(T().other)}" value="${esc(A[q.id + '_other'] || '')}">` | |
| : q.oth !== undefined ? `<input type="text" id="${q.id}_other" placeholder="${esc(T().otherWhere)}" value="${esc(A[q.id + '_other'] || '')}" ${String(cur) === String(q.oth) ? '' : 'hidden'}>` : ''; | |
| return `<div class="opts ${q.o.length > 6 || type === 'radio' && q.o.some(o => o[li].length > 14) ? 'col' : ''}">${items}</div>${oth}`; | |
| } | |
| function qHTML(q) { | |
| const li = lang === 'zh' ? 0 : 1, t = T(); | |
| let body = ''; | |
| if (q.type === 'multi') body = optHTML(q, 'checkbox'); | |
| else if (q.type === 'single') body = optHTML(q, 'radio'); | |
| else if (q.type === 'top3') body = [0,1,2].map(i => `<div class="games3"><input type="text" id="g${i}" placeholder="${esc(t.game)} ${i + 1}" value="${esc((A.top3 || [])[i]?.g || '')}"><input type="text" inputmode="numeric" id="hr${i}" placeholder="${esc(t.hours)}" value="${esc((A.top3 || [])[i]?.h || '')}"></div>`).join(''); | |
| else if (q.type === 'links') body = `<textarea id="links" rows="3" placeholder="https://…">${esc(A.links || '')}</textarea>`; | |
| else if (q.type === 'idea') body = `<textarea id="idea" placeholder="${lang === 'zh' ? '例:把《千与千寻》的汤屋做进星露谷物语,玩家当新来的员工,接待各种神明客人……' : 'Example: the bathhouse from Spirited Away in Stardew Valley; the player is a new worker serving spirit guests…'}">${esc(A.idea || '')}</textarea><div class="count" id="ideacount"></div>`; | |
| else if (q.type === 'text') body = `<textarea id="${q.id}" rows="3">${esc(A[q.id] || '')}</textarea>`; | |
| else body = `<input type="${q.type === 'email' ? 'email' : q.type === 'url' ? 'url' : 'text'}" id="${q.id}" value="${esc(A[q.id] || '')}" ${q.type === 'url' ? 'placeholder="https://…"' : ''}>`; | |
| return `<div class="q ${q.star ? 'star' : ''}" data-q="${q.id}"><span class="t">${esc(q.t[li])}${q.req ? ' <span class="req">*</span>' : ''}${q.star ? `<span class="badge">${lang === 'zh' ? '最重要' : 'Key question'}</span>` : ''}</span>${q.h ? `<span class="hint">${esc(q.h[li])}</span>` : ''}${body}<span class="err" hidden></span></div>`; | |
| } | |
| function collect() { | |
| for (const q of Q.filter(visible)) { | |
| if (q.type === 'multi') { A[q.id] = [...document.querySelectorAll(`input[name="${q.id}"]:checked`)].map(x => +x.value); if (q.other) A[q.id + '_other'] = $(q.id + '_other').value.trim(); } | |
| else if (q.type === 'single') { const c = document.querySelector(`input[name="${q.id}"]:checked`); A[q.id] = c ? +c.value : undefined; | |
| if (q.oth !== undefined) A[q.id + '_other'] = A[q.id] === q.oth ? $(q.id + '_other').value.trim() : ''; } | |
| else if (q.type === 'top3') A.top3 = [0,1,2].map(i => ({g: $('g' + i).value.trim(), h: $('hr' + i).value.trim()})); | |
| else { const el = $(q.id); if (el) A[q.id] = el.value.trim(); } | |
| } | |
| save(); | |
| } | |
| function missing(q) { | |
| if (!q.req) return false; | |
| const v = A[q.id]; | |
| if (q.type === 'multi') return !(v && v.length) && !(q.other && A[q.id + '_other']); | |
| if (q.type === 'single') return v === undefined; | |
| if (q.type === 'top3') return !(v || []).some(x => x.g); | |
| return !v; | |
| } | |
| function render() { | |
| const t = T(); | |
| document.documentElement.lang = lang === 'zh' ? 'zh-CN' : 'en'; | |
| $('lzh').setAttribute('aria-pressed', lang === 'zh'); $('len').setAttribute('aria-pressed', lang === 'en'); | |
| $('h1').innerHTML = t.h1; $('intro').textContent = t.intro; $('foot').textContent = t.foot; | |
| $('perks').innerHTML = t.perks.map(p => `<span class="perk">${p}</span>`).join(''); | |
| const gi = lang === 'zh' ? 0 : 1; $('galt').textContent = t.galt; $('galh').textContent = t.galh; $('walltag').textContent = t.walltag; | |
| if ($('gal').dataset.lang !== lang) { $('gal').dataset.lang = lang; | |
| $('gal').innerHTML = DEMO.map(c => `<figure class="case" data-id="${c.id}" tabindex="0"><div class="shot"><img src="media/${c.id}.jpg" alt="${esc(c.game)}: ${esc(c.t[gi])}" loading="lazy"><video muted loop playsinline preload="none" src="media/${c.id}.mp4"></video><span class="mod">${gi ? 'From ' + MODS[c.m][1].toLowerCase() : '参考:' + MODS[c.m][0]}</span></div><figcaption><b>${esc(c.t[gi])} · ${esc(c.game)}</b><span>${esc(c.d[gi])}</span></figcaption></figure>`).join(''); } | |
| document.querySelectorAll('#rail button').forEach((b, i) => { b.classList.toggle('on', done || i <= step); | |
| const can = !done && i !== step && i <= maxStep; b.classList.toggle('go', can); b.disabled = !can; | |
| b.setAttribute('aria-label', `${t.steps[i][0]} (${i + 1} / 4)`); b.title = can ? t.steps[i][0] : ''; }); | |
| if (done) { | |
| $('stitle').textContent = ''; $('scount').textContent = ''; $('slead').textContent = ''; | |
| $('qs').innerHTML = `<div class="done"><svg width="54" height="54" viewBox="0 0 54 54" aria-hidden="true"><rect x="4" y="14" width="18" height="18" fill="var(--accent)"/><rect x="22" y="14" width="18" height="18" fill="var(--sky)"/><rect x="22" y="32" width="18" height="18" fill="var(--accent)"/><rect x="13" y="0" width="18" height="14" fill="var(--sky)" opacity=".5"/></svg><h2>${esc(t.done)}</h2><p>${esc(t.doneP)}</p></div>`; | |
| $('back').hidden = true; $('next').hidden = true; return; | |
| } | |
| $('back').hidden = false; $('next').hidden = false; | |
| $('stitle').textContent = t.steps[step][0]; $('scount').textContent = `STEP ${step + 1} / 4`; $('slead').textContent = t.steps[step][1]; | |
| $('qs').innerHTML = (step === 1 ? `<div class="fast">${t.fast}</div>` : '') + Q.filter(visible).map(qHTML).join(''); | |
| $('back').textContent = t.back; $('back').style.visibility = step ? 'visible' : 'hidden'; | |
| $('next').textContent = step === 3 ? t.submit : t.next; | |
| const ic = $('idea'); if (ic) { const upd = () => { const n = lang === 'zh' ? ic.value.replace(/\s/g, '').length : (ic.value.trim().match(/\S+/g) || []).length; $('ideacount').textContent = `${n} ${t.words}`; }; ic.addEventListener('input', upd); upd(); } | |
| } | |
| $('qs').addEventListener('change', e => { | |
| if (e.target.name === 'modlevel') { collect(); render(); return; } | |
| const q = Q.find(x => x.id === e.target.name); | |
| if (q && q.oth !== undefined) { const box = $(q.id + '_other'); box.hidden = +e.target.value !== q.oth; if (!box.hidden) box.focus(); } | |
| }); | |
| // mark the unanswered required questions of this step; -> the first one, or null when the step is complete | |
| function check() { | |
| let first = null; | |
| for (const q of Q.filter(visible)) { | |
| const box = document.querySelector(`[data-q="${q.id}"]`); let bad = missing(q); | |
| if (!bad && q.type === 'email' && !/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(A.email)) bad = T().email; | |
| box.classList.toggle('bad', !!bad); const er = box.querySelector('.err'); er.hidden = !bad; er.textContent = typeof bad === 'string' ? bad : T().req; | |
| if (bad && !first) first = box; | |
| } | |
| return first; | |
| } | |
| const goStep = s => { step = s; maxStep = Math.max(maxStep, s); render(); $('form').scrollIntoView({behavior: 'smooth', block: 'start'}); }; | |
| $('form').addEventListener('submit', e => { | |
| e.preventDefault(); collect(); | |
| const first = check(); | |
| if (first) { first.scrollIntoView({behavior: 'smooth', block: 'center'}); return; } | |
| if (step < 3) { maxStep = Math.max(maxStep, step + 1); step++; render(); $('form').scrollIntoView({behavior: 'smooth', block: 'start'}); return; } | |
| send(); | |
| }); | |
| const play = (f, on) => { const v = f.querySelector('video'); f.classList.toggle('on', on); if (on) { v.play().catch(() => f.classList.remove('on')); } else v.pause(); }; | |
| $('gal').addEventListener('mouseover', e => { const f = e.target.closest('.case'); if (f) play(f, true); }); | |
| $('gal').addEventListener('mouseout', e => { const f = e.target.closest('.case'); if (f && !f.contains(e.relatedTarget)) play(f, false); }); | |
| $('gal').addEventListener('click', e => { const f = e.target.closest('.case'); if (f) play(f, !f.classList.contains('on')); }); | |
| if (matchMedia('(prefers-reduced-motion: reduce)').matches) { const w = $('wallv'); w.removeAttribute('autoplay'); w.pause(); } | |
| // readable copy of the answers (English option labels) so the stored file can be read without this page | |
| function readable() { | |
| const r = {}; | |
| for (const q of Q) { const v = A[q.id]; | |
| if (v === undefined || v === '' || (Array.isArray(v) && !v.length)) continue; | |
| if (q.type === 'multi') r[q.id] = v.map(i => q.o[i][1]).concat(A[q.id + '_other'] ? ['Other: ' + A[q.id + '_other']] : []); | |
| else if (q.type === 'single') r[q.id] = q.o[v][1] + (q.oth === v && A[q.id + '_other'] ? ': ' + A[q.id + '_other'] : ''); | |
| else if (q.type === 'top3') r[q.id] = v.filter(x => x.g).map(x => `${x.g} (${x.h || '?'} h)`); | |
| else r[q.id] = v; } | |
| return r; | |
| } | |
| const API = 'https://gameanything-trial-api.gameanything.workers.dev'; // Cloudflare Worker backend (no cold start, no wake-up ping needed) | |
| async function send() { | |
| const t = T(), btn = $('next'), er = $('senderr'); er.hidden = true; | |
| const onSpace = /\.hf\.space$|huggingface\.co$/.test(location.hostname); | |
| if (!onSpace) { A.submittedAt = new Date().toISOString(); save(); done = true; render(); return; } // preview: nothing is sent | |
| btn.disabled = true; btn.textContent = t.sending; | |
| try { | |
| const res = await fetch(API + '/api/submit', {method: 'POST', headers: {'Content-Type': 'application/json'}, | |
| body: JSON.stringify({lang, answers: A, readable: readable(), website: $('website').value})}); | |
| if (res.status === 429) throw new Error('rate'); | |
| const j = await res.json().catch(() => ({})); | |
| if (!res.ok || !j.ok) throw new Error(j.error || 'fail'); | |
| A.submittedAt = new Date().toISOString(); save(); done = true; render(); | |
| } catch (e) { | |
| er.textContent = e.message === 'rate' ? t.rate : t.sendFail; er.hidden = false; | |
| btn.disabled = false; btn.textContent = t.submit; | |
| } | |
| } | |
| // the progress bar: jump back to any step, or forward to a step already reached (the current step must be complete) | |
| $('rail').addEventListener('click', e => { | |
| const b = e.target.closest('button'); if (!b || b.disabled) return; | |
| const s = +b.dataset.s; collect(); | |
| if (s > step) { const first = check(); if (first) { first.scrollIntoView({behavior: 'smooth', block: 'center'}); return; } } | |
| goStep(s); | |
| }); | |
| $('back').addEventListener('click', () => { collect(); if (step) { step--; render(); } }); | |
| const setLang = l => { try { collect(); } catch (e) { console.error(e); } lang = l; save(); try { render(); } catch (e) { console.error(e); } }; | |
| $('lzh').addEventListener('click', () => setLang('zh')); | |
| $('len').addEventListener('click', () => setLang('en')); | |
| render(); | |
| </script> | |
| </body> | |
| </html> | |