From 59d903d4009b9fa492c12fb24580aee5e39bfab9 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Thu, 4 Jun 2026 10:06:22 +0200 Subject: [PATCH] refactor: consolidate skeleton styles into global css --- static/assets/style.css | 27 +++++++++++++++++++++++++++ templates/anime.gohtml | 20 ++++++++++---------- templates/discover.gohtml | 18 +++--------------- templates/index.gohtml | 24 +++++------------------- templates/schedule.gohtml | 12 ++++++------ 5 files changed, 51 insertions(+), 50 deletions(-) diff --git a/static/assets/style.css b/static/assets/style.css index 073eda2..2d795e4 100644 --- a/static/assets/style.css +++ b/static/assets/style.css @@ -17,6 +17,8 @@ :root { color-scheme: light dark; + --skeleton-base: light-dark(#e5e5e5, #1f1f1f); + --skeleton-highlight: light-dark(#d4d4d4, #2a2a2a); --bg: var(--color-background); --panel: light-dark(#f7f7f7, #181818); --panel-soft: light-dark(#ececec, #202020); @@ -61,6 +63,31 @@ body { color: var(--text); } +.skeleton { + background: linear-gradient( + 90deg, + var(--skeleton-base) 25%, + var(--skeleton-highlight) 50%, + var(--skeleton-base) 75% + ); + background-size: 200% 100%; + animation: skeleton-loading 1.5s infinite; +} + +.skeleton-subtle { + opacity: 0.7; +} + +@keyframes skeleton-loading { + 0% { + background-position: 200% 0; + } + + 100% { + background-position: -200% 0; + } +} + [data-watchlist-toggle] .watchlist-icon, [data-watchlist-toggle] .watchlist-icon path { fill: none; diff --git a/templates/anime.gohtml b/templates/anime.gohtml index 3123da3..555a397 100644 --- a/templates/anime.gohtml +++ b/templates/anime.gohtml @@ -262,9 +262,9 @@

Statistics

-
+
{{range (seq 5)}} -
+
{{end}}
@@ -299,13 +299,13 @@

Characters & Cast

-
+
{{range (seq 5)}} -
-
+
+
-
-
+
+
{{end}} @@ -325,11 +325,11 @@

Recommendations

-
+
{{range (seq 8)}}
-
-
+
+
{{end}}
diff --git a/templates/discover.gohtml b/templates/discover.gohtml index 569eec7..2a67fe1 100644 --- a/templates/discover.gohtml +++ b/templates/discover.gohtml @@ -74,18 +74,6 @@ grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; } - .skeleton { - background: light-dark( - linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%), - linear-gradient(90deg, #1f1f1f 25%, #2a2a2a 50%, #1f1f1f 75%) - ); - background-size: 200% 100%; - animation: skeleton-loading 1.5s infinite; - } - @keyframes skeleton-loading { - 0% { background-position: 200% 0; } - 100% { background-position: -200% 0; } - } {{end}} @@ -109,9 +97,9 @@
{{range (seq 8)}}
-
-
-
+
+
+
{{end}}
diff --git a/templates/index.gohtml b/templates/index.gohtml index 229b36c..cacebe8 100644 --- a/templates/index.gohtml +++ b/templates/index.gohtml @@ -34,20 +34,6 @@
- {{end}} {{define "catalog_section"}} @@ -68,8 +54,8 @@
{{range (seq 6)}}
-
-
+
+
{{end}}
@@ -81,9 +67,9 @@
{{range (seq 3)}}
-
-
-
+
+
+
{{end}}
diff --git a/templates/schedule.gohtml b/templates/schedule.gohtml index e6161c8..83dc1f3 100644 --- a/templates/schedule.gohtml +++ b/templates/schedule.gohtml @@ -222,18 +222,18 @@
-
-
+
+
-
+
{{range (seq 3)}}
-
+
-
-
+
+
{{end}}