Initial commit

This commit is contained in:
2020-04-07 13:03:04 +00:00
committed by Gitium
commit 00f842d9bf
1673 changed files with 471161 additions and 0 deletions

View File

@ -0,0 +1,17 @@
function generate_parallax_element( selector, context ) {
context = context || document;
var elements = context.querySelectorAll( selector );
return Array.prototype.slice.call( elements );
}
window.addEventListener( "scroll", function() {
var scrolledHeight= window.pageYOffset;
generate_parallax_element( ".page-hero" ).forEach( function( el, index, array ) {
var limit = el.offsetTop + el.offsetHeight;
if( scrolledHeight > el.offsetTop && scrolledHeight <= limit ) {
el.style.backgroundPositionY = ( scrolledHeight - el.offsetTop ) / hero.parallax + "px";
} else {
el.style.backgroundPositionY = "0";
}
});
});

View File

@ -0,0 +1 @@
function generate_parallax_element(e,o){var t=(o=o||document).querySelectorAll(e);return Array.prototype.slice.call(t)}window.addEventListener("scroll",function(){var r=window.pageYOffset;generate_parallax_element(".page-hero").forEach(function(e,o,t){var a=e.offsetTop+e.offsetHeight;r>e.offsetTop&&r<=a?e.style.backgroundPositionY=(r-e.offsetTop)/hero.parallax+"px":e.style.backgroundPositionY="0"})});