a sledgehammer

This commit is contained in:
dembim 2026-02-02 15:57:24 -05:00
parent 95281c5720
commit 111fc07666
2 changed files with 20 additions and 5 deletions

View file

@ -229,6 +229,14 @@ body {
font-family: "BodySans", sans-serif; font-family: "BodySans", sans-serif;
} }
.js-wait body {
visibility: hidden;
}
.js-ready body {
visibility: visible;
}
h1 { h1 {
font-family: "Heading"; font-family: "Heading";
line-height: 1.2; line-height: 1.2;

View file

@ -4,6 +4,16 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title> <!-- set automatically, see soupault.conf --> </title> <title> <!-- set automatically, see soupault.conf --> </title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<script>
document.documentElement.classList.add("js-wait");
</script>
<script>
const class_ = `font-${window.devicePixelRatio > 1.5 ? 'hidpi' : 'lodpi'}`;
document.documentElement.classList.add(class_);
// document.documentElement.className += ' invert'; // 'invert' to swap colors
</script>
<link rel="stylesheet" href="/css/fonts.css"> <link rel="stylesheet" href="/css/fonts.css">
<link rel="stylesheet" href="/css/layout.css"> <link rel="stylesheet" href="/css/layout.css">
<link rel="stylesheet" href="/css/looks.css"> <link rel="stylesheet" href="/css/looks.css">
@ -11,11 +21,6 @@
<link rel="stylesheet" href="/css/code.css"> <link rel="stylesheet" href="/css/code.css">
<link rel="icon" type="image/png" href="/assets/favicon.png"> <link rel="icon" type="image/png" href="/assets/favicon.png">
<script> <script>
const class_ = `font-${window.devicePixelRatio > 1.5 ? 'hidpi' : 'lodpi'}`;
document.documentElement.className = class_;
// document.documentElement.className += ' invert'; // 'invert' to swap colors
</script>
<script defer>
function fitH1ToContainer(h1) { function fitH1ToContainer(h1) {
const container = h1.closest(".container"); const container = h1.closest(".container");
if (!container || window.devicePixelRatio > 2) return; if (!container || window.devicePixelRatio > 2) return;
@ -74,11 +79,13 @@
}); });
runFitText(); runFitText();
document.documentElement.classList.add("js-ready");
window.addEventListener("resize", runFitText); window.addEventListener("resize", runFitText);
}); });
} }
window.addEventListener("DOMContentLoaded", start); window.addEventListener("DOMContentLoaded", start);
</script> </script>
</head> </head>