This is a solution to the Sunnyside agency 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
- Mobile-first workflow
- Basic Javascript
I learnt how to get flexbox to behave as I expected to by using this challenge to experiment the flexbox container and item properties. Background images is something I haven't used much and I faced some difficulties with it and how it behaves, so I got some help by watching a youtube video about it and successfully learnt how to use background images effectively including the properties associated with it. I also learnt how to create a hamburger menu which toggles the navigation menu when clicked.
I added some snippets of code, see below:
.proud-of-this-css {
background-image: url(images/123.jpg);
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
const menuToggle = document.querySelector(".hamburger")
const menu = document.querySelector(".nav__list")
menuToggle.addEventListener("click", toggleMenu)
function toggleMenu() {
if (menu.classList.contains("active")) {
menu.classList.remove("active")
} else {
menu.classList.add("active")
}
}
- Slack - This helped me for when a section of my site was overlapping another.
- Youtube - This is a good tutorial for learning about background-images.
- Frontend Mentor - @ZaidMarrie
I would like to thank some members from the slack community who are part of the FrontEnd Mentor workspace for assisting me where I got stuck and helping me see what I did wrong. I also am grateful for all their feedback. Regards.