|
1 | 1 | <!DOCTYPE html> |
2 | | -<html lang="en" data-theme="dark"> |
| 2 | +<html lang="en"> |
3 | 3 | <head> |
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
6 | 6 | <title>Claude Code Chat Browser</title> |
| 7 | + <script> |
| 8 | + /* Apply saved theme before first paint (avoids dark flash in light mode). |
| 9 | + hljs URLs/integrity must match HLJS_THEME_SHEETS in static/js/shared/theme.js */ |
| 10 | + (function () { |
| 11 | + var t = localStorage.getItem('theme'); |
| 12 | + if (t !== 'light' && t !== 'dark') t = 'dark'; |
| 13 | + document.documentElement.setAttribute('data-theme', t); |
| 14 | + })(); |
| 15 | + </script> |
7 | 16 | <link rel="stylesheet" href="/static/css/style.css"> |
8 | 17 | <!-- SRI hashes pin each CDN asset to a specific known-good payload; the |
9 | 18 | browser refuses anything whose hash does not match (issue #19). |
|
17 | 26 | integrity="sha512-mtXspRdOWHCYp+f4c7CkWGYPPRAhq9X+xCvJMUBVAb6pqA4U8pxhT3RWT3LP3bKbiolYL2CkL1bSKZZO4eeTew==" |
18 | 27 | crossorigin="anonymous" |
19 | 28 | id="hljs-theme"> |
| 29 | + <script> |
| 30 | + (function () { |
| 31 | + var t = document.documentElement.getAttribute('data-theme') || 'dark'; |
| 32 | + if (t !== 'light') return; |
| 33 | + var link = document.getElementById('hljs-theme'); |
| 34 | + if (!link) return; |
| 35 | + link.integrity = 'sha512-0aPQyyeZrWgKOP0mUipLQ6OZXu8l4IcAmD2u31EPEy9VcIMvl7SoAaKe8bLXZhYoMaE/in+gcgA=='; |
| 36 | + link.href = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css'; |
| 37 | + })(); |
| 38 | + </script> |
20 | 39 | <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" |
21 | 40 | integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" |
22 | 41 | crossorigin="anonymous"></script> |
|
44 | 63 | </a> |
45 | 64 | <button id="theme-toggle" class="nav-link" title="Toggle theme" onclick="toggleTheme()"> |
46 | 65 | <svg id="icon-moon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg> |
47 | | - <svg id="icon-sun" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:none"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg> |
| 66 | + <svg id="icon-sun" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg> |
48 | 67 | </button> |
49 | 68 | </div> |
50 | 69 | </div> |
|
0 commit comments