|
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
6 | 6 | <title>@TARGET_TITLE@</title> |
| 7 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.min.css" id="theme-stylesheet"> |
7 | 8 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@AT@xterm/xterm@AT@6.0.0/css/xterm.css"> |
8 | 9 | <style> |
9 | | - * { |
10 | | - margin: 0; |
11 | | - padding: 0; |
12 | | - box-sizing: border-box; |
13 | | - } |
14 | | - |
15 | | - body { |
16 | | - background-color: #1a1a2e; |
17 | | - color: #eee; |
18 | | - font-family: monospace; |
19 | | - min-height: 100vh; |
20 | | - display: flex; |
21 | | - flex-direction: column; |
22 | | - align-items: center; |
23 | | - justify-content: center; |
24 | | - } |
25 | | - |
26 | | - #container { |
27 | | - max-width: 900px; |
28 | | - width: 100%; |
29 | | - padding: 20px; |
30 | | - } |
31 | | - |
32 | | - h1 { |
33 | | - text-align: center; |
34 | | - margin-bottom: 20px; |
35 | | - color: #e94560; |
36 | | - } |
37 | | - |
| 10 | + body { max-width: 1000px; } |
| 11 | + header { text-align: center; } |
| 12 | + fieldset { text-align: center; border: none; } |
38 | 13 | #terminal { |
39 | | - margin: 0 auto; |
40 | | - border: 2px solid #e94560; |
41 | | - background-color: #0f0f23; |
42 | | - } |
43 | | - |
44 | | - #loading { |
45 | | - text-align: center; |
46 | | - padding: 50px; |
| 14 | + margin: 2rem auto; |
| 15 | + border: 1px solid var(--border); |
| 16 | + border-radius: 4px; |
| 17 | + overflow: hidden; |
47 | 18 | } |
48 | | - |
| 19 | + #loading { text-align: center; padding: 3rem 1rem; } |
49 | 20 | .spinner { |
50 | | - border: 4px solid #16213e; |
51 | | - border-top: 4px solid #e94560; |
| 21 | + border: 4px solid var(--background-alt); |
| 22 | + border-top: 4px solid var(--links); |
52 | 23 | border-radius: 50%; |
53 | 24 | width: 40px; |
54 | 25 | height: 40px; |
55 | 26 | animation: spin 1s linear infinite; |
56 | | - margin: 20px auto; |
| 27 | + margin: 0 auto 1rem; |
57 | 28 | } |
58 | | - |
59 | 29 | @keyframes spin { |
60 | 30 | 0% { transform: rotate(0deg); } |
61 | 31 | 100% { transform: rotate(360deg); } |
62 | 32 | } |
63 | | - |
64 | 33 | #error { |
65 | 34 | display: none; |
66 | | - background-color: #ff4444; |
| 35 | + background-color: #d32f2f; |
67 | 36 | color: white; |
68 | | - padding: 15px; |
69 | | - border-radius: 8px; |
70 | | - margin-top: 20px; |
| 37 | + padding: 1rem; |
| 38 | + border-radius: 4px; |
| 39 | + margin-top: 1rem; |
71 | 40 | } |
72 | | - |
73 | | - .hidden { |
74 | | - display: none !important; |
| 41 | + section { |
| 42 | + margin-top: 2rem; |
| 43 | + padding: 1.5rem; |
| 44 | + background-color: var(--background-alt); |
| 45 | + border-radius: 4px; |
75 | 46 | } |
| 47 | + .hidden { display: none !important; } |
76 | 48 | </style> |
77 | 49 | </head> |
78 | 50 | <body> |
79 | 51 | <!-- Service worker for COOP/COEP headers on GitHub Pages --> |
80 | 52 | <script src="coi-serviceworker.min.js"></script> |
81 | 53 |
|
82 | | - <div id="container"> |
83 | | - <h1>@TARGET_NAME@</h1> |
| 54 | + <main> |
| 55 | + <fieldset> |
| 56 | + <label><input type="radio" name="theme" value="auto" checked> Auto</label> |
| 57 | + <label><input type="radio" name="theme" value="light"> Light</label> |
| 58 | + <label><input type="radio" name="theme" value="dark"> Dark</label> |
| 59 | + </fieldset> |
| 60 | + |
| 61 | + <header> |
| 62 | + <h1>@TARGET_NAME@</h1> |
| 63 | + </header> |
84 | 64 |
|
85 | 65 | <div id="loading"> |
86 | 66 | <div class="spinner"></div> |
|
92 | 72 |
|
93 | 73 | <div id="error"></div> |
94 | 74 |
|
95 | | - <div id="usage-info" style="margin-top: 30px; padding: 20px; background-color: #16213e; border-radius: 8px; font-size: 13px; line-height: 1.6;"> |
96 | | - <h3 style="color: #e94560; margin-bottom: 15px;">Command-Line Arguments via URL</h3> |
97 | | - <p style="margin-bottom: 10px;">Pass command-line arguments to the application using URL parameters:</p> |
98 | | - |
99 | | - <div style="margin-bottom: 15px;"> |
100 | | - <strong style="color: #e94560;">Conversion Rules:</strong> |
101 | | - <ul style="list-style: none; padding-left: 0; margin-top: 5px;"> |
102 | | - <li>• Single-character params → short flags: <code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">?v</code> → <code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">-v</code></li> |
103 | | - <li>• Multi-character params → long flags: <code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">?version</code> → <code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">--version</code></li> |
104 | | - <li>• Params with values: <code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">?file=test.txt</code> → <code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">--file test.txt</code></li> |
105 | | - <li>• Multiple params: <code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">?v&help</code> → <code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">-v --help</code></li> |
106 | | - </ul> |
107 | | - </div> |
108 | | - |
109 | | - <div> |
110 | | - <strong style="color: #e94560;">Examples:</strong> |
111 | | - <ul style="list-style: none; padding-left: 0; margin-top: 5px; color: #888;"> |
112 | | - <li><code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">intro.html?version</code></li> |
113 | | - <li><code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">intro.html?h</code></li> |
114 | | - <li><code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">intro.html?file=data.txt</code></li> |
115 | | - <li><code style="background-color: #0f0f23; padding: 2px 6px; border-radius: 3px;">intro.html?verbose&config=settings.json</code></li> |
116 | | - </ul> |
117 | | - </div> |
118 | | - </div> |
119 | | - </div> |
| 75 | + <section> |
| 76 | + <h3>Command-Line Arguments via URL</h3> |
| 77 | + <p>Pass command-line arguments to the application using URL parameters:</p> |
| 78 | + |
| 79 | + <strong>Conversion Rules:</strong> |
| 80 | + <ul> |
| 81 | + <li>• Single-character params → short flags: <code>?v</code> → <code>-v</code></li> |
| 82 | + <li>• Multi-character params → long flags: <code>?version</code> → <code>--version</code></li> |
| 83 | + <li>• Params with values: <code>?file=test.txt</code> → <code>--file test.txt</code></li> |
| 84 | + <li>• Multiple params: <code>?v&help</code> → <code>-v --help</code></li> |
| 85 | + </ul> |
| 86 | + |
| 87 | + <strong>Examples:</strong> |
| 88 | + <ul> |
| 89 | + <li><code>intro.html?version</code></li> |
| 90 | + <li><code>intro.html?h</code></li> |
| 91 | + <li><code>intro.html?file=data.txt</code></li> |
| 92 | + <li><code>intro.html?verbose&config=settings.json</code></li> |
| 93 | + </ul> |
| 94 | + </section> |
| 95 | + </main> |
120 | 96 |
|
121 | 97 | <script> |
122 | 98 | // Define Module configuration FIRST (synchronously, before Emscripten loads) |
|
310 | 286 | window.term = term; |
311 | 287 | window.fitAddon = fitAddon; |
312 | 288 | </script> |
| 289 | + |
| 290 | + <script> |
| 291 | + const themeStylesheet = document.getElementById('theme-stylesheet'); |
| 292 | + const themeRadios = document.querySelectorAll('input[name="theme"]'); |
| 293 | + const themes = { |
| 294 | + auto: 'https://cdn.jsdelivr.net/npm/water.css@2/out/water.min.css', |
| 295 | + light: 'https://cdn.jsdelivr.net/npm/water.css@2/out/light.min.css', |
| 296 | + dark: 'https://cdn.jsdelivr.net/npm/water.css@2/out/dark.min.css' |
| 297 | + }; |
| 298 | + |
| 299 | + // Load saved theme preference |
| 300 | + const savedTheme = localStorage.getItem('theme') || 'auto'; |
| 301 | + themeStylesheet.href = themes[savedTheme]; |
| 302 | + document.querySelector(`input[value="${savedTheme}"]`).checked = true; |
| 303 | + |
| 304 | + // Handle theme changes |
| 305 | + themeRadios.forEach(radio => { |
| 306 | + radio.addEventListener('change', (e) => { |
| 307 | + const theme = e.target.value; |
| 308 | + themeStylesheet.href = themes[theme]; |
| 309 | + localStorage.setItem('theme', theme); |
| 310 | + }); |
| 311 | + }); |
| 312 | + </script> |
| 313 | + |
313 | 314 | {{{ SCRIPT }}} |
314 | 315 | </body> |
315 | 316 | </html> |
0 commit comments