This is apart of the 50 projects in 50 days challenge and is the sixth project.
- To create a scroll animation, where the boxes transition to frame as you scroll down. The challenge involves HTML, CSS and Javascript.
- Source code: https://github.com/romila2003/Scroll-Animation
- Live website: https://scroll-animation-main.netlify.app/
- Semantic HTML5 markup
- Plain CSS
- Vanilla Javascript
- Flexbox
I learned more about the window
and getBoundingClientRect()
property within Javascript and its use.
Javascript - close and open navbar:
window.addEventListener("scroll", checkBoxes)
function checkBoxes() {
const triggerBottom = window.innerHeight / 5 * 4;
boxes.forEach(box => {
const boxTop = box.getBoundingClientRect().top;
if(boxTop < triggerBottom) {
box.classList.add("show");
} else {
box.classList.remove("show");
}
})
}
For future developments, I should implement the features/concepts learned over the last few projects and future projects, into practical projects/challenges such as the frontendmentor.io projects.
- Twitter - @romila003
- Frontend Mentor - @romila2003