GithubHelp home page GithubHelp logo

viniciusshenri96 / creative-agency-single-page-site Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 6.23 MB

My solution to the Creative agency single-page site challenge from the Mentor frontend site with HTML, CSS and JS

License: MIT License

HTML 28.89% CSS 58.93% JavaScript 12.18%
css dom-manipulation html-css-javascript responsive

creative-agency-single-page-site's Introduction

Creative agency single-page site

ย 

๐Ÿšง Creative agency single-page site ๐ŸŸข Completed ๐Ÿš€ ๐Ÿšง

ย 

Project description ๐Ÿ“š

This is a solution to the challenge Creative agency single-page site.

This project was a great challenge to put JavaScript into practice, and deepen my knowledge in HTML, CSS

Challenge Difficulty - Junior

ย 

What did I put into practice?

  • I learned to use the keydown event to use the keyboard arrows to move the slide with short circuit
// Slide with keydown
document.addEventListener("keydown", function (e) {
  // short circuit
  e.key === "ArrowRight" && nextSlide();
  e.key === "ArrowLeft" && prevSlide();
});
  • I developed my first mobile menu in this project

  • Revealing Elements on Scroll with IntersectionObserver

  • Implementing Smooth Scrolling with scrollIntoView

  • Menu mobile setTimeout, bubble and events

  • Menu fade animation with Closures, closest() and Math strategy, mouseover, mouseout

  • Revealing Elements on Scroll with new IntersectionObserver

  • Building a Slider Component with Events and quite logica.

  • I used grid area, so that the elements were in the same row and in the same column, with that I just positioned inside the grid. this is only possible by defining the parent element with display:grid and the children grid-area: 1/1, for that I also used reusable class, and in HTML I put the class where it should

.grid-layout {
  display: grid;
}
.grid-area {
  grid-area: 1 / 1;
}
  • The function created inside the menuAnimation function, will have access to the parameter of the parent function (opacity), even after it is executed, this happens because of the closure
const menuAnimation = function (opacity) {
  return function (e) {
    const clicked = e.target.closest(".nav__link");

    if (!clicked) return;

    if (clicked.classList.contains("nav__link")) {
      const link = e.target;
      const sibling = document.querySelectorAll(".nav__link");
      const logo = nav.closest(".header-box").querySelector(".header__logo");

      sibling.forEach((el) => {
        if (el !== link) el.style.opacity = opacity;
      });
      logo.style.opacity = opacity;
    }
  };
};

nav.addEventListener("mouseover", menuAnimation(0.5));
nav.addEventListener("mouseout", menuAnimation(1));

ย 

Links

ย 

My process

Built with

ย 

Responsive ๐Ÿ“ฑ - Mobile/Tablet/Desktop

Art gallery website Art gallery website Art gallery website

ย 

๐Ÿ‘จโ€๐Ÿ’ป Author

creative-agency-single-page-site's People

Contributors

viniciusshenri96 avatar

Stargazers

Chukwudobe Micah Chinedu  avatar Luana Cardoso avatar Jhonatan Oliveira avatar An Lynh Tran avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.