Skip to content

Commit

Permalink
Improve animation of Color Transform
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Aug 19, 2024
1 parent b5e24fa commit e6f953d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions assets/vendor/astroid/scss/utilities/_animations.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.as-transition-body {
transition: all 300ms;
}

@-webkit-keyframes slideInUp {
from {
-webkit-transform: translate3d(0, 100%, 0);
Expand Down
7 changes: 5 additions & 2 deletions js/colortransform.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
(function ($) {
window.addEventListener("load", (event) => {
$(document).ready(function (){
$('body').addClass('as-transition-body');
})
$(window).on('load', function () {
window.onscroll = function(ev) {
if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight * (ASTROID_COLOR_TRANSFORM.offset/100)) {
if ($('html').attr('data-bs-theme') === ASTROID_COLOR_TRANSFORM.from) {
Expand All @@ -11,5 +14,5 @@
}
}
};
});
})
}(jQuery));
2 changes: 1 addition & 1 deletion js/colortransform.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e6f953d

Please sign in to comment.