This is a solution to the Easybank landing page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the site depending on their device's screen size
- See hover states for all interactive elements on the page
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- SASS - Sass StyleSheet language
- Vanilla JS
I learned how to make use of the SASS stylesheet language in a real time project. And also how to make proper use of the CSS grid, and CSS flexbox properties in an actual website design proces.
I learned about seperation of concerns in SASS, placing styles of similar intent in thesame sass file.
I also learned how to implement animations in a website design, as seen in the sass snippet below
.has-fade{
visibility: hidden;
}
@keyframes fadeIn {
from{
visibility: hidden;
opacity: 0;
}
1%{
visibility: visible;
opacity: 0;
}
to{
visibility: visible;
opacity: 1;
}
}
.fade-in{
animation: fadeIn 200ms ease-in-out forwards;
}
@keyframes fadeOut {
from{
visibility: visible;
opacity: 1;
}
99%{
visibility: visible;
opacity: 0;
}
to{
visibility: hidden;
opacity: 0;
}
}
.fade-out{
animation: fadeOut 300ms ease-in-out forwards;
}Appart from SASS, i learned how to use JavaScript to affect or implement a mobile navigation with an overlay as seen in the snippet below
const mobileBtn = document.querySelector("#mobileBtn");
const header = document.querySelector(".header");
const body = document.querySelector("body");
const fadeElements = document.querySelectorAll(".has-fade");
mobileBtn.addEventListener('click', function(){
if(header.classList.contains('open')){
body.classList.remove('no-scroll');
header.classList.remove('open'); //close mobile menu
fadeElements.forEach(function(element){
element.classList.remove('fade-in');
element.classList.add('fade-out');
});
}else{ // open mobile menu
body.classList.add('no-scroll');
header.classList.add('open');
fadeElements.forEach(function(element){
element.classList.remove('fade-out');
element.classList.add('fade-in');
});
}
});
I also learned about the CSS positioning properties.
For more information about SASS, i'll recommend the official SASS documentation SASS documentation to learn more.
In my future projects, i'll continue focusing on the use of sass in modern website designs and also how to make use of javascript in different areas of my design.
- CSS Tricks CSS grid - This helped me Understand a little more about the CSS grid property
- CSS Tricks Animations - I was able to understand more about animations by checking our this content.
- Website - Add your name here
- Frontend Mentor - @agbortoko
- Twitter - @agbortoko_arrey
