Files
git-heatmap/github/frontend/style.css
2026-06-23 21:57:49 +08:00

398 lines
8.1 KiB
CSS

:root {
--bg-widget: #0d1117;
--border: #30363d;
--shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
--text-primary: #e6edf3;
--text-secondary: #8b949e;
--separator: #30363d;
--btn-icon: #7d8590;
--btn-hover-bg: #21262d;
--btn-hover-text: #e6edf3;
--accent: #388bfd;
--overlay: rgba(0, 0, 0, 0.82);
--modal-bg: #161b22;
--modal-footer-bg: #161b22;
--input-bg: #0d1117;
--input-border: #30363d;
--input-text: #e6edf3;
--label-text: #c9d1d9;
--hint-text: #8b949e;
--input-focus: #388bfd;
--input-focus-shadow: rgba(56, 139, 253, 0.2);
--btn-bg: #21262d;
--btn-text: #e6edf3;
--btn-hover: #30363d;
--btn-primary-bg: #238636;
--btn-primary-border: #2ea043;
--btn-primary-hover: #2ea043;
--tooltip-bg: #1c2128;
--tooltip-border: #444c56;
--tooltip-text: #e6edf3;
--error: #f85149;
--spinner-track: #30363d;
--status-text: #8b949e;
--platform-icon: #e6edf3;
--hm-0: #161b22;
--hm-0-border: #30363d;
--hm-1: #0e4429;
--hm-2: #006d32;
--hm-3: #26a641;
--hm-4: #39d353;
}
body.theme-light {
--bg-widget: #ffffff;
--border: #d0d7de;
--shadow: 0 4px 16px rgba(140, 149, 159, 0.22), 0 1px 4px rgba(27, 31, 36, 0.08);
--text-primary: #1f2328;
--text-secondary: #656d76;
--separator: #d0d7de;
--btn-icon: #656d76;
--btn-hover-bg: #f3f4f6;
--btn-hover-text: #1f2328;
--accent: #0969da;
--overlay: rgba(27, 31, 36, 0.4);
--modal-bg: #ffffff;
--modal-footer-bg: #ffffff;
--input-bg: #ffffff;
--input-border: #d0d7de;
--input-text: #1f2328;
--label-text: #1f2328;
--hint-text: #656d76;
--input-focus-shadow: rgba(9, 105, 218, 0.25);
--btn-bg: #f6f8fa;
--btn-text: #1f2328;
--btn-hover: #eaeef2;
--tooltip-bg: #ffffff;
--tooltip-border: #d0d7de;
--tooltip-text: #1f2328;
--error: #cf222e;
--spinner-track: #d0d7de;
--status-text: #656d76;
--platform-icon: #24292f;
--hm-0: #ebedf0;
--hm-0-border: #d0d7de;
--hm-1: #9be9a8;
--hm-2: #40c463;
--hm-3: #30a14e;
--hm-4: #216e39;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: transparent;
font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
user-select: none;
overflow: hidden;
width: 100vw;
height: 100vh;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
.widget {
background: var(--bg-widget);
border: 1px solid var(--border);
border-radius: 10px;
padding: 4px 5px 3px;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
gap: 0;
box-shadow: var(--shadow);
transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
min-height: 20px;
cursor: move;
-webkit-app-region: drag;
}
.title-area {
display: flex;
align-items: center;
gap: 6px;
cursor: move;
-webkit-app-region: drag;
min-width: 0;
flex: 1;
}
.platform-icon {
width: 16px;
height: 16px;
color: var(--platform-icon);
flex-shrink: 0;
shape-rendering: geometricPrecision;
}
.username {
color: var(--text-primary);
font-size: 13px;
font-weight: 600;
letter-spacing: 0;
line-height: 1.1;
}
.stats {
color: var(--text-secondary);
font-size: 11px;
font-weight: 600;
white-space: nowrap;
line-height: 1.1;
}
.separator {
color: var(--separator);
margin: 0 2px;
}
.header-right {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
.legend {
display: flex;
align-items: center;
gap: 2px;
flex-shrink: 0;
cursor: move;
-webkit-app-region: drag;
}
.heatmap-area {
flex: 0 0 auto;
width: 100%;
line-height: 0;
position: relative;
cursor: move;
-webkit-app-region: drag;
}
#heatmap-canvas {
display: none;
cursor: crosshair;
-webkit-app-region: no-drag;
vertical-align: top;
}
.status-msg {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
color: var(--status-text);
font-size: 11px;
font-weight: 600;
}
.status-msg.error {
color: var(--error);
}
.spinner {
width: 18px;
height: 18px;
border: 2px solid var(--spinner-track);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.legend-label {
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
}
.legend-cell {
width: 8px;
height: 8px;
border-radius: 2px;
}
.legend-cell[data-level="0"] {
background: var(--hm-0);
border: 1px solid var(--hm-0-border);
}
.legend-cell[data-level="1"] { background: var(--hm-1); }
.legend-cell[data-level="2"] { background: var(--hm-2); }
.legend-cell[data-level="3"] { background: var(--hm-3); }
.legend-cell[data-level="4"] { background: var(--hm-4); }
.modal-overlay {
position: fixed;
inset: 0;
background: var(--overlay);
display: none;
align-items: center;
justify-content: center;
z-index: 100;
backdrop-filter: blur(4px);
-webkit-app-region: no-drag;
padding: 8px;
}
.modal-overlay.visible {
display: flex;
}
body.settings-open .widget {
pointer-events: none;
}
.modal {
background: var(--modal-bg);
border: 1px solid var(--border);
border-radius: 10px;
padding: 16px 18px 14px;
width: min(320px, calc(100vw - 16px));
max-height: calc(100vh - 16px);
overflow-y: auto;
box-shadow: var(--shadow);
-webkit-app-region: no-drag;
transition: background 0.2s, border-color 0.2s;
}
.modal-title {
font-size: 14px;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 14px;
display: flex;
align-items: center;
gap: 6px;
}
.form-group {
margin-bottom: 12px;
}
.form-group label {
display: block;
font-size: 12px;
color: var(--label-text);
margin-bottom: 5px;
font-weight: 600;
}
.form-group input,
.form-group select {
width: 100%;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 6px;
padding: 8px 10px;
color: var(--input-text);
font-size: 13px;
font-weight: 600;
outline: none;
transition: border-color 0.15s, background 0.15s;
font-family: inherit;
-webkit-app-region: no-drag;
}
.form-group input:focus,
.form-group select:focus {
border-color: var(--input-focus);
box-shadow: 0 0 0 2px var(--input-focus-shadow);
}
.form-hint {
font-size: 10px;
font-weight: 600;
color: var(--hint-text);
margin-top: 4px;
display: block;
line-height: 1.4;
}
.form-error {
display: none;
margin-top: 6px;
font-size: 11px;
font-weight: 600;
color: var(--error);
}
.form-error.visible {
display: block;
}
.modal-footer {
display: flex;
gap: 8px;
justify-content: flex-end;
margin-top: 14px;
padding-top: 12px;
border-top: 1px solid var(--border);
position: sticky;
bottom: 0;
background: var(--modal-footer-bg);
}
.btn {
padding: 7px 16px;
border-radius: 6px;
font-size: 12px;
font-weight: 600;
cursor: pointer;
border: 1px solid var(--border);
background: var(--btn-bg);
color: var(--btn-text);
transition: background 0.12s;
font-family: inherit;
-webkit-app-region: no-drag;
}
.btn:hover {
background: var(--btn-hover);
}
.btn.primary {
background: var(--btn-primary-bg);
border-color: var(--btn-primary-border);
color: #fff;
}
.btn.primary:hover {
background: var(--btn-primary-hover);
}
.tooltip {
position: fixed;
background: var(--tooltip-bg);
border: 1px solid var(--tooltip-border);
border-radius: 6px;
padding: 5px 9px;
font-size: 11px;
font-weight: 600;
color: var(--tooltip-text);
pointer-events: none;
display: none;
z-index: 200;
white-space: nowrap;
box-shadow: var(--shadow);
}