Files
InfoGenie/InfoGenie-frontend/public/60sapi/周期资讯/摸鱼日历.html
2026-03-28 20:59:52 +08:00

82 lines
6.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>摸鱼日历</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}.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}
.hero{background:linear-gradient(135deg,#0e7490,#06b6d4);border-radius:20px;padding:28px 24px;margin-bottom:16px;color:#fff;text-align:center}
.emoji{font-size:48px;margin-bottom:8px}
.title{font-size:20px;font-weight:700;margin-bottom:4px}
.sub{font-size:13px;opacity:.85}
.quote{background:rgba(255,255,255,.12);border-radius:12px;padding:14px 16px;margin-top:16px;font-size:14px;font-style:italic;line-height:1.7}
.section{background:#fff;border-radius:14px;padding:16px;margin-bottom:10px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.section-title{font-size:13px;font-weight:700;color:#6b7280;margin-bottom:10px;display:flex;align-items:center;gap:6px}
.progress-label{display:flex;justify-content:space-between;font-size:12px;color:#9ca3af;margin-bottom:4px;margin-top:10px}
.progress-bar{height:8px;background:#f3f4f6;border-radius:4px;overflow:hidden;margin-bottom:4px}
.progress-fill{height:100%;border-radius:4px;transition:width .6s ease}
.cd-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.cd-item{border-radius:12px;padding:14px;text-align:center}
.cd-num{font-size:28px;font-weight:800;margin-bottom:2px}
.cd-label{font-size:12px;color:#6b7280}
.row{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid #f9fafb}.row:last-child{border-bottom:none}
.rk{font-size:13px;color:#9ca3af}.rv{font-size:13px;color:#1f2937;font-weight:500}
.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:480px){.cd-grid{grid-template-columns:1fr}}
</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>🐟 摸鱼日历</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>
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(window.__SIXTY_API_BASE__+'/v2/moyu?encoding=json',{headers:{Accept:'application/json'}});
const json=await res.json();
const d=json.data||json;
if(!d){el.innerHTML='<div class="err">暂无数据</div>';return}
const dt=d.date||{},p=d.progress||{},cd=d.countdown||{},nh=d.nextHoliday||{},nw=d.nextWeekend||{};
let html=`<div class="hero"><div class="emoji">🐟</div><div class="title">摸鱼日历</div><div class="sub">${dt.gregorian||''} ${dt.weekday||''} · 农历${dt.lunar?.monthCN||''}${dt.lunar?.dayCN||''} · ${dt.lunar?.zodiac||''}年</div>${d.moyuQuote?`<div class="quote">"${d.moyuQuote}"</div>`:''}</div>`;
html+='<div class="section"><div class="section-title">⏳ 时间进度</div>';
if(p.week)html+=`<div class="progress-label"><span>本周进度</span><span>${p.week.percentage}%${p.week.passed}/${p.week.total}天)</span></div><div class="progress-bar"><div class="progress-fill" style="width:${p.week.percentage}%;background:linear-gradient(90deg,#4ade80,#22c55e)"></div></div>`;
if(p.month)html+=`<div class="progress-label"><span>本月进度</span><span>${p.month.percentage}%(还剩${p.month.remaining}天)</span></div><div class="progress-bar"><div class="progress-fill" style="width:${p.month.percentage}%;background:linear-gradient(90deg,#60a5fa,#3b82f6)"></div></div>`;
if(p.year)html+=`<div class="progress-label"><span>本年进度</span><span>${p.year.percentage}%(还剩${p.year.remaining}天)</span></div><div class="progress-bar"><div class="progress-fill" style="width:${p.year.percentage}%;background:linear-gradient(90deg,#f472b6,#ec4899)"></div></div>`;
html+='</div>';
html+='<div class="section"><div class="section-title">🎯 倒计时</div><div class="cd-grid">';
html+=`<div class="cd-item" style="background:#f0fdf4"><div class="cd-num" style="color:#16a34a">${cd.toFriday??'-'}</div><div class="cd-label">距周五</div></div>`;
html+=`<div class="cd-item" style="background:#eff6ff"><div class="cd-num" style="color:#2563eb">${cd.toWeekEnd??'-'}</div><div class="cd-label">距周末</div></div>`;
if(nh.name)html+=`<div class="cd-item" style="background:#fef3c7"><div class="cd-num" style="color:#d97706">${nh.until??'-'}</div><div class="cd-label">距${nh.name}${nh.duration}天假)</div></div>`;
html+=`<div class="cd-item" style="background:#fce7f3"><div class="cd-num" style="color:#db2777">${cd.toYearEnd??'-'}</div><div class="cd-label">距年末</div></div>`;
html+='</div></div>';
if(d.today){
html+='<div class="section"><div class="section-title">📋 今日状态</div>';
html+=`<div class="row"><span class="rk">今天是</span><span class="rv">${d.today.isWeekend?'🎉 周末':'💼 工作日'}${d.today.isHoliday&&d.today.holidayName?` · ${d.today.holidayName}`:''}</span></div>`;
if(nw.date)html+=`<div class="row"><span class="rk">下个周末</span><span class="rv">${nw.date} ${nw.weekday}${nw.daysUntil}天后)</span></div>`;
if(nh.name)html+=`<div class="row"><span class="rk">下个假期</span><span class="rv">${nh.name} · ${nh.date}</span></div>`;
html+='</div>';
}
el.innerHTML=html;
}catch(e){el.innerHTML=`<div class="err">加载失败:${e.message}</div>`}
}
loadData();
</script>
</body>
</html>