Skip to content

Commit

Permalink
feat: Enhance page transitions with smooth animations
Browse files Browse the repository at this point in the history
- Add transition class to main content body for improved animation
- Implement new CSS transitions for fade and content body movements
- Adjust transition timing and effects for smoother page loading experience
  • Loading branch information
EvanNotFound committed Nov 19, 2024
1 parent 28c161b commit 0847f0e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layout/page.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<%- partial('components/header/navbar') %>
</div>

<div class="main-content-body">
<div class="main-content-body transition-main-content-body">
<% if (is_home() && theme.home.sidebar.enable === true && theme.home.sidebar.position === "left") { %>
<%- partial('pages/home/home-sidebar') %>
<% } %>
Expand Down
22 changes: 21 additions & 1 deletion source/css/layout/page.styl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,27 @@
transition 0.4s
opacity 1

.transition-main-content-body
transform translateY(0)
opacity 1
transition transform 0.4s ease, opacity 0.4s ease

// Define transitions for both classes
html.is-changing
.transition-fade
transition opacity 0.4s ease
opacity 1

.transition-main-content-body
transition transform 0.4s ease, opacity 0.4s ease
transform translateY(0)
opacity 1

// Define states for unloaded pages
html.is-animating
.transition-fade
opacity 0
transition 0.4s

.transition-main-content-body
transform translateY(20px)
opacity 0

0 comments on commit 0847f0e

Please sign in to comment.