From 086ec33d7b7b974f06f8e91ff4bbf7a2c2b466e4 Mon Sep 17 00:00:00 2001 From: Michal Vanko Date: Wed, 9 Oct 2024 11:18:47 +0200 Subject: [PATCH] view transitions with almost no css --- styles/input.css | 15 +++++++++++++ styles/output.css | 22 +++++++++++++++++++ templates/blog_post.html | 4 ++-- templates/components/blog_post_preview.html | 11 ++++++---- .../components/project_preview_card.html | 2 +- templates/post_tag_list.html | 2 +- templates/site_footer.html | 2 +- templates/site_header.html | 2 +- 8 files changed, 50 insertions(+), 10 deletions(-) diff --git a/styles/input.css b/styles/input.css index 42fa8e1..21e09c6 100644 --- a/styles/input.css +++ b/styles/input.css @@ -266,3 +266,18 @@ article a { transform: translate(0, 0); } } + +@view-transition { + navigation: auto; +} + +/* Define the animation for persistent elements (like the header and title) */ +/* ::view-transition-group(*) { */ +/* transition: transform 3.4s ease-in-out; */ +/* } */ + +/* ::view-transition-group(blog_post_preview) { */ +/* animation-duration: 5.5s; */ +/* transition: transform 5.4s ease-in-out; */ +/* opacity: 1; */ +/* } */ diff --git a/styles/output.css b/styles/output.css index 85ef9c9..3169c49 100644 --- a/styles/output.css +++ b/styles/output.css @@ -1908,6 +1908,28 @@ article a:visited { } } +@view-transition { + navigation: auto; +} + +/* Define the animation for persistent elements (like the header and title) */ + +/* ::view-transition-group(*) { */ + +/* transition: transform 3.4s ease-in-out; */ + +/* } */ + +/* ::view-transition-group(blog_post_preview) { */ + +/* animation-duration: 5.5s; */ + +/* transition: transform 5.4s ease-in-out; */ + +/* opacity: 1; */ + +/* } */ + .visited\:text-blue-950:visited { color: rgb(11 39 70 ); } diff --git a/templates/blog_post.html b/templates/blog_post.html index 2930557..72b55fd 100644 --- a/templates/blog_post.html +++ b/templates/blog_post.html @@ -17,12 +17,12 @@ {% block content %}
-

{{title}}

+

{{title}}

diff --git a/templates/components/blog_post_preview.html b/templates/components/blog_post_preview.html index 3843892..c7af659 100644 --- a/templates/components/blog_post_preview.html +++ b/templates/components/blog_post_preview.html @@ -1,4 +1,7 @@ -
+
-

+

{{post.metadata.title}}

{{post.body|truncate_md(2)|parse_markdown|safe}}
-
    + | - +
diff --git a/templates/components/project_preview_card.html b/templates/components/project_preview_card.html index a15cc0a..6aa6fb0 100644 --- a/templates/components/project_preview_card.html +++ b/templates/components/project_preview_card.html @@ -1,4 +1,4 @@ -
+

{% match project.metadata.link %} diff --git a/templates/post_tag_list.html b/templates/post_tag_list.html index 56e8632..0b6a324 100644 --- a/templates/post_tag_list.html +++ b/templates/post_tag_list.html @@ -1,6 +1,6 @@