head.html (3692B)
1 <meta charset="utf-8"> 2 <meta name="viewport" content="width=device-width, initial-scale=1"> 3 <link rel="icon" type="image/x-icon" href="/static/profile.png"> 4 5 <script> 6 (function () { 7 var theme = null; 8 try { 9 theme = localStorage.getItem("theme"); 10 } catch (e) {} 11 if (theme === "light" || theme === "dark") 12 document.documentElement.setAttribute("data-theme", theme); 13 14 function current() { 15 var t = document.documentElement.getAttribute("data-theme"); 16 if (t) 17 return t; 18 return window.matchMedia("(prefers-color-scheme: dark)").matches 19 ? "dark" : "light"; 20 } 21 22 document.addEventListener("DOMContentLoaded", function () { 23 var button = document.getElementById("themetoggle"); 24 if (!button) 25 return; 26 function label() { 27 button.textContent = current() === "dark" ? "Light" : "Dark"; 28 } 29 label(); 30 button.hidden = false; 31 button.addEventListener("click", function () { 32 var next = current() === "dark" ? "light" : "dark"; 33 document.documentElement.setAttribute("data-theme", next); 34 try { 35 localStorage.setItem("theme", next); 36 } catch (e) {} 37 label(); 38 }); 39 window.matchMedia("(prefers-color-scheme: dark)") 40 .addEventListener("change", label); 41 }); 42 })(); 43 </script> 44 45 <style> 46 /* Light: Tomorrow. */ 47 :root { 48 font-family: sans-serif; 49 color-scheme: light; 50 --bg: #ffffff; 51 --fg: #4d4d4c; 52 --link: #4271ae; 53 --visited: #8959a8; 54 --code: #718c00; 55 --quote: #6e6e6d; 56 } 57 58 /* Dark: Tomorrow Night Bright. */ 59 @media (prefers-color-scheme: dark) { 60 :root:not([data-theme="light"]) { 61 color-scheme: dark; 62 --bg: #000000; 63 --fg: #eaeaea; 64 --link: #7aa6da; 65 --visited: #c397d8; 66 --code: #b9ca4a; 67 --quote: #c4c4c4; 68 } 69 } 70 71 :root[data-theme="dark"] { 72 color-scheme: dark; 73 --bg: #000000; 74 --fg: #eaeaea; 75 --link: #7aa6da; 76 --visited: #c397d8; 77 --code: #b9ca4a; 78 --quote: #c4c4c4; 79 } 80 81 html { 82 background-color: var(--bg); 83 color: var(--fg); 84 } 85 86 a { 87 color: var(--link); 88 text-decoration: none; 89 } 90 91 a:visited { 92 color: var(--visited); 93 text-decoration: none; 94 } 95 96 code { 97 font-family: monospace, monospace; 98 font-size: small; 99 color: var(--code); 100 } 101 102 #navlist { 103 list-style-type: none; 104 margin: 0; 105 padding: 0; 106 } 107 108 #themetoggle { 109 background: none; 110 border: none; 111 padding: 0; 112 font: inherit; 113 color: var(--link); 114 cursor: pointer; 115 } 116 117 #navlistitem { 118 display: inline; 119 padding-right: 2.5rem; 120 } 121 122 footer { 123 text-align: center; 124 bottom: 0; 125 } 126 127 #content { 128 padding-bottom: 4em; 129 } 130 131 #content p, #content li { 132 text-align: justify; 133 hyphens: auto; 134 } 135 136 /* Verse lines that wrap on narrow screens must not be stretched. */ 137 #content p.verse { 138 text-align: left; 139 hyphens: manual; 140 } 141 142 img { 143 max-width: 80vw; 144 max-height: 80vh; 145 } 146 147 h1 { 148 text-align: center; 149 } 150 151 blockquote { 152 color: var(--quote); 153 } 154 155 header { 156 text-align: center; 157 } 158 159 #bigtitle { 160 color: var(--fg); 161 } 162 163 #date { 164 padding-top: 2em; 165 } 166 167 @media (min-width:801px) { 168 #content { 169 margin-left: 25vw; 170 margin-right: 25vw; 171 } 172 173 #date { 174 margin-left: 25vw; 175 margin-right: 25vw; 176 text-align: center; 177 } 178 179 img { 180 display: block; 181 margin-left: auto; 182 margin-right: auto; 183 max-width: 50vw; 184 } 185 } 186 </style>