| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <!doctype html>
- <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="referrer" content="no-referrer"><title>Player Survey · JokerSudoku</title><style>
- :root{color-scheme:light;--blue:#287de0;--ink:#203854;--muted:#64758a;--line:#dde6f0;--bg:#f1f6fc}
- *{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,textarea,select{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:default;opacity:.55}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #eeb735;outline-offset:4px}
- .shell{max-width:780px;margin:auto;padding:24px 20px 40px}header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:30px}.brand{display:flex;gap:10px;align-items:center;font-weight:800;letter-spacing:-.4px}.mark{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:var(--ink);color:#ffd777;font-size:25px}.language{background:transparent;color:var(--muted);border:1px solid var(--line);border-radius:10px;padding:6px 8px;min-height:44px}.eyebrow{font-size:12px;letter-spacing:2px;color:var(--blue);font-weight:700}h1{font-size:clamp(28px,5vw,38px);line-height:1.2;letter-spacing:-1px;margin:12px 0 16px}p{margin:0 0 20px}.intro{color:var(--muted);max-width:620px}.card{background:#fff;border:1px solid var(--line);border-radius:22px;padding:24px;margin:18px 0;box-shadow:0 5px 22px #20385404}.number{display:block;color:var(--blue);font-size:12px;font-weight:800;letter-spacing:1.5px;margin-bottom:8px}fieldset{min-width:0}legend{float:left;width:100%;font-weight:650;line-height:1.5;padding:0;margin:0 0 20px}.choices{display:flex;gap:12px;clear:both}.choice{position:relative;flex:1;cursor:pointer}.choice input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0}.choice span{display:block;text-align:center;border:1px solid var(--line);border-radius:12px;padding:11px 8px;color:var(--muted)}.choice input:checked+span{border-color:var(--blue);background:#edf5ff;color:var(--blue);box-shadow:inset 0 0 0 1px var(--blue)}.choice input:focus-visible+span{outline:3px solid #eeb735;outline-offset:3px}label.heading{display:block;font-weight:650;margin-bottom:12px}.optional{font-size:13px;font-weight:400;color:var(--muted)}textarea,input[type=text],input[type=email]{display:block;width:100%;background:#f9fbfe;color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:14px;resize:vertical}textarea{min-height:130px}.count,.hint{font-size:12px;color:var(--muted)}.count{text-align:right;margin-top:6px}.actions{display:flex;gap:12px;margin:24px 0 18px}.button{min-height:50px;padding:12px 20px;border:0;border-radius:14px;font-weight:650;flex:1;background:var(--blue);color:#fff;text-decoration:none;text-align:center}.button.secondary{color:var(--ink);background:#fff;border:1px solid var(--line)}.entry{width:100%;padding:18px;display:flex;align-items:center;justify-content:space-between;gap:14px;background:transparent;border:1px solid var(--line);border-radius:14px;color:var(--ink);text-align:left}.entry small{display:block;color:var(--muted);font-weight:400;margin-top:2px}.status{white-space:pre-wrap;color:#b34421;margin:12px 0;min-height:0}.status:empty{display:none}.status.success{color:#16754d}footer{color:var(--muted);font-size:12px;text-align:center;margin-top:26px}a{color:var(--blue)}.upload{position:relative;display:block;border:1.5px dashed #b6cce4;border-radius:14px;padding:25px 16px;text-align:center;background:#f9fbfe;color:var(--blue);cursor:pointer}.upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.previews{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:16px}.shot{position:relative;min-width:0}.shot img{display:block;object-fit:cover;width:100%;height:125px;border-radius:12px;border:1px solid var(--line)}.shot button{position:absolute;right:5px;top:5px;border:0;border-radius:50%;background:#203854e6;color:#fff;width:36px;height:36px}.shot small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--muted)}
- @media(max-width:430px){.shell{padding:20px 16px 32px}.card{padding:20px}.actions{gap:10px}.button{padding:12px 14px}.brand{font-size:15px}.previews{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(prefers-reduced-motion:no-preference){button{transition:background .15s,opacity .15s}}
- </style></head><body>
- <main class="shell"><header><div class="brand"><span class="mark" aria-hidden="true">♛</span>JokerSudoku</div><select class="language" id="language" aria-label="Language"><option value="en">English</option><option value="zh-Hans">简体中文</option></select></header><div class="eyebrow" data-i18n="eyebrow"></div><h1 data-i18n="title"></h1><p class="intro" data-i18n="intro"></p><form id="survey"><fieldset class="card"><legend><span class="number">01</span><span data-i18n="q1"></span></legend><div class="choices"><label class="choice"><input type="radio" name="q1" value="2" required><span data-i18n="yes"></span></label><label class="choice"><input type="radio" name="q1" value="1" required><span data-i18n="no"></span></label></div></fieldset><fieldset class="card"><legend><span class="number">02</span><span data-i18n="q2"></span></legend><div class="choices"><label class="choice"><input type="radio" name="q2" value="2" required><span data-i18n="yes"></span></label><label class="choice"><input type="radio" name="q2" value="1" required><span data-i18n="no"></span></label></div></fieldset><fieldset class="card"><legend><span class="number">03</span><span data-i18n="q3"></span></legend><div class="choices"><label class="choice"><input type="radio" name="q3" value="2" required><span data-i18n="yes"></span></label><label class="choice"><input type="radio" name="q3" value="1" required><span data-i18n="no"></span></label></div></fieldset><fieldset class="card"><legend><span class="number">04</span><span data-i18n="q4"></span></legend><div class="choices"><label class="choice"><input type="radio" name="q4" value="2" required><span data-i18n="yes"></span></label><label class="choice"><input type="radio" name="q4" value="1" required><span data-i18n="no"></span></label></div></fieldset><section class="card"><label class="heading" for="feedback"><span data-i18n="thoughts"></span> <span class="optional" data-i18n="optional"></span></label><textarea id="feedback" maxlength="2000" data-placeholder="placeholder"></textarea><div class="count"><span id="count">0</span> / 2000</div></section><p class="hint" data-i18n="dataNote"></p><p class="status" id="status" role="status" aria-live="polite"></p><div class="actions"><button class="button" type="submit" id="submit" data-i18n="submit"></button><button class="button secondary" type="button" id="close" data-i18n="close"></button></div></form><button class="entry" id="bug" type="button"><span><strong data-i18n="bug"></strong><small data-i18n="bugHint"></small></span><span aria-hidden="true">↗</span></button><footer>Joker Sudoku · <a id="privacy" href="jokersudoku.html" data-i18n="privacy">Privacy Policy</a></footer></main><script>
- 'use strict';
- const PRIVACY_URL = 'http://a806b934804d0f0ab.awsglobalaccelerator.com/privacy/jokersudoku.html';
- const FEEDBACK_URL = 'http://a806b934804d0f0ab.awsglobalaccelerator.com/privacy/jokersudoku-feedback.html';
- const copy = {
- en: {pageTitle:'Player Survey',eyebrow:'A MINUTE FOR A BETTER GAME',title:'Help shape your next puzzle.',intro:'Four quick questions about the future of JokerSudoku. Taking part is optional. You can close this page and keep playing at any time.',q1:'Would you be willing to see ads to support the game?',q2:'Would you be willing to make a donation to support the game?',q3:'Would you be willing to buy optional tools to help complete puzzles?',q4:'Would you be willing to try new game modes?',yes:'Willing',no:'Unwilling',thoughts:'Anything else on your mind?',optional:'(optional)',placeholder:'Tell us what would make your Sudoku experience better…',dataNote:'This is a preference survey. No ads are enabled, no purchase is made, and no payment is collected here. Written comments are saved on this device. Answer analytics follow your app tracking permission.',submit:'Submit & close',close:'Close',bug:'Bug reports & suggestions',bugHint:'Open the feedback page in your browser',privacy:'Privacy Policy',unavailable:'The feedback link is not available yet.',nativeRequired:'Open this survey inside JokerSudoku to save your answers and close the page.',failed:'Unable to send the response to the app. Please try again.'},
- 'zh-Hans': {pageTitle:'玩家问卷',eyebrow:'花一分钟,一起改进游戏',title:'下一道精彩,由你决定。',intro:'关于 JokerSudoku 未来的四个小问题。参与完全自愿,你随时可以关闭页面,继续游戏。',q1:'你是否愿意通过观看广告支持游戏?',q2:'你是否愿意通过捐献支持游戏?',q3:'你是否愿意购买帮助完成数独的可选道具?',q4:'你是否愿意体验新的游戏玩法?',yes:'愿意',no:'不愿意',thoughts:'还有什么想对我们说?',optional:'(选填)',placeholder:'你期待怎样的数独体验?欢迎留下意见…',dataNote:'本页仅征求意愿,不会开启广告、发起购买或收取费用。文字意见保存在本设备,答案统计遵循你在应用中的跟踪授权选择。',submit:'提交并关闭',close:'关闭',bug:'Bug 反馈与优化建议',bugHint:'使用外部浏览器打开反馈页面',privacy:'隐私政策',unavailable:'反馈链接暂未开放。',nativeRequired:'请在 JokerSudoku 应用内打开问卷,以保存答案并关闭页面。',failed:'未能将反馈传递给应用,请重试。'}
- };
- function nativeCall(action, params = {}) {
- if (window.iosapp && typeof window.iosapp.postMessage === 'function') {
- window.iosapp.postMessage(action, JSON.stringify(params));
- return true;
- }
- return false;
- }
- if (!window.iosapp && window.webkit?.messageHandlers?.iosapp) {
- window.iosapp = Object.freeze({postMessage(action, params) {
- window.webkit.messageHandlers.iosapp.postMessage({action, params: params ?? '{}'});
- }});
- }
- function privacyDestination() {
- const candidate = window.iosapp?.privacyURL || new URLSearchParams(location.search).get('privacyurl');
- try {
- const url = new URL(candidate);
- if (['https:', 'http:'].includes(url.protocol) && !url.username && !url.password) return url.href;
- } catch (_) {}
- return PRIVACY_URL;
- }
- let lang = new URLSearchParams(location.search).get('lang')?.startsWith('zh') ? 'zh-Hans' : 'en';
- const $ = id => document.getElementById(id);
- function t(key) { return copy[lang][key]; }
- function renderLanguage() {
- document.documentElement.lang = lang;
- $('language').value = lang;
- document.querySelectorAll('[data-i18n]').forEach(node => { node.textContent = t(node.dataset.i18n); });
- document.querySelectorAll('[data-placeholder]').forEach(node => { node.placeholder = t(node.dataset.placeholder); });
- document.title = t('pageTitle') + ' · JokerSudoku';
- }
- $('language').addEventListener('change', event => { lang = event.target.value; renderLanguage(); });
- const draftKey = 'JokerSudoku.survey.draft.v1';
- try {
- const draft = JSON.parse(localStorage.getItem(draftKey) || 'null');
- if (draft) {
- [1,2,3,4].forEach((question, index) => {
- if ([1,2].includes(draft.answers?.[index])) document.querySelector(`input[name="q${question}"][value="${draft.answers[index]}"]`).checked = true;
- });
- if (typeof draft.feedback === 'string') $('feedback').value = draft.feedback.slice(0,2000);
- }
- } catch (_) {}
- function response() { return {answers:[1,2,3,4].map(n => Number(new FormData($('survey')).get('q'+n)) || null),feedback:$('feedback').value.trim()}; }
- function saveDraft() { $('count').textContent = $('feedback').value.length; try { localStorage.setItem(draftKey, JSON.stringify(response())); } catch (_) {} }
- $('survey').addEventListener('input', saveDraft);
- let sent = false;
- $('survey').addEventListener('submit', event => {
- event.preventDefault();
- if (sent || !$('survey').reportValidity()) return;
- if (!window.iosapp) { $('status').textContent = t('nativeRequired'); return; }
- const data = response();
- sent = true; $('submit').disabled = true;
- try {
- data.answers.forEach((value,index) => nativeCall('survey_response', {question_id:index+1, answer:value === 2 ? 'willing' : 'unwilling'}));
- if (!nativeCall('close', {submitted:true,...data})) throw new Error('bridge_unavailable');
- } catch (_) { sent = false; $('submit').disabled = false; $('status').textContent = t('failed'); }
- });
- $('close').addEventListener('click', () => {
- try { if (!nativeCall('close', {submitted:false})) $('status').textContent = t('nativeRequired'); }
- catch (_) { $('status').textContent = t('failed'); }
- });
- $('privacy').addEventListener('click', event => {
- event.preventDefault();
- try { if (!nativeCall('openWindow', {url:privacyDestination()})) window.open(privacyDestination(), '_blank', 'noopener,noreferrer'); }
- catch (_) { $('status').textContent = t('failed'); }
- });
- $('bug').addEventListener('click', () => {
- if (!FEEDBACK_URL) { $('status').textContent = t('unavailable'); return; }
- let destination;
- try { destination = new URL(FEEDBACK_URL); if (!['https:','http:'].includes(destination.protocol) || destination.username || destination.password) throw new Error(); }
- catch (_) { $('status').textContent = t('unavailable'); return; }
- destination.searchParams.set('privacyurl', privacyDestination());
- try { if (!nativeCall('openWindow', {url:destination.href})) window.open(destination.href, '_blank', 'noopener,noreferrer'); }
- catch (_) { $('status').textContent = t('failed'); }
- });
- renderLanguage(); saveDraft();
- </script></body></html>
|