Skip to content

Commit

Permalink
#7. Add case with the animation of last image in view contacto - cont…
Browse files Browse the repository at this point in the history
…act to scroll-animations.js
  • Loading branch information
RaulDoezon committed Feb 14, 2018
1 parent f1725be commit 3c83ac6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/js/scroll-animations.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,27 @@ switch (window.location.pathname) {
});
break;

case '/project-dimsa/contacto.html':
case '/contacto.html':
var scrollContact = {
containerScroll: '.home-container',
elContact: '.contact-separator',
animationContact: 'fadeInDown'
};

window.addEventListener('scroll', function(){
var containerHeigh = window.innerHeight;
var positionContact = document.querySelector(scrollContact.elContact).getBoundingClientRect().top;
var elementContact = document.querySelector(scrollContact.elContact);

if (positionContact < containerHeigh) {
elementContact.classList.add(scrollContact.animationContact);
} else {
elementContact.classList.remove(scrollContact.animationContact);
}
});
break;

default:
break;
}

0 comments on commit 3c83ac6

Please sign in to comment.