/landing-page-fem

Landing page challenge by Frontend Mentor

Primary LanguageJavaScriptMIT LicenseMIT

Frontend Mentor - Sunnyside agency landing page solution

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.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the site depending on their device's screen size (375px and 1440px)
  • See hover states for all interactive elements on the page

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • SCSS custom properties
  • Flexbox
  • Mobile-first workflow
  • React - JS library

What I learned

const [windowWidth, setWindowWidth] = useState(window.innerWidth);

useEffect(() => {
  const handleWindowResize = () => {
    setWindowWidth(window.innerWidth);
  };

  window.addEventListener('resize', handleWindowResize);

  return () => {
    window.removeEventListener('resize', handleWindowResize);
  };
});

Useful resources

Author