Files
InfoGenie/InfoGenie-frontend/public/60sapi/周期资讯/每天60s读懂世界.html
2026-03-28 20:59:52 +08:00

65 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>每天60s读懂世界</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'KaiTi','楷体',serif;background:#f9fafb;color:#1f2937;line-height:1.6;min-height:100vh}
.header{background:linear-gradient(135deg,#065f46,#059669);color:#fff;padding:16px;display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:10}
.header h1{flex:1;font-size:16px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.btn{width:36px;height:36px;border:none;border-radius:10px;background:rgba(255,255,255,.15);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px}
.btn:hover{background:rgba(255,255,255,.25)}
.body{max-width:720px;margin:0 auto;padding:20px 16px 40px}
.date{display:flex;align-items:center;gap:6px;font-size:13px;color:#6b7280;padding-bottom:12px;border-bottom:1px solid #e5e7eb;margin-bottom:16px}
.item{display:flex;gap:10px;padding:11px 0;border-bottom:1px solid #f3f4f6}
.item:last-child{border-bottom:none}
.num{flex-shrink:0;width:24px;height:24px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;margin-top:1px;color:#9ca3af;background:#f3f4f6}
.num.t1{color:#fff;background:#ef4444}.num.t2{color:#fff;background:#f97316}.num.t3{color:#fff;background:#eab308}
.text{flex:1;font-size:14px;line-height:1.7}
.tip{margin-top:20px;padding:14px 16px;border-radius:12px;font-size:13px;line-height:1.6;color:#6b7280;background:#f0fdf4;border:1px solid rgba(34,197,94,.1);font-style:italic}
.cover{margin-top:16px;text-align:center}.cover img{max-width:100%;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.08)}
.loader{display:flex;flex-direction:column;align-items:center;padding:60px 0;color:#9ca3af;gap:10px;font-size:13px}
.spinner{width:24px;height:24px;border:3px solid #e5e7eb;border-top-color:#059669;border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.err{text-align:center;padding:40px 16px;color:#ef4444;font-size:14px}
@media(max-width:640px){.body{padding:16px 12px 32px}.text{font-size:13px}.header h1{font-size:14px}}
</style>
<script src="/60sapi/ig-embed.js"></script>
<script src="/60sapi/sixty-runtime.js"></script>
</head>
<body>
<div class="header">
<button class="btn" onclick="history.back()"></button>
<h1>🌍 每天60s读懂世界</h1>
<button class="btn" onclick="loadData()"></button>
</div>
<div class="body" id="content">
<div class="loader"><div class="spinner"></div><span>加载中...</span></div>
</div>
<script>
const API=window.__SIXTY_API_BASE__+'/v2/60s?encoding=json';
async function loadData(){
const el=document.getElementById('content');
el.innerHTML='<div class="loader"><div class="spinner"></div><span>加载中...</span></div>';
try{
const res=await fetch(API,{headers:{Accept:'application/json'}});
const json=await res.json();
const d=json.data||json;
let html='';
if(d.date)html+=`<div class="date">🕐 ${d.date} ${d.day_of_week||''}</div>`;
const news=d.news||[];
news.forEach((t,i)=>{
const cls=i===0?'t1':i===1?'t2':i===2?'t3':'';
html+=`<div class="item"><div class="num ${cls}">${i+1}</div><div class="text">${t}</div></div>`;
});
if(d.tip)html+=`<div class="tip">💡 ${d.tip}</div>`;
if(d.image)html+=`<div class="cover"><img src="${d.image}" alt="封面" loading="lazy"></div>`;
el.innerHTML=html||'<div class="err">暂无数据</div>';
}catch(e){el.innerHTML=`<div class="err">加载失败:${e.message}</div>`}
}
loadData();
</script>
</body>
</html>