-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDataCollect.html
More file actions
52 lines (52 loc) · 2.63 KB
/
Copy pathDataCollect.html
File metadata and controls
52 lines (52 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>参赛信息登记 · Contest Profile</title>
<meta name="theme-color" content="#0b0c0d" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" />
<style>
:root{ --bg:#0b0c0d; --panel:#0f1113; --muted:#9aa4ad; --text:#e6eef6; --accent:#48a0ff; --radius:12px; }
body{margin:0;background:var(--bg);color:var(--muted);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial;}
.wrap{max-width:560px;margin:0 auto;padding:20px}
h1{color:#fff;font-size:20px;margin:0 0 12px;display:flex;align-items:center;gap:8px}
.card{background:var(--panel);border:1px solid rgba(255,255,255,0.08);border-radius:var(--radius);padding:16px}
label{display:block;margin-top:10px;font-size:13px;color:#cbd5e1}
input{width:100%;margin-top:6px;background:#161a1e;border:1px solid #222;border-radius:8px;padding:8px 10px;color:#e6eef6;font-size:13px}
.row{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}
button{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:10px;border:1px solid rgba(255,255,255,0.08);background:var(--panel);color:var(--text);cursor:pointer}
button.primary{background:var(--accent);color:#071022;border:0}
</style>
</head>
<body>
<div class="wrap">
<h1><i class="fas fa-id-card"></i> 参赛信息登记 · Contest Profile</h1>
<div class="card">
<label>昵称 / Handle(每次提交必填)
<input id="handle" placeholder="如 alice" />
</label>
<div class="row">
<button id="cancel"><i class="fas fa-xmark"></i> 取消 Cancel</button>
<button id="save" class="primary"><i class="fas fa-check"></i> 保存 Save</button>
</div>
</div>
</div>
<script>
function save(){
const handle=document.getElementById('handle').value.trim();
if(!handle){ alert('请输入昵称 / Handle'); return; }
const obj={ handle };
try{ localStorage.setItem('contest_profile', JSON.stringify(obj)); }catch(e){}
try{ window.opener && window.opener.postMessage({type:'contest_profile_saved'}, '*'); }catch(e){}
setTimeout(()=>{ window.close(); }, 120);
}
document.getElementById('save').addEventListener('click', save);
document.getElementById('cancel').addEventListener('click', ()=>window.close());
// 预填已有
try{
const raw=localStorage.getItem('contest_profile'); if(raw){ const p=JSON.parse(raw); handle.value=p.handle||''; }
}catch(e){}
</script>
</body>
</html>