|
9 | 9 | :root { |
10 | 10 | --bg: #0d1117; |
11 | 11 | --panel: #161b22; |
12 | | - --line: #21262d; |
13 | | - --text: #c9d1d9; |
| 12 | + --line: #30363d; |
| 13 | + --text: #e6edf3; |
14 | 14 | --muted: #8b949e; |
15 | 15 | --accent: #58a6ff; |
16 | 16 | --active: #1f6feb; |
17 | 17 | --ln: #6e7681; |
| 18 | + --header-bg: #161b22; |
| 19 | + --border-radius: 12px; |
18 | 20 | } |
19 | 21 | body { |
20 | 22 | background: var(--bg); |
21 | 23 | color: var(--text); |
22 | | - font-family: "SF Mono", "Fira Code", "Consolas", "Courier New", monospace; |
23 | | - font-size: 13px; |
24 | | - line-height: 1.5; |
| 24 | + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; |
| 25 | + font-size: 14px; |
| 26 | + line-height: 1.6; |
25 | 27 | min-height: 100vh; |
| 28 | + -webkit-font-smoothing: antialiased; |
26 | 29 | } |
27 | 30 | .wrap { |
28 | | - max-width: 1600px; |
| 31 | + max-width: 1400px; |
29 | 32 | margin: 0 auto; |
30 | | - padding: 14px; |
| 33 | + padding: 40px 20px; |
31 | 34 | } |
32 | | - h1 { |
33 | | - font-size: 24px; |
34 | | - color: var(--accent); |
| 35 | + header { |
35 | 36 | text-align: center; |
36 | | - margin-bottom: 6px; |
| 37 | + margin-bottom: 40px; |
| 38 | + } |
| 39 | + h1 { |
| 40 | + font-size: 32px; |
| 41 | + font-weight: 600; |
| 42 | + color: var(--text); |
| 43 | + margin-bottom: 12px; |
| 44 | + letter-spacing: -0.5px; |
37 | 45 | } |
38 | 46 | .subtitle { |
39 | | - text-align: center; |
40 | 47 | color: var(--muted); |
41 | | - font-size: 12px; |
42 | | - margin-bottom: 12px; |
| 48 | + font-size: 16px; |
| 49 | + max-width: 600px; |
| 50 | + margin: 0 auto 24px; |
43 | 51 | } |
44 | 52 | .toolbar { |
45 | 53 | display: flex; |
46 | 54 | justify-content: center; |
47 | | - gap: 8px; |
48 | | - margin-bottom: 12px; |
49 | | - flex-wrap: wrap; |
| 55 | + gap: 12px; |
| 56 | + margin-bottom: 32px; |
50 | 57 | } |
51 | 58 | .btn { |
52 | | - border: 1px solid #30363d; |
53 | | - background: #161b22; |
| 59 | + border: 1px solid var(--line); |
| 60 | + background: var(--panel); |
54 | 61 | color: var(--text); |
55 | | - padding: 6px 10px; |
56 | | - font-size: 12px; |
| 62 | + padding: 8px 16px; |
| 63 | + font-size: 14px; |
| 64 | + font-weight: 500; |
57 | 65 | border-radius: 6px; |
58 | 66 | cursor: pointer; |
| 67 | + transition: all 0.2s cubic-bezier(0.3, 0, 0.5, 1); |
| 68 | + } |
| 69 | + .btn:hover { |
| 70 | + background: #30363d; |
| 71 | + border-color: #8b949e; |
59 | 72 | } |
60 | | - .btn:hover { border-color: var(--accent); } |
61 | 73 | .btn.active { |
62 | 74 | background: var(--active); |
63 | | - border-color: var(--active); |
| 75 | + border-color: rgba(255, 255, 255, 0.1); |
64 | 76 | color: #fff; |
65 | 77 | } |
66 | | - .hint { |
67 | | - text-align: center; |
68 | | - color: var(--muted); |
69 | | - font-size: 11px; |
70 | | - margin-bottom: 10px; |
71 | | - } |
72 | 78 | .grid { |
73 | 79 | display: grid; |
74 | 80 | grid-template-columns: 1fr 1fr; |
75 | | - gap: 10px; |
| 81 | + gap: 20px; |
76 | 82 | } |
77 | 83 | .panel { |
78 | 84 | border: 1px solid var(--line); |
79 | | - border-radius: 8px; |
| 85 | + border-radius: var(--border-radius); |
80 | 86 | overflow: hidden; |
81 | | - background: var(--panel); |
82 | | - min-height: 70vh; |
| 87 | + background: #010409; |
| 88 | + box-shadow: 0 8px 24px rgba(0,0,0,0.2); |
83 | 89 | display: flex; |
84 | 90 | flex-direction: column; |
| 91 | + height: 800px; |
85 | 92 | } |
86 | | - .panel.hidden { display: none; } |
87 | 93 | .panel-header { |
88 | | - background: #0f141b; |
| 94 | + background: var(--header-bg); |
89 | 95 | border-bottom: 1px solid var(--line); |
90 | | - padding: 8px 10px; |
| 96 | + padding: 12px 16px; |
91 | 97 | display: flex; |
92 | 98 | justify-content: space-between; |
93 | 99 | align-items: center; |
94 | 100 | } |
95 | 101 | .panel-title { |
96 | | - color: var(--accent); |
97 | | - font-size: 12px; |
| 102 | + color: var(--text); |
| 103 | + font-size: 14px; |
98 | 104 | font-weight: 600; |
| 105 | + display: flex; |
| 106 | + align-items: center; |
| 107 | + gap: 8px; |
| 108 | + } |
| 109 | + .panel-title::before { |
| 110 | + content: ""; |
| 111 | + display: inline-block; |
| 112 | + width: 8px; |
| 113 | + height: 8px; |
| 114 | + border-radius: 50%; |
| 115 | + background: var(--accent); |
99 | 116 | } |
100 | 117 | .panel-meta { |
101 | 118 | color: var(--muted); |
102 | | - font-size: 11px; |
| 119 | + font-size: 12px; |
| 120 | + font-family: inherit; |
103 | 121 | } |
104 | 122 | .code-scroll { |
105 | 123 | overflow: auto; |
106 | | - height: 100%; |
| 124 | + flex: 1; |
| 125 | + background: #0d1117; |
107 | 126 | } |
108 | 127 | .line { |
109 | 128 | display: flex; |
110 | | - border-bottom: 1px solid rgba(33,38,45,0.35); |
| 129 | + font-family: "ui-monospace", "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; |
| 130 | + font-size: 12px; |
111 | 131 | } |
112 | 132 | .ln { |
113 | | - width: 56px; |
114 | | - min-width: 56px; |
| 133 | + width: 48px; |
| 134 | + min-width: 48px; |
115 | 135 | text-align: right; |
116 | 136 | color: var(--ln); |
117 | | - padding: 0 10px 0 0; |
| 137 | + padding: 0 12px; |
118 | 138 | user-select: none; |
| 139 | + background: #0d1117; |
119 | 140 | border-right: 1px solid var(--line); |
120 | | - background: #0f141b; |
| 141 | + opacity: 0.6; |
121 | 142 | } |
122 | 143 | .code { |
123 | 144 | white-space: pre; |
124 | | - padding: 0 10px; |
125 | | - width: 100%; |
126 | | - color: var(--text); |
| 145 | + padding: 0 16px; |
| 146 | + color: #e6edf3; |
| 147 | + } |
| 148 | + /* Scrollbar Styling */ |
| 149 | + .code-scroll::-webkit-scrollbar { |
| 150 | + width: 10px; |
| 151 | + height: 10px; |
| 152 | + } |
| 153 | + .code-scroll::-webkit-scrollbar-track { |
| 154 | + background: #0d1117; |
| 155 | + } |
| 156 | + .code-scroll::-webkit-scrollbar-thumb { |
| 157 | + background: #30363d; |
| 158 | + border-radius: 10px; |
| 159 | + border: 2px solid #0d1117; |
127 | 160 | } |
| 161 | + .code-scroll::-webkit-scrollbar-thumb:hover { |
| 162 | + background: #484f58; |
| 163 | + } |
| 164 | + |
128 | 165 | .view-python .panel-cuda { display: none; } |
129 | 166 | .view-cuda .panel-python { display: none; } |
130 | | - .view-python .grid, |
131 | | - .view-cuda .grid { grid-template-columns: 1fr; } |
132 | | - @media (max-width: 1100px) { |
| 167 | + .view-python .grid, .view-cuda .grid { grid-template-columns: 1fr; } |
| 168 | + |
| 169 | + @media (max-width: 1000px) { |
133 | 170 | .grid { grid-template-columns: 1fr; } |
| 171 | + .panel { height: 600px; } |
134 | 172 | } |
135 | 173 | </style> |
136 | 174 | </head> |
137 | 175 | <body class="view-bilingual"> |
138 | 176 | <div class="wrap"> |
139 | | - <h1>microgpt Code Converter</h1> |
140 | | - <div class="subtitle">Python and CUDA versions as bilingual documents: switch or compare side by side.</div> |
141 | | - |
142 | | - <div class="toolbar"> |
143 | | - <button class="btn" data-view="python">Python View</button> |
144 | | - <button class="btn" data-view="cuda">CUDA View</button> |
145 | | - <button class="btn active" data-view="bilingual">Bilingual View</button> |
146 | | - </div> |
147 | | - <div class="hint">This page behaves like a language-version converter: same project, two implementation languages.</div> |
| 177 | + <header> |
| 178 | + <h1>MicroGPT Dashboard</h1> |
| 179 | + <div class="subtitle">A minimalist GPT-2 implementation in pure Python vs CUDA/C++. Cross-platform bilingual code documentation.</div> |
| 180 | + <div class="toolbar"> |
| 181 | + <button class="btn" data-view="python">Python Implementation</button> |
| 182 | + <button class="btn" data-view="cuda">CUDA Kernel</button> |
| 183 | + <button class="btn active" data-view="bilingual">Side-by-Side Compare</button> |
| 184 | + </div> |
| 185 | + </header> |
148 | 186 |
|
149 | 187 | <div class="grid"> |
150 | | - <section class="panel panel-python" id="panel-python"> |
| 188 | + <section class="panel panel-python"> |
151 | 189 | <div class="panel-header"> |
152 | | - <div class="panel-title">Python (microgpt.py)</div> |
| 190 | + <div class="panel-title">microgpt.py</div> |
153 | 191 | <div class="panel-meta" id="meta-python"></div> |
154 | 192 | </div> |
155 | 193 | <div class="code-scroll" id="scroll-python"></div> |
156 | 194 | </section> |
157 | 195 |
|
158 | | - <section class="panel panel-cuda" id="panel-cuda"> |
| 196 | + <section class="panel panel-cuda"> |
159 | 197 | <div class="panel-header"> |
160 | | - <div class="panel-title">CUDA/C++ (microgpt_cuda.cu)</div> |
| 198 | + <div class="panel-title">microgpt_cuda.cu</div> |
161 | 199 | <div class="panel-meta" id="meta-cuda"></div> |
162 | 200 | </div> |
163 | 201 | <div class="code-scroll" id="scroll-cuda"></div> |
|
0 commit comments