From e0e86e964cd45e85176c31b1054ace35f319e5cb Mon Sep 17 00:00:00 2001 From: nat Date: Sun, 11 May 2025 20:35:43 -0700 Subject: [PATCH] improve loading time;improve unstyled content flash --- www/src/assets/style.css | 2 +- www/src/templates/page.hy | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/www/src/assets/style.css b/www/src/assets/style.css index eea117b..e09aca2 100644 --- a/www/src/assets/style.css +++ b/www/src/assets/style.css @@ -37,7 +37,7 @@ --visited-link: #be95ff; --highlight: #33b1ff; - background: url('/assets/bg.svg'); + background: #202020 url('/assets/bg.svg'); background-size: 30px; display: flex; align-items: center; diff --git a/www/src/templates/page.hy b/www/src/templates/page.hy index 1273f0e..aeb9ef2 100644 --- a/www/src/templates/page.hy +++ b/www/src/templates/page.hy @@ -11,8 +11,14 @@ (run "echo > /tmp/footnote_count") `(html (:lang "en") (head () + (style #[[ + :root { + background: #202020; + } + body {display: none}]]) + (link (:rel preload :href "/assets/style.css" :as style)) + (link (:rel preload :href "/assets/bg.svg" :as image)) (link (:rel "stylesheet" :href "/assets/style.css" :type "text/css")) - (link (:rel preload :href "/assets/style.css")) (meta (:http-equiv "content-type" :content "text/html; charset=utf-8")) (meta (:name "viewport" :content "width=device-width, initial-scale=1")) (meta (:name "author" :content ~author))