Browse Source

feat(ui): smooth pages transitions

Smooth transitions are pretty nice,
see https://htmhell.dev/adventcalendar/2024/3/
jvoisin 6 months ago
parent
commit
29015903ba
1 changed files with 12 additions and 0 deletions
  1. 12 0
      internal/ui/static/css/common.css

+ 12 - 0
internal/ui/static/css/common.css

@@ -82,6 +82,18 @@ a:hover {
     translate: -50% 0;
     translate: -50% 0;
 }
 }
 
 
+/* Smoother pages transition */
+@media not all and (prefers-reduced-motion: reduce) {
+    @view-transition {
+        navigation: auto;
+    }
+}
+@media (prefers-reduced-motion: reduce) {
+  @view-transition {
+    navigation: none;
+  }
+}
+
 /* Header and main menu */
 /* Header and main menu */
 .header {
 .header {
     margin-top: 10px;
     margin-top: 10px;