[skip ci] Deploy: 17f51372b6
This commit is contained in:
144
js/fresh.js
Normal file
144
js/fresh.js
Normal file
@@ -0,0 +1,144 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
//Preloader
|
||||
$(window).on('load', function() { // makes sure the whole site is loaded
|
||||
$('#status').fadeOut(); // will first fade out the loading animation
|
||||
$('#preloader').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website.
|
||||
$('body').delay(350).css({'overflow':'visible'});
|
||||
})
|
||||
|
||||
//Mobile menu toggle
|
||||
if ($('.navbar-burger').length) {
|
||||
$('.navbar-burger').on("click", function(){
|
||||
|
||||
var menu_id = $(this).attr('data-target');
|
||||
$(this).toggleClass('is-active');
|
||||
$("#"+menu_id).toggleClass('is-active');
|
||||
$('.navbar.is-light').toggleClass('is-dark-mobile')
|
||||
});
|
||||
}
|
||||
|
||||
//Animate left hamburger icon and open sidebar
|
||||
$('.menu-icon-trigger').click(function(e){
|
||||
e.preventDefault();
|
||||
$('.menu-icon-wrapper').toggleClass('open');
|
||||
$('.sidebar').toggleClass('is-active');
|
||||
});
|
||||
|
||||
//Close sidebar
|
||||
$('.sidebar-close').click(function() {
|
||||
$('.sidebar').removeClass('is-active');
|
||||
$('.menu-icon-wrapper').removeClass('open');
|
||||
})
|
||||
|
||||
//Sidebar menu
|
||||
if ($('.sidebar').length) {
|
||||
$(".sidebar-menu > li.have-children > a").on("click", function(i){
|
||||
i.preventDefault();
|
||||
if( ! $(this).parent().hasClass("active") ){
|
||||
$(".sidebar-menu li ul").slideUp();
|
||||
$(this).next().slideToggle();
|
||||
$(".sidebar-menu li").removeClass("active");
|
||||
$(this).parent().addClass("active");
|
||||
}
|
||||
else{
|
||||
$(this).next().slideToggle();
|
||||
$(".sidebar-menu li").removeClass("active");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Navbar Clone
|
||||
if ($('#navbar-clone').length) {
|
||||
$(window).scroll(function() { // this will work when your window scrolled.
|
||||
var height = $(window).scrollTop(); //getting the scrolling height of window
|
||||
if(height > 50) {
|
||||
$("#navbar-clone").addClass('is-active');
|
||||
} else{
|
||||
$("#navbar-clone").removeClass('is-active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Init feather icons
|
||||
feather.replace();
|
||||
|
||||
//reveal elements on scroll so animations trigger the right way
|
||||
var $window = $(window),
|
||||
win_height_padded = $window.height() * 1.1,
|
||||
isTouch = Modernizr.touch;
|
||||
|
||||
$window.on('scroll', revealOnScroll);
|
||||
|
||||
function revealOnScroll() {
|
||||
var scrolled = $window.scrollTop();
|
||||
$(".revealOnScroll:not(.animated)").each(function () {
|
||||
var $this = $(this),
|
||||
offsetTop = $this.offset().top;
|
||||
|
||||
if (scrolled + win_height_padded > offsetTop) {
|
||||
if ($this.data('timeout')) {
|
||||
window.setTimeout(function(){
|
||||
$this.addClass('animated ' + $this.data('animation'));
|
||||
}, parseInt($this.data('timeout'),10));
|
||||
} else {
|
||||
$this.addClass('animated ' + $this.data('animation'));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Back to Top button behaviour
|
||||
var pxShow = 600;
|
||||
var scrollSpeed = 500;
|
||||
$(window).scroll(function() {
|
||||
if ($(window).scrollTop() >= pxShow) {
|
||||
$("#backtotop").addClass('visible');
|
||||
} else {
|
||||
$("#backtotop").removeClass('visible');
|
||||
}
|
||||
});
|
||||
$('#backtotop a').on('click', function() {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, scrollSpeed);
|
||||
return false;
|
||||
});
|
||||
|
||||
// Select all links with hashes
|
||||
$('a[href*="#"]')
|
||||
// Remove links that don't actually link to anything
|
||||
.not('[href="#"]')
|
||||
.not('[href="#0"]')
|
||||
.click(function(event) {
|
||||
// On-page links
|
||||
if (
|
||||
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
|
||||
&&
|
||||
location.hostname == this.hostname
|
||||
) {
|
||||
// Figure out element to scroll to
|
||||
var target = $(this.hash);
|
||||
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
|
||||
// Does a scroll target exist?
|
||||
if (target.length) {
|
||||
// Only prevent default if animation is actually gonna happen
|
||||
event.preventDefault();
|
||||
$('html, body').animate({
|
||||
scrollTop: target.offset().top
|
||||
}, 550, function() {
|
||||
// Callback after animation
|
||||
// Must change focus!
|
||||
var $target = $(target);
|
||||
$target.focus();
|
||||
if ($target.is(":focus")) { // Checking if the target was focused
|
||||
return false;
|
||||
} else {
|
||||
$target.attr('tabindex','-1'); // Adding tabindex for elements not focusable
|
||||
$target.focus(); // Set focus again
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
1
js/jquery.panelslider.min.js
vendored
Normal file
1
js/jquery.panelslider.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(e){"use strict";function r(r){var i=r.data("ps-options");if(e("body").hasClass(i.bodyClass)||n)return;r.trigger("psBeforeOpen"),n=!0,r.addClass("ps-active-panel"),e("body").addClass(i.bodyClass).one(t,function(e){n=!1,r.trigger("psOpen"),typeof i.onOpen=="function"&&i.onOpen()})}var t=["transitionend","webkitTransitionEnd","oTransitionEnd","MSTransitionEnd"].join(" "),n=!1;e.panelslider=function(e,t){e.panelslider(t)},e.panelslider.close=function(r){var i=e(".ps-active-panel"),s=i.data("ps-options");if(!i.length||n)return;i.trigger("psBeforeClose"),n=!0,i.removeClass("ps-active-panel"),e("body").removeClass(s.bodyClass).one(t,function(e){n=!1,i.trigger("psClose"),r&&setTimeout(function(){r()},0)})},e(document).on("click keyup",function(t){var n=e(".ps-active-panel");if(t.type=="keyup"&&t.keyCode!=27)return;n.length&&n.data("ps-options").clickClose&&e.panelslider.close()}),e(document).on("click",".ps-active-panel",function(e){e.stopPropagation()}),e.fn.panelslider=function(t){var n={bodyClass:"ps-active",clickClose:!0,onOpen:null},i=e(this.attr("href"));return i.data("ps-options",e.extend({},n,t)),this.click(function(t){var n=e(".ps-active-panel");n.length?n[0]==i[0]?e.panelslider.close():e.panelslider.close(function(){r(i)}):r(i),t.preventDefault(),t.stopPropagation()}),this}})(jQuery);
|
||||
Reference in New Issue
Block a user