first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
/**
* brands.js
*
* Adds sticky functionality to the brands index.
*/
( function() {
document.addEventListener( 'DOMContentLoaded', function() {
var brandsAZ = document.getElementsByClassName( 'brands_index' );
if ( ! brandsAZ.length ) {
return;
}
var adminBar = document.body.classList.contains( 'admin-bar' ) ? 32 : 0,
brandsContainerHeight = document.getElementById( 'brands_a_z' ).scrollHeight,
brandsAZHeight = brandsAZ[0].scrollHeight + 40;
var stickyBrandsAZ = function() {
if ( window.innerWidth > 768 && brandsAZ[0].getBoundingClientRect().top < 0 ) {
brandsAZ[0].style.paddingTop = Math.min( ( Math.abs( brandsAZ[0].getBoundingClientRect().top ) + 20 + adminBar ), brandsContainerHeight - brandsAZHeight ) + 'px';
} else {
brandsAZ[0].style.paddingTop = 0;
}
};
stickyBrandsAZ();
window.addEventListener( 'scroll', function() {
stickyBrandsAZ();
} );
} );
} )();

View File

@@ -0,0 +1 @@
document.addEventListener("DOMContentLoaded",function(){var n=document.getElementsByClassName("brands_index");if(n.length){var t=document.body.classList.contains("admin-bar")?32:0,e=document.getElementById("brands_a_z").scrollHeight,d=n[0].scrollHeight+40,i=function(){768<window.innerWidth&&n[0].getBoundingClientRect().top<0?n[0].style.paddingTop=Math.min(Math.abs(n[0].getBoundingClientRect().top)+20+t,e-d)+"px":n[0].style.paddingTop=0};i(),window.addEventListener("scroll",function(){i()})}});