sticky header - lazyload - navbar - floatingpoints

This commit is contained in:
Tancre
2020-10-22 00:00:04 +02:00
parent 9d06322a82
commit 5d4331954f
19 changed files with 294 additions and 69 deletions

View File

@ -0,0 +1,31 @@
import $ from 'jquery';
import waypoints from '../../../../node_modules/waypoints/lib/noframework.waypoints';
class RevealOnScroll {
constructor(els, offset){
this.itemsToReveal = els;
this.offsetPercentage = offset;
this.hideInitially();
this.createWaypoints();
}
hideInitially() {
this.itemsToReveal.addClass("reveal-item");
}
createWaypoints() {
var that = this;
this.itemsToReveal.each( function(){
var currentItem = this;
new Waypoint({
element: currentItem,
handler: function() {
$(currentItem).addClass("reveal-item--is-visible");
},
offset: that.offsetPercentage
});
});
}
}
export default RevealOnScroll;