This commit is contained in:
2026-04-23 04:33:43 +03:30
commit edde2ea185
11109 changed files with 3335449 additions and 0 deletions
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
!function(o){"use strict";o(document).ready(function(){var r=document.querySelector(".devthrow-progress-parent path"); if (!r) { return; } var n=r.getTotalLength();r.style.transition=r.style.WebkitTransition="none",r.style.strokeDasharray=n+" "+n,r.style.strokeDashoffset=n,r.getBoundingClientRect(),r.style.transition=r.style.WebkitTransition="stroke-dashoffset 10ms linear";function t(){var t=o(window).scrollTop(),e=o(document).height()-o(window).height();r.style.strokeDashoffset=n-t*n/e}t(),o(window).scroll(t);jQuery(window).on("scroll",function(){50<jQuery(this).scrollTop()?jQuery(".devthrow-progress-parent").addClass("devthrow-backto-top-active"):jQuery(".devthrow-progress-parent").removeClass("devthrow-backto-top-active")}),jQuery(".devthrow-progress-parent").on("click",function(t){return t.preventDefault(),jQuery("html, body").animate({scrollTop:0},550),!1})})}(jQuery);
@@ -0,0 +1,42 @@
/**
* File customizer.js.
*
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
( function( $ ) {
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
// Header text color.
wp.customize( 'header_textcolor', function( value ) {
value.bind( function( to ) {
if ( 'blank' === to ) {
$( '.site-title, .site-description' ).css( {
'clip': 'rect(1px, 1px, 1px, 1px)',
'position': 'absolute'
} );
} else {
$( '.site-title, .site-description' ).css( {
'clip': 'auto',
'position': 'relative'
} );
$( '.site-title a, .site-description' ).css( {
'color': to
} );
}
} );
} );
} )( jQuery );
@@ -0,0 +1 @@
var $;jQuery,document.addEventListener("DOMContentLoaded",function(){let e=document.getElementById("reset-button");e&&e.addEventListener("click",function(){let e=function e(t,n){let r=t.split("?");if(r.length<2)return t;let i=r[0],l=new URLSearchParams(r[1]);return l.delete(n),i+"?"+l.toString()}(window.location.href,"reset");window.location.href=e})});
@@ -0,0 +1,437 @@
/*!
* headroom.js v0.12.0 - Give your page some headroom. Hide your header until you need it
* Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js
* License: MIT
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.Headroom = factory());
}(this, function () { 'use strict';
function isBrowser() {
return typeof window !== "undefined";
}
/**
* Used to detect browser support for adding an event listener with options
* Credit: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
*/
function passiveEventsSupported() {
var supported = false;
try {
var options = {
// eslint-disable-next-line getter-return
get passive() {
supported = true;
}
};
window.addEventListener("test", options, options);
window.removeEventListener("test", options, options);
} catch (err) {
supported = false;
}
return supported;
}
function isSupported() {
return !!(
isBrowser() &&
function() {}.bind &&
"classList" in document.documentElement &&
Object.assign &&
Object.keys &&
requestAnimationFrame
);
}
function isDocument(obj) {
return obj.nodeType === 9; // Node.DOCUMENT_NODE === 9
}
function isWindow(obj) {
// `obj === window` or `obj instanceof Window` is not sufficient,
// as the obj may be the window of an iframe.
return obj && obj.document && isDocument(obj.document);
}
function windowScroller(win) {
var doc = win.document;
var body = doc.body;
var html = doc.documentElement;
return {
/**
* @see http://james.padolsey.com/javascript/get-document-height-cross-browser/
* @return {Number} the scroll height of the document in pixels
*/
scrollHeight: function() {
return Math.max(
body.scrollHeight,
html.scrollHeight,
body.offsetHeight,
html.offsetHeight,
body.clientHeight,
html.clientHeight
);
},
/**
* @see http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript
* @return {Number} the height of the viewport in pixels
*/
height: function() {
return win.innerHeight || html.clientHeight || body.clientHeight;
},
/**
* Gets the Y scroll position
* @return {Number} pixels the page has scrolled along the Y-axis
*/
scrollY: function() {
if (win.pageYOffset !== undefined) {
return win.pageYOffset;
}
return (html || body.parentNode || body).scrollTop;
}
};
}
function elementScroller(element) {
return {
/**
* @return {Number} the scroll height of the element in pixels
*/
scrollHeight: function() {
return Math.max(
element.scrollHeight,
element.offsetHeight,
element.clientHeight
);
},
/**
* @return {Number} the height of the element in pixels
*/
height: function() {
return Math.max(element.offsetHeight, element.clientHeight);
},
/**
* Gets the Y scroll position
* @return {Number} pixels the element has scrolled along the Y-axis
*/
scrollY: function() {
return element.scrollTop;
}
};
}
function createScroller(element) {
return isWindow(element) ? windowScroller(element) : elementScroller(element);
}
/**
* @param element EventTarget
*/
function trackScroll(element, options, callback) {
var isPassiveSupported = passiveEventsSupported();
var rafId;
var scrolled = false;
var scroller = createScroller(element);
var lastScrollY = scroller.scrollY();
var details = {};
function update() {
var scrollY = Math.round(scroller.scrollY());
var height = scroller.height();
var scrollHeight = scroller.scrollHeight();
// reuse object for less memory churn
details.scrollY = scrollY;
details.lastScrollY = lastScrollY;
details.direction = scrollY > lastScrollY ? "down" : "up";
details.distance = Math.abs(scrollY - lastScrollY);
details.isOutOfBounds = scrollY < 0 || scrollY + height > scrollHeight;
details.top = scrollY <= options.offset[details.direction];
details.bottom = scrollY + height >= scrollHeight;
details.toleranceExceeded =
details.distance > options.tolerance[details.direction];
callback(details);
lastScrollY = scrollY;
scrolled = false;
}
function handleScroll() {
if (!scrolled) {
scrolled = true;
rafId = requestAnimationFrame(update);
}
}
var eventOptions = isPassiveSupported
? { passive: true, capture: false }
: false;
element.addEventListener("scroll", handleScroll, eventOptions);
update();
return {
destroy: function() {
cancelAnimationFrame(rafId);
element.removeEventListener("scroll", handleScroll, eventOptions);
}
};
}
function normalizeUpDown(t) {
return t === Object(t) ? t : { down: t, up: t };
}
/**
* UI enhancement for fixed headers.
* Hides header when scrolling down
* Shows header when scrolling up
* @constructor
* @param {DOMElement} elem the header element
* @param {Object} options options for the widget
*/
function Headroom(elem, options) {
options = options || {};
Object.assign(this, Headroom.options, options);
this.classes = Object.assign({}, Headroom.options.classes, options.classes);
this.elem = elem;
this.tolerance = normalizeUpDown(this.tolerance);
this.offset = normalizeUpDown(this.offset);
this.initialised = false;
this.frozen = false;
}
Headroom.prototype = {
constructor: Headroom,
/**
* Start listening to scrolling
* @public
*/
init: function() {
if (Headroom.cutsTheMustard && !this.initialised) {
this.addClass("initial");
this.initialised = true;
// defer event registration to handle browser
// potentially restoring previous scroll position
setTimeout(
function(self) {
self.scrollTracker = trackScroll(
self.scroller,
{ offset: self.offset, tolerance: self.tolerance },
self.update.bind(self)
);
},
100,
this
);
}
return this;
},
/**
* Destroy the widget, clearing up after itself
* @public
*/
destroy: function() {
this.initialised = false;
Object.keys(this.classes).forEach(this.removeClass, this);
this.scrollTracker.destroy();
},
/**
* Unpin the element
* @public
*/
unpin: function() {
if (this.hasClass("pinned") || !this.hasClass("unpinned")) {
this.addClass("unpinned");
this.removeClass("pinned");
if (this.onUnpin) {
this.onUnpin.call(this);
}
}
},
/**
* Pin the element
* @public
*/
pin: function() {
if (this.hasClass("unpinned")) {
this.addClass("pinned");
this.removeClass("unpinned");
if (this.onPin) {
this.onPin.call(this);
}
}
},
/**
* Freezes the current state of the widget
* @public
*/
freeze: function() {
this.frozen = true;
this.addClass("frozen");
},
/**
* Re-enables the default behaviour of the widget
* @public
*/
unfreeze: function() {
this.frozen = false;
this.removeClass("frozen");
},
top: function() {
if (!this.hasClass("top")) {
this.addClass("top");
this.removeClass("notTop");
if (this.onTop) {
this.onTop.call(this);
}
}
},
notTop: function() {
if (!this.hasClass("notTop")) {
this.addClass("notTop");
this.removeClass("top");
if (this.onNotTop) {
this.onNotTop.call(this);
}
}
},
bottom: function() {
if (!this.hasClass("bottom")) {
this.addClass("bottom");
this.removeClass("notBottom");
if (this.onBottom) {
this.onBottom.call(this);
}
}
},
notBottom: function() {
if (!this.hasClass("notBottom")) {
this.addClass("notBottom");
this.removeClass("bottom");
if (this.onNotBottom) {
this.onNotBottom.call(this);
}
}
},
shouldUnpin: function(details) {
var scrollingDown = details.direction === "down";
return scrollingDown && !details.top && details.toleranceExceeded;
},
shouldPin: function(details) {
var scrollingUp = details.direction === "up";
return (scrollingUp && details.toleranceExceeded) || details.top;
},
addClass: function(className) {
this.elem.classList.add.apply(
this.elem.classList,
this.classes[className].split(" ")
);
},
removeClass: function(className) {
this.elem.classList.remove.apply(
this.elem.classList,
this.classes[className].split(" ")
);
},
hasClass: function(className) {
return this.classes[className].split(" ").every(function(cls) {
return this.classList.contains(cls);
}, this.elem);
},
update: function(details) {
if (details.isOutOfBounds) {
// Ignore bouncy scrolling in OSX
return;
}
if (this.frozen === true) {
return;
}
if (details.top) {
this.top();
} else {
this.notTop();
}
if (details.bottom) {
this.bottom();
} else {
this.notBottom();
}
if (this.shouldUnpin(details)) {
this.unpin();
} else if (this.shouldPin(details)) {
this.pin();
}
}
};
/**
* Default options
* @type {Object}
*/
Headroom.options = {
tolerance: {
up: 0,
down: 0
},
offset: 0,
scroller: isBrowser() ? window : null,
classes: {
frozen: "headroom--frozen",
pinned: "headroom--pinned",
unpinned: "headroom--unpinned",
top: "headroom--top",
notTop: "headroom--not-top",
bottom: "headroom--bottom",
notBottom: "headroom--not-bottom",
initial: "headroom"
}
};
Headroom.cutsTheMustard = isSupported();
return Headroom;
}));
+7
View File
@@ -0,0 +1,7 @@
/*!
* headroom.js v0.12.0 - Give your page some headroom. Hide your header until you need it
* Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js
* License: MIT
*/
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).Headroom=n()}(this,function(){"use strict";function t(){return"undefined"!=typeof window}function d(t){return function(t){return t&&t.document&&function(t){return 9===t.nodeType}(t.document)}(t)?function(t){var n=t.document,o=n.body,s=n.documentElement;return{scrollHeight:function(){return Math.max(o.scrollHeight,s.scrollHeight,o.offsetHeight,s.offsetHeight,o.clientHeight,s.clientHeight)},height:function(){return t.innerHeight||s.clientHeight||o.clientHeight},scrollY:function(){return void 0!==t.pageYOffset?t.pageYOffset:(s||o.parentNode||o).scrollTop}}}(t):function(t){return{scrollHeight:function(){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},height:function(){return Math.max(t.offsetHeight,t.clientHeight)},scrollY:function(){return t.scrollTop}}}(t)}function n(t,s,e){var n,o=function(){var n=!1;try{var t={get passive(){n=!0}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){n=!1}return n}(),i=!1,r=d(t),l=r.scrollY(),a={};function c(){var t=Math.round(r.scrollY()),n=r.height(),o=r.scrollHeight();a.scrollY=t,a.lastScrollY=l,a.direction=l<t?"down":"up",a.distance=Math.abs(t-l),a.isOutOfBounds=t<0||o<t+n,a.top=t<=s.offset[a.direction],a.bottom=o<=t+n,a.toleranceExceeded=a.distance>s.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t){return t===Object(t)?t:{down:t,up:t}}function s(t,n){n=n||{},Object.assign(this,s.options,n),this.classes=Object.assign({},s.options.classes,n.classes),this.elem=t,this.tolerance=o(this.tolerance),this.offset=o(this.offset),this.initialised=!1,this.frozen=!1}return s.prototype={constructor:s,init:function(){return s.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},s.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},s.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),s});
+363
View File
@@ -0,0 +1,363 @@
(function($) {
"use strict";
//===== Preloader
$(window).on('load', function(event) {
$('.preloader').delay(500).fadeOut(500);
$('#preloader_two').fadeOut();
$(".upstudy_image_preloader").fadeOut("slow");
});
//===== Header Sticky & Headroom.js
jQuery(function($) {
var header = $(".header-get-sticky");
var topHeader = $(".tpc-header-top-bar");
var topHeaderHeight = topHeader.length ? topHeader.outerHeight() : 0;
var topHeaderHidden = false;
var stickyMode = typeof upstudy_sticky_data !== 'undefined' ? upstudy_sticky_data.mode : 'smart';
if (header.length) {
if (stickyMode === 'always') {
$(window).on("scroll", function() {
var scrollTop = $(this).scrollTop();
if (scrollTop > 100) {
header.addClass("top-header-removed");
} else {
header.removeClass("top-header-removed");
}
if (scrollTop > topHeaderHeight && !topHeaderHidden) {
topHeader.slideUp(200);
topHeaderHidden = true;
} else if (scrollTop === 0 && topHeaderHidden) {
topHeader.slideDown(200);
topHeaderHidden = false;
}
});
} else if (stickyMode === 'smart') {
var options = {
offset: {
up: 100,
down: 200
},
tolerance: {
up: 5,
down: 0
},
classes: {
pinned: "headroom--pinned",
unpinned: "headroom--unpinned",
top: "headroom--top",
notTop: "headroom--not-top"
}
};
var myElement = document.querySelector(".header-get-sticky");
var headroom = new Headroom(myElement, options);
headroom.init();
}
}
});
//===== Login/Register Popup Modal
$('.tpc-login-register-popup-trigger').on('click', function(e) {
e.preventDefault();
$('.upstudy-login-form-popup').toggleClass('login-popup-visible');
$('.upstudy-login-popup-overlay').toggleClass('active');
});
const login_btn = document.querySelector(".login-item");
const register_btn = document.querySelector(".register-item");
$(".register-form").css("display", "none");
$(function() {
$('.login-item, #upstudy-login-form-trigger').on('click', function() {
login_btn.classList.add("active");
$(".register-form").css("display", "none");
if (register_btn.classList.contains("active")) {
register_btn.classList.remove("active");
$(".login-form").removeAttr("style");
}
});
$('.register-item, #upstudy-register-form-trigger').on('click', function() {
register_btn.classList.add("active");
$(".login-form").css("display", "none");
if (login_btn.classList.contains("active")) {
login_btn.classList.remove("active");
$(".register-form").removeAttr("style");
}
});
});
//===== Close Login/Register Modal on Click Outside
$('.upstudy-custom-login-wrapper').on('click', function() {
console.log("clicked");
});
//===== Close Login Modal on Close Button Click
$('.upstudy-login-popup-close .close-trigger').on('click', function() {
$('.upstudy-login-form-popup').removeClass('login-popup-visible');
$('.upstudy-login-popup-overlay').removeClass('active');
});
//===== Course Filter Auto Select
$('.upstudy-course-filtering input').on('change', function() {
$('.upstudy-course-filtering').submit();
});
//===== Course Filter shorting
$(document).ready(function() {
$('.course-orderby').on('change', function() {
$('.course-top-filter').submit();
});
});
//===== Mobile Menu
$('.upstudy-mobile-hamburger-menu').on('click', function() {
$(".upstudy-mobile-hamburger-menu > a").toggleClass('upstudy-mobile-menu-close--active');
$(".upstudy-mobile-menu-nav-wrapper").toggleClass('upstudy-mobile-menu-visible');
$('body').toggleClass('upstudy-mobile-menu-active');
});
$('.upstudy-mobile-menu-close > a').on('click', function() {
$('.upstudy-mobile-hamburger-menu > a').removeClass('upstudy-mobile-menu-close--active');
$('.upstudy-mobile-menu-nav-wrapper').removeClass('upstudy-mobile-menu-visible');
$('body').removeClass('upstudy-mobile-menu-active');
});
$('.upstudy-mobile-menu-overlay').on('click', function() {
$('.upstudy-mobile-hamburger-menu > a').removeClass('upstudy-mobile-menu-close--active');
$('.upstudy-mobile-menu-nav-wrapper').removeClass('upstudy-mobile-menu-visible');
$('body').removeClass('upstudy-mobile-menu-active');
});
//===== Accordion Menu for Mobile
$.fn.extend({
accordionMenu: function(options) {
var defaults = {
speed: 400
}
var options = $.extend(defaults, options);
return this.each(function() {
$(this).addClass('upstudy-mobile-menu-item');
var menuItems = $(this).children('li');
menuItems.find('.upstudy-mobile-menu-item > .upstudy-dropdown-menu').parent().addClass('menu-item-has-children');
$('.upstudy-mobile-menu-item .menu-item-has-children .upstudy-dropdown-menu').hide();
$('.upstudy-mobile-menu-item .menu-item-has-children > a .upstudy-menu-icon').on('click', function(event) {
event.stopPropagation();
event.preventDefault();
$(this).parent().siblings('.upstudy-dropdown-menu').slideToggle(options.speed);
$(this).parent().siblings('.upstudy-mega-menu').slideToggle(options.speed);
});
});
}
});
$('#upstudy-mobile-menu-item').accordionMenu();
//===== Elementor Mobile Menu
$('.upstudy-elementor-mobile-hamburger-menu').on('click', function() {
$(".upstudy-elementor-mobile-hamburger-menu > a").toggleClass('upstudy-mobile-menu-close--active');
$(".upstudy-elementor-mobile-menu-nav-wrapper").toggleClass('upstudy-mobile-menu-visible');
$('body').toggleClass('upstudy-mobile-menu-active');
});
$('.upstudy-elementor-mobile-menu-close > a').on('click', function() {
$('.upstudy-elementor-mobile-hamburger-menu > a').removeClass('upstudy-mobile-menu-close--active');
$('.upstudy-elementor-mobile-menu-nav-wrapper').removeClass('upstudy-mobile-menu-visible');
$('body').removeClass('upstudy-mobile-menu-active');
});
$('.upstudy-elementor-mobile-menu-overlay').on('click', function() {
$('.upstudy-elementor-mobile-hamburger-menu > a').removeClass('upstudy-mobile-menu-close--active');
$('.upstudy-elementor-mobile-menu-nav-wrapper').removeClass('upstudy-mobile-menu-visible');
$('body').removeClass('upstudy-mobile-menu-active');
});
//===== Accordion Menu for Elementor Mobile
$.fn.extend({
accordionMenu: function(options) {
var defaults = {
speed: 400
}
var options = $.extend(defaults, options);
return this.each(function() {
$(this).addClass('upstudy-elementor-mobile-menu-item');
var menuItems = $(this).children('li');
menuItems.find('.upstudy-elementor-mobile-menu-item > .upstudy-dropdown-menu').parent().addClass('menu-item-has-children');
$('.upstudy-elementor-mobile-menu-item .menu-item-has-children .upstudy-dropdown-menu').hide();
$('.upstudy-elementor-mobile-menu-item .menu-item-has-children > a .upstudy-menu-icon').on('click', function(event) {
event.stopPropagation();
event.preventDefault();
$(this).parent().siblings('.upstudy-dropdown-menu').slideToggle(options.speed);
$(this).parent().siblings('.upstudy-mega-menu').slideToggle(options.speed);
});
});
}
});
$('#upstudy-elementor-mobile-menu-item').accordionMenu();
//===== WooCommerce Helper
function upstudy_woocommerce_helper() {
$('.product-over-info ul li.add-to-cart a.add_to_cart_button.ajax_add_to_cart').on("click", function() {
$(this).closest('li').addClass('added_to_cart_item');
});
}
//===== SAL Animation
sal();
//===== Video Popup
$(function() {
$("a.bla-1").YouTubePopUp();
$("a.bla-2").YouTubePopUp({
autoplay: 0
});
});
//===== Search
$('#search').on('click', function() {
$(".upstudy-search-box").fadeIn(600);
});
$('.top-search').on('click', function() {
$(".upstudy-search-box").fadeIn(600);
});
$('.upstudy-closebtn').on('click', function() {
$(".upstudy-search-box").fadeOut(600);
});
//===== Like/Wishlist button for blog page
jQuery(document).ready(function($) {
if (typeof upstudy_like_ajax === 'undefined') {
return; // Exit if wp_localize_script is disabled
}
$('.upstudy-like-btn').on('click', function(event) {
event.preventDefault();
var button = $(this);
var postID = button.data('postid');
$.ajax({
type: 'POST',
url: upstudy_like_ajax.ajaxurl,
data: {
action: 'upstudy_like',
post_id: postID
},
success: function(response) {
if (response.success) {
button.find('.like-count').text(response.data);
}
}
});
});
});
//===== Add to cart animation
jQuery(function($){
if (typeof upstudy_cart_settings === 'undefined') return;
var ajaxUrl = upstudy_cart_settings.ajax_url || '/wp-admin/admin-ajax.php';
var tutorNonce = upstudy_cart_settings.tutor_nonce || '';
var enableAnimation = !!upstudy_cart_settings.cart_animation;
// try refresh via Woo fragments, fallback to our admin-ajax endpoint
function refreshCartFragment() {
// prefer Woo's fragment endpoint
if (typeof wc_cart_fragments_params !== 'undefined' && wc_cart_fragments_params.wc_ajax_url) {
var fragUrl = wc_cart_fragments_params.wc_ajax_url.toString().replace('%%endpoint%%', 'get_refreshed_fragments');
$.post(fragUrl, {}, function(data) {
if (data && data.fragments && data.fragments['#upstudy-cart-fragment']) {
$('#upstudy-cart-fragment').replaceWith(data.fragments['#upstudy-cart-fragment']);
return;
} else {
// fallback
fallbackRefresh();
}
}, 'json').fail(function() {
fallbackRefresh();
});
} else {
fallbackRefresh();
}
}
function fallbackRefresh() {
$.post(ajaxUrl, { action: 'upstudy_refresh_cart_fragment' }, function(res) {
if (res && res.success && res.data && res.data.fragment) {
$('#upstudy-cart-fragment').replaceWith(res.data.fragment);
}
}, 'json');
}
// events to trigger refresh
$(document.body).on('added_to_cart', function(){ // Woo AJAX event
refreshCartFragment();
});
// Tutor LMS events (different versions use different event names)
$(document).on('tutor_after_add_to_cart tutor_course_added_to_cart tutor_added_to_cart', function(){
setTimeout(function(){ refreshCartFragment(); }, 250);
});
// fallback: detect ajaxComplete that looks like add-to-cart
$(document).ajaxComplete(function(event, xhr, settings){
if (!settings || !settings.data) return;
var d = settings.data;
if (typeof d === 'string' && (d.indexOf('add-to-cart') !== -1 || d.indexOf('tutor_add_to_cart') !== -1 || d.indexOf('action=tutor_add_to_cart') !== -1)) {
setTimeout(function(){ refreshCartFragment(); }, 300);
}
});
// Tutor mini-cart item remove (uses Tutor's AJAX action 'tutor_remove_from_cart' if available)
$(document).on('click', '.tutor-mini-cart-remove', function(e){
e.preventDefault();
var $el = $(this);
var courseId = $el.data('course-id');
if (!courseId) return;
$.post(ajaxUrl, {
action: 'tutor_remove_from_cart',
course_id: courseId,
security: tutorNonce
}, function(res){
// if tutor plugin returns success, refresh fragment; else always try to refresh
setTimeout(function(){ refreshCartFragment(); }, 200);
}, 'json');
});
// optional: fly animation from cursor to cart
if (enableAnimation) {
$(document).on('click', '.add_to_cart_button, .single_add_to_cart_button, .tutor-add-to-cart-button, .tutor-course-enroll', function(e){
var $count = $('.upstudy-woo-mini-cart-total-item').first();
if (!$count.length) return;
var qty = $(this).data('quantity') || 1,
$fly = $('<span class="upstudy-fly-number">+' + qty + '</span>').appendTo('body'),
startX = e.clientX,
startY = e.clientY,
cartOffset = $count.offset();
if (!cartOffset) { $fly.remove(); return; }
var endX = cartOffset.left - $(window).scrollLeft(),
endY = cartOffset.top - $(window).scrollTop(),
midX = (startX + endX) / 2,
midY = Math.min(startY, endY) - 120,
duration = 700,
startTime = performance.now();
$fly.css({
position: 'fixed',
left: startX + 'px',
top: startY + 'px',
zIndex: 99999,
color: '#fff',
background: '#0e2a47a3',
padding: '6px 10px',
borderRadius: '20px',
fontSize: '14px',
fontWeight: '700',
pointerEvents: 'none',
transform: 'scale(0.6)',
opacity: 0,
});
function easeInOut(t) { return t < 0.5 ? 2*t*t : -1 + (4-2*t)*t; }
(function animate(time) {
var progress = Math.min((time - startTime) / duration, 1);
var ease = easeInOut(progress);
var x = (1-ease)*(1-ease)*startX + 2*(1-ease)*ease*midX + ease*ease*endX;
var y = (1-ease)*(1-ease)*startY + 2*(1-ease)*ease*midY + ease*ease*endY;
$fly.css({
left: x + 'px',
top: y + 'px',
transform: 'scale(' + (0.6 + 0.4*ease) + ')',
opacity: 1 - 0.95*ease
});
if (progress < 1) {
requestAnimationFrame(animate);
} else {
$fly.remove();
}
})(performance.now());
});
}
// initial refresh (in case counts differ)
// setTimeout to allow WC session initialization
setTimeout(function(){ refreshCartFragment(); }, 300);
});
})(jQuery);
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,338 @@
/*!
* metismenu https://github.com/onokumus/metismenu#readme
* A jQuery menu plugin
* @version 3.0.6
* @author Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
* @license: MIT
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
(global = global || self, global.metisMenu = factory(global.jQuery));
}(this, (function ($) { 'use strict';
$ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var Util = function ($) {
// eslint-disable-line no-shadow
var TRANSITION_END = 'transitionend';
var Util = {
// eslint-disable-line no-shadow
TRANSITION_END: 'mmTransitionEnd',
triggerTransitionEnd: function triggerTransitionEnd(element) {
$(element).trigger(TRANSITION_END);
},
supportsTransitionEnd: function supportsTransitionEnd() {
return Boolean(TRANSITION_END);
}
};
function getSpecialTransitionEndEvent() {
return {
bindType: TRANSITION_END,
delegateType: TRANSITION_END,
handle: function handle(event) {
if ($(event.target).is(this)) {
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
}
return undefined;
}
};
}
function transitionEndEmulator(duration) {
var _this = this;
var called = false;
$(this).one(Util.TRANSITION_END, function () {
called = true;
});
setTimeout(function () {
if (!called) {
Util.triggerTransitionEnd(_this);
}
}, duration);
return this;
}
function setTransitionEndSupport() {
$.fn.mmEmulateTransitionEnd = transitionEndEmulator; // eslint-disable-line no-param-reassign
// eslint-disable-next-line no-param-reassign
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
}
setTransitionEndSupport();
return Util;
}($);
var NAME = 'metisMenu';
var DATA_KEY = 'metisMenu';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 350;
var Default = {
toggle: true,
preventDefault: true,
triggerElement: 'a',
parentTrigger: 'li',
subMenu: 'ul'
};
var Event = {
SHOW: "show" + EVENT_KEY,
SHOWN: "shown" + EVENT_KEY,
HIDE: "hide" + EVENT_KEY,
HIDDEN: "hidden" + EVENT_KEY,
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
};
var ClassName = {
METIS: 'metismenu',
ACTIVE: 'mm-active',
SHOW: 'mm-show',
COLLAPSE: 'mm-collapse',
COLLAPSING: 'mm-collapsing',
COLLAPSED: 'mm-collapsed'
};
var MetisMenu = /*#__PURE__*/function () {
// eslint-disable-line no-shadow
function MetisMenu(element, config) {
this.element = element;
this.config = _extends({}, Default, {}, config);
this.transitioning = null;
this.init();
}
var _proto = MetisMenu.prototype;
_proto.init = function init() {
var self = this;
var conf = this.config;
var el = $(this.element);
el.addClass(ClassName.METIS); // add metismenu class to element
el.find(conf.parentTrigger + "." + ClassName.ACTIVE).children(conf.triggerElement).attr('aria-expanded', 'true'); // add attribute aria-expanded=true the trigger element
el.find(conf.parentTrigger + "." + ClassName.ACTIVE).parents(conf.parentTrigger).addClass(ClassName.ACTIVE);
el.find(conf.parentTrigger + "." + ClassName.ACTIVE).parents(conf.parentTrigger).children(conf.triggerElement).attr('aria-expanded', 'true'); // add attribute aria-expanded=true the triggers of all parents
el.find(conf.parentTrigger + "." + ClassName.ACTIVE).has(conf.subMenu).children(conf.subMenu).addClass(ClassName.COLLAPSE + " " + ClassName.SHOW);
el.find(conf.parentTrigger).not("." + ClassName.ACTIVE).has(conf.subMenu).children(conf.subMenu).addClass(ClassName.COLLAPSE);
el.find(conf.parentTrigger) // .has(conf.subMenu)
.children(conf.triggerElement).on(Event.CLICK_DATA_API, function (e) {
// eslint-disable-line func-names
var eTar = $(this);
if (eTar.attr('aria-disabled') === 'true') {
return;
}
if (conf.preventDefault && eTar.attr('href') === '#') {
e.preventDefault();
}
var paRent = eTar.parent(conf.parentTrigger);
var sibLi = paRent.siblings(conf.parentTrigger);
var sibTrigger = sibLi.children(conf.triggerElement);
if (paRent.hasClass(ClassName.ACTIVE)) {
eTar.attr('aria-expanded', 'false');
self.removeActive(paRent);
} else {
eTar.attr('aria-expanded', 'true');
self.setActive(paRent);
if (conf.toggle) {
self.removeActive(sibLi);
sibTrigger.attr('aria-expanded', 'false');
}
}
if (conf.onTransitionStart) {
conf.onTransitionStart(e);
}
});
};
_proto.setActive = function setActive(li) {
$(li).addClass(ClassName.ACTIVE);
var ul = $(li).children(this.config.subMenu);
if (ul.length > 0 && !ul.hasClass(ClassName.SHOW)) {
this.show(ul);
}
};
_proto.removeActive = function removeActive(li) {
$(li).removeClass(ClassName.ACTIVE);
var ul = $(li).children(this.config.subMenu + "." + ClassName.SHOW);
if (ul.length > 0) {
this.hide(ul);
}
};
_proto.show = function show(element) {
var _this = this;
if (this.transitioning || $(element).hasClass(ClassName.COLLAPSING)) {
return;
}
var elem = $(element);
var startEvent = $.Event(Event.SHOW);
elem.trigger(startEvent);
if (startEvent.isDefaultPrevented()) {
return;
}
elem.parent(this.config.parentTrigger).addClass(ClassName.ACTIVE);
if (this.config.toggle) {
var toggleElem = elem.parent(this.config.parentTrigger).siblings().children(this.config.subMenu + "." + ClassName.SHOW);
this.hide(toggleElem);
}
elem.removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING).height(0);
this.setTransitioning(true);
var complete = function complete() {
// check if disposed
if (!_this.config || !_this.element) {
return;
}
elem.removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE + " " + ClassName.SHOW).height('');
_this.setTransitioning(false);
elem.trigger(Event.SHOWN);
};
elem.height(element[0].scrollHeight).one(Util.TRANSITION_END, complete).mmEmulateTransitionEnd(TRANSITION_DURATION);
};
_proto.hide = function hide(element) {
var _this2 = this;
if (this.transitioning || !$(element).hasClass(ClassName.SHOW)) {
return;
}
var elem = $(element);
var startEvent = $.Event(Event.HIDE);
elem.trigger(startEvent);
if (startEvent.isDefaultPrevented()) {
return;
}
elem.parent(this.config.parentTrigger).removeClass(ClassName.ACTIVE); // eslint-disable-next-line no-unused-expressions
elem.height(elem.height())[0].offsetHeight;
elem.addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
this.setTransitioning(true);
var complete = function complete() {
// check if disposed
if (!_this2.config || !_this2.element) {
return;
}
if (_this2.transitioning && _this2.config.onTransitionEnd) {
_this2.config.onTransitionEnd();
}
_this2.setTransitioning(false);
elem.trigger(Event.HIDDEN);
elem.removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE);
};
if (elem.height() === 0 || elem.css('display') === 'none') {
complete();
} else {
elem.height(0).one(Util.TRANSITION_END, complete).mmEmulateTransitionEnd(TRANSITION_DURATION);
}
};
_proto.setTransitioning = function setTransitioning(isTransitioning) {
this.transitioning = isTransitioning;
};
_proto.dispose = function dispose() {
$.removeData(this.element, DATA_KEY);
$(this.element).find(this.config.parentTrigger) // .has(this.config.subMenu)
.children(this.config.triggerElement).off(Event.CLICK_DATA_API);
this.transitioning = null;
this.config = null;
this.element = null;
};
MetisMenu.jQueryInterface = function jQueryInterface(config) {
// eslint-disable-next-line func-names
return this.each(function () {
var $this = $(this);
var data = $this.data(DATA_KEY);
var conf = _extends({}, Default, {}, $this.data(), {}, typeof config === 'object' && config ? config : {});
if (!data) {
data = new MetisMenu(this, conf);
$this.data(DATA_KEY, data);
}
if (typeof config === 'string') {
if (data[config] === undefined) {
throw new Error("No method named \"" + config + "\"");
}
data[config]();
}
});
};
return MetisMenu;
}();
/**
* ------------------------------------------------------------------------
* jQuery
* ------------------------------------------------------------------------
*/
$.fn[NAME] = MetisMenu.jQueryInterface; // eslint-disable-line no-param-reassign
$.fn[NAME].Constructor = MetisMenu; // eslint-disable-line no-param-reassign
$.fn[NAME].noConflict = function () {
// eslint-disable-line no-param-reassign
$.fn[NAME] = JQUERY_NO_CONFLICT; // eslint-disable-line no-param-reassign
return MetisMenu.jQueryInterface;
};
return MetisMenu;
})));
+8
View File
@@ -0,0 +1,8 @@
/*!
* metismenu https://github.com/onokumus/metismenu#readme
* A jQuery menu plugin
* @version 3.0.6
* @author Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
* @license: MIT
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],n):(e=e||self).metisMenu=n(e.jQuery)}(this,function(o){"use strict";function a(){return(a=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var i,n,r,s=(n="transitionend",r={TRANSITION_END:"mmTransitionEnd",triggerTransitionEnd:function(e){i(e).trigger(n)},supportsTransitionEnd:function(){return Boolean(n)}},(i=o).fn.mmEmulateTransitionEnd=e,i.event.special[r.TRANSITION_END]={bindType:n,delegateType:n,handle:function(e){if(i(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}},r);function e(e){var n=this,t=!1;return i(this).one(r.TRANSITION_END,function(){t=!0}),setTimeout(function(){t||r.triggerTransitionEnd(n)},e),this}var t="metisMenu",g="metisMenu",l="."+g,h=o.fn[t],f={toggle:!0,preventDefault:!0,triggerElement:"a",parentTrigger:"li",subMenu:"ul"},d={SHOW:"show"+l,SHOWN:"shown"+l,HIDE:"hide"+l,HIDDEN:"hidden"+l,CLICK_DATA_API:"click"+l+".data-api"},u="metismenu",c="mm-active",p="mm-show",m="mm-collapse",T="mm-collapsing",v=function(){function r(e,n){this.element=e,this.config=a({},f,{},n),this.transitioning=null,this.init()}var e=r.prototype;return e.init=function(){var a=this,s=this.config,e=o(this.element);e.addClass(u),e.find(s.parentTrigger+"."+c).children(s.triggerElement).attr("aria-expanded","true"),e.find(s.parentTrigger+"."+c).parents(s.parentTrigger).addClass(c),e.find(s.parentTrigger+"."+c).parents(s.parentTrigger).children(s.triggerElement).attr("aria-expanded","true"),e.find(s.parentTrigger+"."+c).has(s.subMenu).children(s.subMenu).addClass(m+" "+p),e.find(s.parentTrigger).not("."+c).has(s.subMenu).children(s.subMenu).addClass(m),e.find(s.parentTrigger).children(s.triggerElement).on(d.CLICK_DATA_API,function(e){var n=o(this);if("true"!==n.attr("aria-disabled")){s.preventDefault&&"#"===n.attr("href")&&e.preventDefault();var t=n.parent(s.parentTrigger),i=t.siblings(s.parentTrigger),r=i.children(s.triggerElement);t.hasClass(c)?(n.attr("aria-expanded","false"),a.removeActive(t)):(n.attr("aria-expanded","true"),a.setActive(t),s.toggle&&(a.removeActive(i),r.attr("aria-expanded","false"))),s.onTransitionStart&&s.onTransitionStart(e)}})},e.setActive=function(e){o(e).addClass(c);var n=o(e).children(this.config.subMenu);0<n.length&&!n.hasClass(p)&&this.show(n)},e.removeActive=function(e){o(e).removeClass(c);var n=o(e).children(this.config.subMenu+"."+p);0<n.length&&this.hide(n)},e.show=function(e){var n=this;if(!this.transitioning&&!o(e).hasClass(T)){var t=o(e),i=o.Event(d.SHOW);if(t.trigger(i),!i.isDefaultPrevented()){if(t.parent(this.config.parentTrigger).addClass(c),this.config.toggle){var r=t.parent(this.config.parentTrigger).siblings().children(this.config.subMenu+"."+p);this.hide(r)}t.removeClass(m).addClass(T).height(0),this.setTransitioning(!0);t.height(e[0].scrollHeight).one(s.TRANSITION_END,function(){n.config&&n.element&&(t.removeClass(T).addClass(m+" "+p).height(""),n.setTransitioning(!1),t.trigger(d.SHOWN))}).mmEmulateTransitionEnd(350)}}},e.hide=function(e){var n=this;if(!this.transitioning&&o(e).hasClass(p)){var t=o(e),i=o.Event(d.HIDE);if(t.trigger(i),!i.isDefaultPrevented()){t.parent(this.config.parentTrigger).removeClass(c),t.height(t.height())[0].offsetHeight,t.addClass(T).removeClass(m).removeClass(p),this.setTransitioning(!0);var r=function(){n.config&&n.element&&(n.transitioning&&n.config.onTransitionEnd&&n.config.onTransitionEnd(),n.setTransitioning(!1),t.trigger(d.HIDDEN),t.removeClass(T).addClass(m))};0===t.height()||"none"===t.css("display")?r():t.height(0).one(s.TRANSITION_END,r).mmEmulateTransitionEnd(350)}}},e.setTransitioning=function(e){this.transitioning=e},e.dispose=function(){o.removeData(this.element,g),o(this.element).find(this.config.parentTrigger).children(this.config.triggerElement).off(d.CLICK_DATA_API),this.transitioning=null,this.config=null,this.element=null},r.jQueryInterface=function(i){return this.each(function(){var e=o(this),n=e.data(g),t=a({},f,{},e.data(),{},"object"==typeof i&&i?i:{});if(n||(n=new r(this,t),e.data(g,n)),"string"==typeof i){if(void 0===n[i])throw new Error('No method named "'+i+'"');n[i]()}})},r}();return o.fn[t]=v.jQueryInterface,o.fn[t].Constructor=v,o.fn[t].noConflict=function(){return o.fn[t]=h,v.jQueryInterface},v});
@@ -0,0 +1,106 @@
/**
* File navigation.js.
*
* Handles toggling the navigation menu for small screens and enables TAB key
* navigation support for dropdown menus.
*/
( function() {
var container, button, menu, links, i, len;
container = document.getElementById( 'site-navigation' );
if ( ! container ) {
return;
}
button = container.getElementsByTagName( 'button' )[0];
if ( 'undefined' === typeof button ) {
return;
}
menu = container.getElementsByTagName( 'ul' )[0];
// Hide menu toggle button if menu is empty and return early.
if ( 'undefined' === typeof menu ) {
button.style.display = 'none';
return;
}
menu.setAttribute( 'aria-expanded', 'false' );
if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
menu.className += ' nav-menu';
}
button.onclick = function() {
if ( -1 !== container.className.indexOf( 'toggled' ) ) {
container.className = container.className.replace( ' toggled', '' );
button.setAttribute( 'aria-expanded', 'false' );
menu.setAttribute( 'aria-expanded', 'false' );
} else {
container.className += ' toggled';
button.setAttribute( 'aria-expanded', 'true' );
menu.setAttribute( 'aria-expanded', 'true' );
}
};
// Get all the link elements within the menu.
links = menu.getElementsByTagName( 'a' );
// Each time a menu link is focused or blurred, toggle focus.
for ( i = 0, len = links.length; i < len; i++ ) {
links[i].addEventListener( 'focus', toggleFocus, true );
links[i].addEventListener( 'blur', toggleFocus, true );
}
/**
* Sets or removes .focus class on an element.
*/
function toggleFocus() {
var self = this;
// Move up through the ancestors of the current link until we hit .nav-menu.
while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
// On li elements toggle the class .focus.
if ( 'li' === self.tagName.toLowerCase() ) {
if ( -1 !== self.className.indexOf( 'focus' ) ) {
self.className = self.className.replace( ' focus', '' );
} else {
self.className += ' focus';
}
}
self = self.parentElement;
}
}
/**
* Toggles `focus` class to allow submenu access on tablets.
*/
( function( container ) {
var touchStartFn, i,
parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
if ( 'ontouchstart' in window ) {
touchStartFn = function( e ) {
var menuItem = this.parentNode, i;
if ( ! menuItem.classList.contains( 'focus' ) ) {
e.preventDefault();
for ( i = 0; i < menuItem.parentNode.children.length; ++i ) {
if ( menuItem === menuItem.parentNode.children[i] ) {
continue;
}
menuItem.parentNode.children[i].classList.remove( 'focus' );
}
menuItem.classList.add( 'focus' );
} else {
menuItem.classList.remove( 'focus' );
}
};
for ( i = 0; i < parentLink.length; ++i ) {
parentLink[i].addEventListener( 'touchstart', touchStartFn, false );
}
}
}( container ) );
} )();
@@ -0,0 +1,4 @@
/* jQuery Nice Select - v1.0
https://github.com/hernansartorio/jquery-nice-select
Made by Hernán Sartorio */
!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
+1
View File
@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.sal=t():e.sal=t()}(this,function(){return(()=>{"use strict";var r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},e={};function t(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function n(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?t(Object(o),!0).forEach(function(e){var t,n;t=r,e=o[n=e],n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}r.d(e,{default:()=>O});function a(e,t){e=new CustomEvent(e,{bubbles:!0,detail:t}),t.target.dispatchEvent(e)}function o(){b(),p()}function s(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};p(),Array.from(document.querySelectorAll(l.selector)).forEach(f),d(e),y()}function i(){var e=v();c.push(e)}var l={root:null,rootMargin:"0% 50%",threshold:.5,animateClassName:"sal-animate",disabledClassName:"sal-disabled",enterEventName:"sal:in",exitEventName:"sal:out",selector:"[data-sal]",once:!0,disabled:!1},c=[],u=null,d=function(e){e&&e!==l&&(l=n(n({},l),e))},f=function(e){e.classList.remove(l.animateClassName)},b=function(){document.body.classList.add(l.disabledClassName)},p=function(){u.disconnect(),u=null},m=function(e,o){e.forEach(function(e){var t=e.target,n=void 0!==t.dataset.salRepeat,r=void 0!==t.dataset.salOnce,n=n||!(r||l.once);e.intersectionRatio>=l.threshold?((r=e).target.classList.add(l.animateClassName),a(l.enterEventName,r),n||o.unobserve(t)):n&&(f((e=e).target),a(l.exitEventName,e))})},v=function(){var e=[].filter.call(document.querySelectorAll(l.selector),function(e){return l.animateClassName,!e.classList.contains(l.animateClassName)});return e.forEach(function(e){return u.observe(e)}),e},y=function(){document.body.classList.remove(l.disabledClassName),u=new IntersectionObserver(m,{root:l.root,rootMargin:l.rootMargin,threshold:l.threshold}),c=v()};const O=function(){if(d(0<arguments.length&&void 0!==arguments[0]?arguments[0]:l),"undefined"==typeof window)return console.warn("Sal was not initialised! Probably it is used in SSR."),{elements:c,disable:o,enable:y,reset:s,update:i};if(!window.IntersectionObserver)throw b(),Error("Your browser does not support IntersectionObserver!\nGet a polyfill from here:\nhttps://github.com/w3c/IntersectionObserver/tree/master/polyfill");return(l.disabled||"function"==typeof l.disabled&&l.disabled()?b:y)(),{elements:c,disable:o,enable:y,reset:s,update:i}};return e.default})()});
@@ -0,0 +1,31 @@
/**
* File skip-link-focus-fix.js.
*
* Helps with accessibility for keyboard only users.
*
* Learn more: https://git.io/vWdr2
*/
( function() {
var isIe = /(trident|msie)/i.test( navigator.userAgent );
if ( isIe && document.getElementById && window.addEventListener ) {
window.addEventListener( 'hashchange', function() {
var id = location.hash.substring( 1 ),
element;
if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
return;
}
element = document.getElementById( id );
if ( element ) {
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
element.tabIndex = -1;
}
element.focus();
}
}, false );
}
} )();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,373 @@
/*!
* Theia Sticky Sidebar v1.7.0
* https://github.com/WeCodePixels/theia-sticky-sidebar
*
* Glues your website's sidebars, making them permanently visible while scrolling.
*
* Copyright 2013-2016 WeCodePixels and other contributors
* Released under the MIT license
*/
(function ($) {
$.fn.theiaStickySidebar = function (options) {
var defaults = {
'containerSelector': '',
'additionalMarginTop': 0,
'additionalMarginBottom': 0,
'updateSidebarHeight': true,
'minWidth': 0,
'disableOnResponsiveLayouts': true,
'sidebarBehavior': 'modern',
'defaultPosition': 'relative',
'namespace': 'TSS'
};
options = $.extend(defaults, options);
// Validate options
options.additionalMarginTop = parseInt(options.additionalMarginTop) || 0;
options.additionalMarginBottom = parseInt(options.additionalMarginBottom) || 0;
tryInitOrHookIntoEvents(options, this);
// Try doing init, otherwise hook into window.resize and document.scroll and try again then.
function tryInitOrHookIntoEvents(options, $that) {
var success = tryInit(options, $that);
if (!success) {
console.log('TSS: Body width smaller than options.minWidth. Init is delayed.');
$(document).on('scroll.' + options.namespace, function (options, $that) {
return function (evt) {
var success = tryInit(options, $that);
if (success) {
$(this).unbind(evt);
}
};
}(options, $that));
$(window).on('resize.' + options.namespace, function (options, $that) {
return function (evt) {
var success = tryInit(options, $that);
if (success) {
$(this).unbind(evt);
}
};
}(options, $that))
}
}
// Try doing init if proper conditions are met.
function tryInit(options, $that) {
if (options.initialized === true) {
return true;
}
if ($('body').width() < options.minWidth) {
return false;
}
init(options, $that);
return true;
}
// Init the sticky sidebar(s).
function init(options, $that) {
options.initialized = true;
// Add CSS
var existingStylesheet = $('#theia-sticky-sidebar-stylesheet-' + options.namespace);
if (existingStylesheet.length === 0) {
$('head').append($('<style id="theia-sticky-sidebar-stylesheet-' + options.namespace + '">.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>'));
}
$that.each(function () {
var o = {};
o.sidebar = $(this);
// Save options
o.options = options || {};
// Get container
o.container = $(o.options.containerSelector);
if (o.container.length == 0) {
o.container = o.sidebar.parent();
}
// Create sticky sidebar
o.sidebar.parents().css('-webkit-transform', 'none'); // Fix for WebKit bug - https://code.google.com/p/chromium/issues/detail?id=20574
o.sidebar.css({
'position': o.options.defaultPosition,
'overflow': 'visible',
// The "box-sizing" must be set to "content-box" because we set a fixed height to this element when the sticky sidebar has a fixed position.
'-webkit-box-sizing': 'border-box',
'-moz-box-sizing': 'border-box',
'box-sizing': 'border-box'
});
// Get the sticky sidebar element. If none has been found, then create one.
o.stickySidebar = o.sidebar.find('.theiaStickySidebar');
if (o.stickySidebar.length == 0) {
// Remove <script> tags, otherwise they will be run again when added to the stickySidebar.
var javaScriptMIMETypes = /(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i;
o.sidebar.find('script').filter(function (index, script) {
return script.type.length === 0 || script.type.match(javaScriptMIMETypes);
}).remove();
o.stickySidebar = $('<div>').addClass('theiaStickySidebar').append(o.sidebar.children());
o.sidebar.append(o.stickySidebar);
}
// Get existing top and bottom margins and paddings
o.marginBottom = parseInt(o.sidebar.css('margin-bottom'));
o.paddingTop = parseInt(o.sidebar.css('padding-top'));
o.paddingBottom = parseInt(o.sidebar.css('padding-bottom'));
// Add a temporary padding rule to check for collapsable margins.
var collapsedTopHeight = o.stickySidebar.offset().top;
var collapsedBottomHeight = o.stickySidebar.outerHeight();
o.stickySidebar.css('padding-top', 1);
o.stickySidebar.css('padding-bottom', 1);
collapsedTopHeight -= o.stickySidebar.offset().top;
collapsedBottomHeight = o.stickySidebar.outerHeight() - collapsedBottomHeight - collapsedTopHeight;
if (collapsedTopHeight == 0) {
o.stickySidebar.css('padding-top', 0);
o.stickySidebarPaddingTop = 0;
}
else {
o.stickySidebarPaddingTop = 1;
}
if (collapsedBottomHeight == 0) {
o.stickySidebar.css('padding-bottom', 0);
o.stickySidebarPaddingBottom = 0;
}
else {
o.stickySidebarPaddingBottom = 1;
}
// We use this to know whether the user is scrolling up or down.
o.previousScrollTop = null;
// Scroll top (value) when the sidebar has fixed position.
o.fixedScrollTop = 0;
// Set sidebar to default values.
resetSidebar();
o.onScroll = function (o) {
// Stop if the sidebar isn't visible.
if (!o.stickySidebar.is(":visible")) {
return;
}
// Stop if the window is too small.
if ($('body').width() < o.options.minWidth) {
resetSidebar();
return;
}
// Stop if the sidebar width is larger than the container width (e.g. the theme is responsive and the sidebar is now below the content)
if (o.options.disableOnResponsiveLayouts) {
var sidebarWidth = o.sidebar.outerWidth(o.sidebar.css('float') == 'none');
if (sidebarWidth + 50 > o.container.width()) {
resetSidebar();
return;
}
}
var scrollTop = $(document).scrollTop();
var position = 'static';
// If the user has scrolled down enough for the sidebar to be clipped at the top, then we can consider changing its position.
if (scrollTop >= o.sidebar.offset().top + (o.paddingTop - o.options.additionalMarginTop)) {
// The top and bottom offsets, used in various calculations.
var offsetTop = o.paddingTop + options.additionalMarginTop;
var offsetBottom = o.paddingBottom + o.marginBottom + options.additionalMarginBottom;
// All top and bottom positions are relative to the window, not to the parent elemnts.
var containerTop = o.sidebar.offset().top;
var containerBottom = o.sidebar.offset().top + getClearedHeight(o.container);
// The top and bottom offsets relative to the window screen top (zero) and bottom (window height).
var windowOffsetTop = 0 + options.additionalMarginTop;
var windowOffsetBottom;
var sidebarSmallerThanWindow = (o.stickySidebar.outerHeight() + offsetTop + offsetBottom) < $(window).height();
if (sidebarSmallerThanWindow) {
windowOffsetBottom = windowOffsetTop + o.stickySidebar.outerHeight();
}
else {
windowOffsetBottom = $(window).height() - o.marginBottom - o.paddingBottom - options.additionalMarginBottom;
}
var staticLimitTop = containerTop - scrollTop + o.paddingTop;
var staticLimitBottom = containerBottom - scrollTop - o.paddingBottom - o.marginBottom;
var top = o.stickySidebar.offset().top - scrollTop;
var scrollTopDiff = o.previousScrollTop - scrollTop;
// If the sidebar position is fixed, then it won't move up or down by itself. So, we manually adjust the top coordinate.
if (o.stickySidebar.css('position') == 'fixed') {
if (o.options.sidebarBehavior == 'modern') {
top += scrollTopDiff;
}
}
if (o.options.sidebarBehavior == 'stick-to-top') {
top = options.additionalMarginTop;
}
if (o.options.sidebarBehavior == 'stick-to-bottom') {
top = windowOffsetBottom - o.stickySidebar.outerHeight();
}
if (scrollTopDiff > 0) { // If the user is scrolling up.
top = Math.min(top, windowOffsetTop);
}
else { // If the user is scrolling down.
top = Math.max(top, windowOffsetBottom - o.stickySidebar.outerHeight());
}
top = Math.max(top, staticLimitTop);
top = Math.min(top, staticLimitBottom - o.stickySidebar.outerHeight());
// If the sidebar is the same height as the container, we won't use fixed positioning.
var sidebarSameHeightAsContainer = o.container.height() == o.stickySidebar.outerHeight();
if (!sidebarSameHeightAsContainer && top == windowOffsetTop) {
position = 'fixed';
}
else if (!sidebarSameHeightAsContainer && top == windowOffsetBottom - o.stickySidebar.outerHeight()) {
position = 'fixed';
}
else if (scrollTop + top - o.sidebar.offset().top - o.paddingTop <= options.additionalMarginTop) {
// Stuck to the top of the page. No special behavior.
position = 'static';
}
else {
// Stuck to the bottom of the page.
position = 'absolute';
}
}
/*
* Performance notice: It's OK to set these CSS values at each resize/scroll, even if they don't change.
* It's way slower to first check if the values have changed.
*/
if (position == 'fixed') {
var scrollLeft = $(document).scrollLeft();
o.stickySidebar.css({
'position': 'fixed',
'width': getWidthForObject(o.stickySidebar) + 'px',
'transform': 'translateY(' + top + 'px)',
'left': (o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left')) - scrollLeft) + 'px',
'top': '0px'
});
}
else if (position == 'absolute') {
var css = {};
if (o.stickySidebar.css('position') != 'absolute') {
css.position = 'absolute';
css.transform = 'translateY(' + (scrollTop + top - o.sidebar.offset().top - o.stickySidebarPaddingTop - o.stickySidebarPaddingBottom) + 'px)';
css.top = '0px';
}
css.width = getWidthForObject(o.stickySidebar) + 'px';
css.left = '';
o.stickySidebar.css(css);
}
else if (position == 'static') {
resetSidebar();
}
if (position != 'static') {
if (o.options.updateSidebarHeight == true) {
o.sidebar.css({
'min-height': o.stickySidebar.outerHeight() + o.stickySidebar.offset().top - o.sidebar.offset().top + o.paddingBottom
});
}
}
o.previousScrollTop = scrollTop;
};
// Initialize the sidebar's position.
o.onScroll(o);
// Recalculate the sidebar's position on every scroll and resize.
$(document).on('scroll.' + o.options.namespace, function (o) {
return function () {
o.onScroll(o);
};
}(o));
$(window).on('resize.' + o.options.namespace, function (o) {
return function () {
o.stickySidebar.css({'position': 'static'});
o.onScroll(o);
};
}(o));
// Recalculate the sidebar's position every time the sidebar changes its size.
if (typeof ResizeSensor !== 'undefined') {
new ResizeSensor(o.stickySidebar[0], function (o) {
return function () {
o.onScroll(o);
};
}(o));
}
// Reset the sidebar to its default state
function resetSidebar() {
o.fixedScrollTop = 0;
o.sidebar.css({
'min-height': '1px'
});
o.stickySidebar.css({
'position': 'static',
'width': '',
'transform': 'none'
});
}
// Get the height of a div as if its floated children were cleared. Note that this function fails if the floats are more than one level deep.
function getClearedHeight(e) {
var height = e.height();
e.children().each(function () {
height = Math.max(height, $(this).height());
});
return height;
}
});
}
function getWidthForObject(object) {
var width;
try {
width = object[0].getBoundingClientRect().width;
}
catch (err) {
}
if (typeof width === "undefined") {
width = object.width();
}
return width;
}
return this;
}
})(jQuery);
//# sourceMappingURL=maps/theia-sticky-sidebar.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,312 @@
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports) {
// Node/CommonJS
module.exports = function (root, jQuery) {
if (jQuery === undefined) {
// require('jQuery') returns a factory that requires window to
// build a jQuery instance, we normalize how we use modules
// that require this pattern but the window provided is a noop
// if it's defined (how jquery works)
if (typeof window !== 'undefined') {
jQuery = require('jquery');
} else {
jQuery = require('jquery')(root);
}
}
factory(jQuery);
return jQuery;
};
} else {
// Browser globals
factory(jQuery);
}
})(function ($) {
$.fn.tilt = function (options) {
/**
* RequestAnimationFrame
*/
var requestTick = function requestTick() {
if (this.ticking) return;
requestAnimationFrame(updateTransforms.bind(this));
this.ticking = true;
};
/**
* Bind mouse movement evens on instance
*/
var bindEvents = function bindEvents() {
var _this = this;
$(this).on('mousemove', mouseMove);
$(this).on('mouseenter', mouseEnter);
if (this.settings.reset) $(this).on('mouseleave', mouseLeave);
if (this.settings.glare) $(window).on('resize', updateGlareSize.bind(_this));
};
/**
* Set transition only on mouse leave and mouse enter so it doesn't influence mouse move transforms
*/
var setTransition = function setTransition() {
var _this2 = this;
if (this.timeout !== undefined) clearTimeout(this.timeout);
$(this).css({ 'transition': this.settings.speed + 'ms ' + this.settings.easing });
if (this.settings.glare) this.glareElement.css({ 'transition': 'opacity ' + this.settings.speed + 'ms ' + this.settings.easing });
this.timeout = setTimeout(function () {
$(_this2).css({ 'transition': '' });
if (_this2.settings.glare) _this2.glareElement.css({ 'transition': '' });
}, this.settings.speed);
};
/**
* When user mouse enters tilt element
*/
var mouseEnter = function mouseEnter(event) {
this.ticking = false;
$(this).css({ 'will-change': 'transform' });
setTransition.call(this);
// Trigger change event
$(this).trigger("tilt.mouseEnter");
};
/**
* Return the x,y position of the mouse on the tilt element
* @returns {{x: *, y: *}}
*/
var getMousePositions = function getMousePositions(event) {
if (typeof event === "undefined") {
event = {
pageX: $(this).offset().left + $(this).outerWidth() / 2,
pageY: $(this).offset().top + $(this).outerHeight() / 2
};
}
return { x: event.pageX, y: event.pageY };
};
/**
* When user mouse moves over the tilt element
*/
var mouseMove = function mouseMove(event) {
this.mousePositions = getMousePositions(event);
requestTick.call(this);
};
/**
* When user mouse leaves tilt element
*/
var mouseLeave = function mouseLeave() {
setTransition.call(this);
this.reset = true;
requestTick.call(this);
// Trigger change event
$(this).trigger("tilt.mouseLeave");
};
/**
* Get tilt values
*
* @returns {{x: tilt value, y: tilt value}}
*/
var getValues = function getValues() {
var width = $(this).outerWidth();
var height = $(this).outerHeight();
var left = $(this).offset().left;
var top = $(this).offset().top;
var percentageX = (this.mousePositions.x - left) / width;
var percentageY = (this.mousePositions.y - top) / height;
// x or y position inside instance / width of instance = percentage of position inside instance * the max tilt value
var tiltX = (this.settings.maxTilt / 2 - percentageX * this.settings.maxTilt).toFixed(2);
var tiltY = (percentageY * this.settings.maxTilt - this.settings.maxTilt / 2).toFixed(2);
// angle
var angle = Math.atan2(this.mousePositions.x - (left + width / 2), -(this.mousePositions.y - (top + height / 2))) * (180 / Math.PI);
// Return x & y tilt values
return { tiltX: tiltX, tiltY: tiltY, 'percentageX': percentageX * 100, 'percentageY': percentageY * 100, angle: angle };
};
/**
* Update tilt transforms on mousemove
*/
var updateTransforms = function updateTransforms() {
this.transforms = getValues.call(this);
if (this.reset) {
this.reset = false;
$(this).css('transform', 'perspective(' + this.settings.perspective + 'px) rotateX(0deg) rotateY(0deg)');
// Rotate glare if enabled
if (this.settings.glare) {
this.glareElement.css('transform', 'rotate(180deg) translate(-50%, -50%)');
this.glareElement.css('opacity', '0');
}
return;
} else {
$(this).css('transform', 'perspective(' + this.settings.perspective + 'px) rotateX(' + (this.settings.disableAxis === 'x' ? 0 : this.transforms.tiltY) + 'deg) rotateY(' + (this.settings.disableAxis === 'y' ? 0 : this.transforms.tiltX) + 'deg) scale3d(' + this.settings.scale + ',' + this.settings.scale + ',' + this.settings.scale + ')');
// Rotate glare if enabled
if (this.settings.glare) {
this.glareElement.css('transform', 'rotate(' + this.transforms.angle + 'deg) translate(-50%, -50%)');
this.glareElement.css('opacity', '' + this.transforms.percentageY * this.settings.maxGlare / 100);
}
}
// Trigger change event
$(this).trigger("change", [this.transforms]);
this.ticking = false;
};
/**
* Prepare elements
*/
var prepareGlare = function prepareGlare() {
var glarePrerender = this.settings.glarePrerender;
// If option pre-render is enabled we assume all html/css is present for an optimal glare effect.
if (!glarePrerender)
// Create glare element
$(this).append('<div class="js-tilt-glare"><div class="js-tilt-glare-inner"></div></div>');
// Store glare selector if glare is enabled
this.glareElementWrapper = $(this).find(".js-tilt-glare");
this.glareElement = $(this).find(".js-tilt-glare-inner");
// Remember? We assume all css is already set, so just return
if (glarePrerender) return;
// Abstracted re-usable glare styles
var stretch = {
'position': 'absolute',
'top': '0',
'left': '0',
'width': '100%',
'height': '100%'
};
// Style glare wrapper
this.glareElementWrapper.css(stretch).css({
'overflow': 'hidden',
'pointer-events': 'none'
});
// Style glare element
this.glareElement.css({
'position': 'absolute',
'top': '50%',
'left': '50%',
'background-image': 'linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)',
'width': '' + $(this).outerWidth() * 2,
'height': '' + $(this).outerWidth() * 2,
'transform': 'rotate(180deg) translate(-50%, -50%)',
'transform-origin': '0% 0%',
'opacity': '0'
});
};
/**
* Update glare on resize
*/
var updateGlareSize = function updateGlareSize() {
this.glareElement.css({
'width': '' + $(this).outerWidth() * 2,
'height': '' + $(this).outerWidth() * 2
});
};
/**
* Public methods
*/
$.fn.tilt.destroy = function () {
$(this).each(function () {
$(this).find('.js-tilt-glare').remove();
$(this).css({ 'will-change': '', 'transform': '' });
$(this).off('mousemove mouseenter mouseleave');
});
};
$.fn.tilt.getValues = function () {
var results = [];
$(this).each(function () {
this.mousePositions = getMousePositions.call(this);
results.push(getValues.call(this));
});
return results;
};
$.fn.tilt.reset = function () {
$(this).each(function () {
var _this3 = this;
this.mousePositions = getMousePositions.call(this);
this.settings = $(this).data('settings');
mouseLeave.call(this);
setTimeout(function () {
_this3.reset = false;
}, this.settings.transition);
});
};
/**
* Loop every instance
*/
return this.each(function () {
var _this4 = this;
/**
* Default settings merged with user settings
* Can be set trough data attributes or as parameter.
* @type {*}
*/
this.settings = $.extend({
maxTilt: $(this).is('[data-tilt-max]') ? $(this).data('tilt-max') : 20,
perspective: $(this).is('[data-tilt-perspective]') ? $(this).data('tilt-perspective') : 300,
easing: $(this).is('[data-tilt-easing]') ? $(this).data('tilt-easing') : 'cubic-bezier(.03,.98,.52,.99)',
scale: $(this).is('[data-tilt-scale]') ? $(this).data('tilt-scale') : '1',
speed: $(this).is('[data-tilt-speed]') ? $(this).data('tilt-speed') : '400',
transition: $(this).is('[data-tilt-transition]') ? $(this).data('tilt-transition') : true,
disableAxis: $(this).is('[data-tilt-disable-axis]') ? $(this).data('tilt-disable-axis') : null,
axis: $(this).is('[data-tilt-axis]') ? $(this).data('tilt-axis') : null,
reset: $(this).is('[data-tilt-reset]') ? $(this).data('tilt-reset') : true,
glare: $(this).is('[data-tilt-glare]') ? $(this).data('tilt-glare') : false,
maxGlare: $(this).is('[data-tilt-maxglare]') ? $(this).data('tilt-maxglare') : 1
}, options);
// Add deprecation warning & set disableAxis to deprecated axis setting
if (this.settings.axis !== null) {
console.warn('Tilt.js: the axis setting has been renamed to disableAxis. See https://github.com/gijsroge/tilt.js/pull/26 for more information');
this.settings.disableAxis = this.settings.axis;
}
this.init = function () {
// Store settings
$(_this4).data('settings', _this4.settings);
// Prepare element
if (_this4.settings.glare) prepareGlare.call(_this4);
// Bind events
bindEvents.call(_this4);
};
// Init
this.init();
});
};
/**
* Auto load
*/
$('[data-tilt]').tilt();
return true;
});
//# sourceMappingURL=tilt.jquery.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
!function(o){o.fn.YouTubePopUp=function(e){var u=o.extend({autoplay:1},e);o(this).on("click",(function(e){var a=o(this).attr("href");if(a.match(/(youtube.com)/))var p="v=",t=1;if(a.match(/(youtu.be)/)||a.match(/(vimeo.com\/)+[0-9]/))p="/",t=3;if(a.match(/(vimeo.com\/)+[a-zA-Z]/))p="/",t=5;var i=a.split(p)[t].replace(/(&)+(.*)/,"");if(a.match(/(youtu.be)/)||a.match(/(youtube.com)/))var c="https://www.youtube.com/embed/"+i+"?autoplay="+u.autoplay;if(a.match(/(vimeo.com\/)+[0-9]/)||a.match(/(vimeo.com\/)+[a-zA-Z]/))c="https://player.vimeo.com/video/"+i+"?autoplay="+u.autoplay;o("body").append('<div class="YouTubePopUp-Wrap YouTubePopUp-animation"><div class="YouTubePopUp-Content"><span class="YouTubePopUp-Close"></span><iframe src="'+c+'" allowfullscreen></iframe></div></div>'),o(".YouTubePopUp-Wrap").hasClass("YouTubePopUp-animation")&&setTimeout((function(){o(".YouTubePopUp-Wrap").removeClass("YouTubePopUp-animation")}),600),o(".YouTubePopUp-Wrap, .YouTubePopUp-Close").click((function(){o(".YouTubePopUp-Wrap").addClass("YouTubePopUp-Hide").delay(515).queue((function(){o(this).remove()}))})),e.preventDefault()})),o(document).keyup((function(e){27==e.keyCode&&o(".YouTubePopUp-Wrap, .YouTubePopUp-Close").click()}))}}(jQuery);