Core Site

This commit is contained in:
2022-08-23 23:22:53 +02:00
parent 46f1463779
commit 7d65b963c6
31 changed files with 1244 additions and 0 deletions

0
js/admin.js Normal file
View File

52
js/script.js Normal file
View File

@ -0,0 +1,52 @@
//Init
$(document).ready(function(){
init();
});
function init(){
//Auto margin calculator
var navbarHeight = $("nav").height();
var paddingTop = parseInt($("nav").css('padding-top'));
var paddingBottom = parseInt($("nav").css('padding-bottom'));
$('#main-content').css('margin-top', (navbarHeight + paddingTop + paddingBottom) + 'px');
//Ripple
var ripples = document.querySelectorAll('.ripple');
for (var i = 0; i < ripples.length; i++) {
ripples[i].addEventListener('mousedown', rippleEffect, false);
}
function rippleEffect(e){
var width = this.clientWidth;
var height = this.clientHeight;
var rect = this.getBoundingClientRect();
var posX = e.clientX - rect.left;
var posY = e.clientY - rect.top;
var size = Math.max(width, height);
var effect = document.createElement('DIV');
effect.className = 'effect';
effect.style.width = size + 'px';
effect.style.height = size + 'px';
effect.style.top = posY - size/2 + 'px';
effect.style.left = posX - size/2 + 'px';
this.appendChild(effect);
var parent = this;
setTimeout(function() {
parent.removeChild(effect);
}, 750);
}
//Prevent horizontal scroll of page using keyboard
$(window).keydown(function(e){
if(e.which == 37 || e.which == 39){
e.preventDefault();
}
});
//Scroll hide image
$(window).scroll(function () {
$(this).scrollTop() > 50 ? $('#scroll').fadeOut() : $('#scroll').fadeIn()
});
}