Unfortunately, the link provided is not functional, making it difficult to provide a direct solution without access to the actual code. However, I can offer guidance on creating a hover animation effect. It's essential to review the comments within the CSS code to understand the implementation.
.wrapper {
width: 100%;
height: 100vh;
background: pink;
display: flex;
justify-content: space-around;
align-items: center;
}
.child {
padding: 15vh;
background: skyblue;
color: red;
transition: 0.5s;
}
.child:hover {
background: white;
color: blue;
}
<div class="wrapper">
<div class="child">
Hello World!
</div>
</div>
If a specific trigger like scrolling to a certain point is desired for the animation, it can be achieved using more advanced CSS or with the assistance of jQuery or JavaScript.
$(document).scroll(function() {
var topOfWindow = $(window).scrollTop();
var bottomOfWindow = topOfWindow + $(window).height();
var topOfChange = $('.child').offset().top;
var bottomOfChange = topOfChange + $('.child').height();
if ((bottomOfChange <= topOfWindow) || (topOfChange >= bottomOfWindow)) {
$('.myClass').css('background-color', 'red');
} else if ((bottomOfChange <= bottomOfWindow) && (topOfChange >= topOfWindow)) {
$('.myClass').css('background-color', 'green');
}
})
.wrapper {
width: 100%;
background: pink;
display: flex;
justify-content: space-around;
align-items: center;
}
.child {
margin: 120vh 0;
padding: 30vh 40vh;
background: skyblue;
}
.myClass {
background-color: red;
padding: 5vh;
transition: 2s;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Scroll down...
<div class="wrapper">
<div class="child">
<div class="myClass">Hello World</div>
</div>
</div>