Guest User

Untitled

a guest
Aug 25th, 2019
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const navSlide = () => {
  2. const burger = document.querySelector('.burger');
  3. const nav = document.querySelector('.nav-links');
  4. const navLinks = document.querySelectorAll('.nav-links li');
  5.  
  6.  
  7. burger.addEventListener('click', () => {
  8. //Toogle Nav
  9. nav.classList.toggle('nav-active');
  10.  
  11. //Animate Links
  12. navLinks.forEach((link, index) => {
  13. if (link.style.animation) {
  14. link.style.animation = '';
  15. } else {
  16. link.style.animation = 'navLinkFade 0.5s ease forwards ${index / 7 + 0.3}s';
  17. }
  18. });
  19. });
  20. }
  21.  
  22. navSlide();
RAW Paste Data