Skip to content

Commit

Permalink
fade animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrishik-Koley committed Nov 26, 2024
1 parent 7274592 commit 2ad8db0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ defaultContentLanguage = "en"
# Integrate Javascript files or stylesheets by adding the url to the external assets or by
# linking local files with their path relative to the static folder, e.g. "css/styles.css"
#
customCSS = []
customJS = []
customCSS = "/fonts/css/fade.css"
customJS = "/fonts/js/fade.js"

# Toggle this option need to rebuild SCSS, requires extended version of Hugo
#
Expand Down
9 changes: 9 additions & 0 deletions static/fonts/css/fade.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.fade-in-hidden {
opacity: 0; /* Hidden by default */
transition: opacity 4s ease-in; /* Smooth fade-in over 4 seconds */
}

.fade-in-visible {
opacity: 1; /* Fully visible */
}

8 changes: 8 additions & 0 deletions static/fonts/js/fade.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Add this in your JavaScript file (e.g., `assets/js/main.js`) or inline
document.addEventListener("DOMContentLoaded", function () {
const fadeInElement = document.getElementById("fade-in-element");

// Add the 'fade-in-visible' class to start the fade-in effect
fadeInElement.classList.add("fade-in-visible");
});

0 comments on commit 2ad8db0

Please sign in to comment.