90 lines
4.6 KiB
HTML
90 lines
4.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>GitHub 贡献热力图</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
<body>
|
|
<div class="widget">
|
|
<!-- Header -->
|
|
<div class="header" data-tauri-drag-region>
|
|
<div class="title-area" data-tauri-drag-region>
|
|
<svg class="platform-icon" viewBox="0 0 24 24" fill="currentColor" data-tauri-drag-region>
|
|
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
|
|
</svg>
|
|
<span class="username" id="username-display">shumengya</span>
|
|
<span class="separator">•</span>
|
|
<span class="stats" id="stats-display">加载中...</span>
|
|
</div>
|
|
<div class="header-right">
|
|
<div class="legend">
|
|
<span class="legend-label">少</span>
|
|
<div class="legend-cell" data-level="0"></div>
|
|
<div class="legend-cell" data-level="1"></div>
|
|
<div class="legend-cell" data-level="2"></div>
|
|
<div class="legend-cell" data-level="3"></div>
|
|
<div class="legend-cell" data-level="4"></div>
|
|
<span class="legend-label">多</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Heatmap -->
|
|
<div class="heatmap-area" id="heatmap-area">
|
|
<div class="status-msg" id="status-loading">
|
|
<div class="spinner"></div>
|
|
<span>正在获取贡献数据...</span>
|
|
</div>
|
|
<div class="status-msg error" id="status-error" style="display:none">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/>
|
|
</svg>
|
|
<span id="error-text">加载失败</span>
|
|
</div>
|
|
<canvas id="heatmap-canvas"></canvas>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Settings Modal -->
|
|
<div class="modal-overlay" id="settings-modal">
|
|
<div class="modal" id="settings-panel">
|
|
<div class="modal-title">
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="12" cy="12" r="3"/>
|
|
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/>
|
|
</svg>
|
|
GitHub 设置
|
|
</div>
|
|
<div class="form-group">
|
|
<label>主题</label>
|
|
<select id="input-theme">
|
|
<option value="dark">深色</option>
|
|
<option value="light">浅色</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>GitHub 用户名</label>
|
|
<input type="text" id="input-username" placeholder="例如: shumengya" autocomplete="off">
|
|
<span class="form-error" id="form-error">请填写 GitHub 用户名</span>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Personal Access Token</label>
|
|
<input type="password" id="input-token" placeholder="ghp_xxxxxxxxxxxxxxxxxxxx" autocomplete="off">
|
|
<span class="form-hint">需要 read:user 权限 · Settings → Developer settings → Tokens</span>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn" id="btn-cancel">取消</button>
|
|
<button class="btn primary" id="btn-save">保存并刷新</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tooltip -->
|
|
<div class="tooltip" id="tooltip"></div>
|
|
|
|
<script type="module" src="main.js"></script>
|
|
</body>
|
|
</html>
|