first commit

This commit is contained in:
rahul.katari committed 2024-02-08 18:23:45 +05:30
commit dfd4634f69
220 files changed
+32848

No files matched your search

BIN
View File
Binary file not shown.
+154
View File
@@ -0,0 +1,154 @@
jQuery(document).ready(function($){
//set animation timing
var animationDelay = 2500,
//loading bar effect
barAnimationDelay = 3800,
barWaiting = barAnimationDelay - 3000, //3000 is the duration of the transition on the loading bar - set in the scss/css file
//letters effect
lettersDelay = 50,
//type effect
typeLettersDelay = 150,
selectionDuration = 500,
typeAnimationDelay = selectionDuration + 800,
//clip effect
revealDuration = 600,
revealAnimationDelay = 1500;
initHeadline();
function initHeadline() {
//insert <i> element for each letter of a changing word
singleLetters($('.cd-headline.letters').find('b'));
//initialise headline animation
animateHeadline($('.cd-headline'));
}
function singleLetters($words) {
$words.each(function(){
var word = $(this),
letters = word.text().split(''),
selected = word.hasClass('is-visible');
for (i in letters) {
if(word.parents('.rotate-2').length > 0) letters[i] = '<em>' + letters[i] + '</em>';
letters[i] = (selected) ? '<i class="in">' + letters[i] + '</i>': '<i>' + letters[i] + '</i>';
}
var newLetters = letters.join('');
word.html(newLetters).css('opacity', 1);
});
}
function animateHeadline($headlines) {
var duration = animationDelay;
$headlines.each(function(){
var headline = $(this);
if(headline.hasClass('loading-bar')) {
duration = barAnimationDelay;
setTimeout(function(){ headline.find('.cd-words-wrapper').addClass('is-loading') }, barWaiting);
} else if (headline.hasClass('clip')){
var spanWrapper = headline.find('.cd-words-wrapper'),
newWidth = spanWrapper.width() + 10
spanWrapper.css('width', newWidth);
} else if (!headline.hasClass('type') ) {
//assign to .cd-words-wrapper the width of its longest word
var words = headline.find('.cd-words-wrapper b'),
width = 0;
words.each(function(){
var wordWidth = $(this).width();
if (wordWidth > width) width = wordWidth;
});
headline.find('.cd-words-wrapper').css('width', width);
};
//trigger animation
setTimeout(function(){ hideWord( headline.find('.is-visible').eq(0) ) }, duration);
});
}
function hideWord($word) {
var nextWord = takeNext($word);
if($word.parents('.cd-headline').hasClass('type')) {
var parentSpan = $word.parent('.cd-words-wrapper');
parentSpan.addClass('selected').removeClass('waiting');
setTimeout(function(){
parentSpan.removeClass('selected');
$word.removeClass('is-visible').addClass('is-hidden').children('i').removeClass('in').addClass('out');
}, selectionDuration);
setTimeout(function(){ showWord(nextWord, typeLettersDelay) }, typeAnimationDelay);
} else if($word.parents('.cd-headline').hasClass('letters')) {
var bool = ($word.children('i').length >= nextWord.children('i').length) ? true : false;
hideLetter($word.find('i').eq(0), $word, bool, lettersDelay);
showLetter(nextWord.find('i').eq(0), nextWord, bool, lettersDelay);
} else if($word.parents('.cd-headline').hasClass('clip')) {
$word.parents('.cd-words-wrapper').animate({ width : '2px' }, revealDuration, function(){
switchWord($word, nextWord);
showWord(nextWord);
});
} else if ($word.parents('.cd-headline').hasClass('loading-bar')){
$word.parents('.cd-words-wrapper').removeClass('is-loading');
switchWord($word, nextWord);
setTimeout(function(){ hideWord(nextWord) }, barAnimationDelay);
setTimeout(function(){ $word.parents('.cd-words-wrapper').addClass('is-loading') }, barWaiting);
} else {
switchWord($word, nextWord);
setTimeout(function(){ hideWord(nextWord) }, animationDelay);
}
}
function showWord($word, $duration) {
if($word.parents('.cd-headline').hasClass('type')) {
showLetter($word.find('i').eq(0), $word, false, $duration);
$word.addClass('is-visible').removeClass('is-hidden');
} else if($word.parents('.cd-headline').hasClass('clip')) {
$word.parents('.cd-words-wrapper').animate({ 'width' : $word.width() + 10 }, revealDuration, function(){
setTimeout(function(){ hideWord($word) }, revealAnimationDelay);
});
}
}
function hideLetter($letter, $word, $bool, $duration) {
$letter.removeClass('in').addClass('out');
if(!$letter.is(':last-child')) {
setTimeout(function(){ hideLetter($letter.next(), $word, $bool, $duration); }, $duration);
} else if($bool) {
setTimeout(function(){ hideWord(takeNext($word)) }, animationDelay);
}
if($letter.is(':last-child') && $('html').hasClass('no-csstransitions')) {
var nextWord = takeNext($word);
switchWord($word, nextWord);
}
}
function showLetter($letter, $word, $bool, $duration) {
$letter.addClass('in').removeClass('out');
if(!$letter.is(':last-child')) {
setTimeout(function(){ showLetter($letter.next(), $word, $bool, $duration); }, $duration);
} else {
if($word.parents('.cd-headline').hasClass('type')) { setTimeout(function(){ $word.parents('.cd-words-wrapper').addClass('waiting'); }, 200);}
if(!$bool) { setTimeout(function(){ hideWord($word) }, animationDelay) }
}
}
function takeNext($word) {
return (!$word.is(':last-child')) ? $word.next() : $word.parent().children().eq(0);
}
function takePrev($word) {
return (!$word.is(':first-child')) ? $word.prev() : $word.parent().children().last();
}
function switchWord($oldWord, $newWord) {
$oldWord.removeClass('is-visible').addClass('is-hidden');
$newWord.removeClass('is-hidden').addClass('is-visible');
}
});
+12
View File
@@ -0,0 +1,12 @@
/*!
* Isotope PACKAGED v3.0.6
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
*
* https://isotope.metafizzy.co
* Copyright 2010-2018 Metafizzy
*/
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n<i.length;n++){var s=i[n],r=o&&o[s];r&&(this.off(t,s),delete o[s]),s.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<h;e++){var i=u[e];t[i]=0}return t}function o(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function n(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var n=o(e);r=200==Math.round(t(n.width)),s.isBoxSizeOuter=r,i.removeChild(e)}}function s(e){if(n(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=o(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==s.boxSizing,l=0;l<h;l++){var f=u[l],c=s[f],m=parseFloat(c);a[f]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,y=a.paddingTop+a.paddingBottom,g=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,I=d&&r,x=t(s.width);x!==!1&&(a.width=x+(I?0:p+_));var S=t(s.height);return S!==!1&&(a.height=S+(I?0:y+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(y+z),a.outerWidth=a.width+g,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},u=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=u.length,d=!1;return s}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var o=e[i],n=o+"MatchesSelector";if(t[n])return n}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var o=Array.prototype.slice;i.makeArray=function(Line truncated
}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},l.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},l._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=f(i)}},l._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&i<e;i++){var o=t[i];o.updateSortData()}};var f=function(){function t(t){if("string"!=typeof t)return t;var i=h(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),s=n&&n[1],r=e(s,o),a=d.sortDataParsers[i[1]];return t=a?function(t){return t&&a(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},l._sort=function(){if(this.options.sortBy){var t=n.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=a(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},l._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},l._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},l._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},l._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},l._manageStamp=function(t){this._mode()._manageStamp(t)},l._getContainerSize=function(){return this._mode()._getContainerSize()},l.needsResizeLayout=function(){return this._mode().needsResizeLayout()},l.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},l.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},l._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},l.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;i<n;i++)o=e[i],this.element.appendChild(o.element);var s=this._filter(e).matches;for(i=0;i<n;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<n;i++)delete e[i].isLayoutInstant;this.reveal(s)}};var c=l.remove;return l.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);c.call(this,t);for(var i=e&&e.length,o=0;i&&o<i;o++){var s=e[o];n.removeFrom(this.filteredItems,s)}},l.shuffle=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},l._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var o=t.apply(this,e);return this.options.transitionDuration=i,o},l.getFilteredItemElements=function(){return this.filteredItems.map(function(t){return t.element})},d});
+2
View File
@@ -0,0 +1,2 @@
/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^Line truncated
+6
View File
@@ -0,0 +1,6 @@
/*! jQuery UI - v1.12.1 - 2021-01-31
* http://jqueryui.com
* Includes: widget.js, keycode.js, widgets/mouse.js, widgets/slider.js, effect.js, effects/effect-slide.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(f){f.ui=f.ui||{};f.ui.version="1.12.1";var n,i=0,r=Array.prototype.slice;f.cleanData=(n=f.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)try{(e=f._data(i,"events"))&&e.remove&&f(i).triggerHandler("remove")}catch(t){}n(t)}),f.widget=function(t,i,e){var s,n,a,o={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=f.Widget),f.isArray(e)&&(e=f.extend.apply(null,[{}].concat(e))),f.expr[":"][l.toLowerCase()]=function(t){return!!f.data(t,l)},f[r]=f[r]||{},s=f[r][t],n=f[r][t]=function(t,e){if(!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},f.extend(n,s,{version:e.version,_proto:f.extend({},e),_childConstructors:[]}),(a=new i).options=f.widget.extend({},a.options),f.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function a(t){return i.prototype[e].apply(this,t)}f.isFunction(s)?o[e]=function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=a,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:o[e]=s}),n.prototype=f.widget.extend(a,{widgetEventPrefix:s&&a.widgetEventPrefix||t},o,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(f.each(s._childConstructors,function(t,e){var i=e.prototype;f.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),f.widget.bridge(t,n),n},f.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,a=s.length;n<a;n++)for(e in s[n])i=s[n][e],s[n].hasOwnProperty(e)&&void 0!==i&&(f.isPlainObject(i)?t[e]=f.isPlainObject(t[e])?f.widget.extend({},t[e],i):f.widget.extend({},i):t[e]=i);return t},f.widget.bridge=function(a,e){var o=e.prototype.widgetFullName||a;f.fn[a]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=f.data(this,o);return"instance"===i?(n=e,!1):e?f.isFunction(e[i])&&"_"!==i.charAt(0)?(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:f.error("no such method '"+i+"' for "+a+" widget instance"):f.error("cannot call methods on "+a+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=f.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=f.data(this,o);t?(t.option(i||{}),t._init&&t._init()):f.data(this,o,new e(i,this))})),n}},f.Widget=function(){},f.Widget._childConstructors=[],f.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=f(e||this.defaultElement||this)[0],this.element=f(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=f(),this.hoverable=f(),this.focusable=f(),this.classesElementLookup={},e!==this&&(f.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=f(e.style?e.ownerDocument:e.document||e),this.window=f(this.document[0].defaultView||this.document[0].parentWindow)),this.options=f.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:f.noop,_create:f.noop,_init:f.noop,destroy:function(){var i=this;this._destroy(),f.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:f.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,a=t;if(0===arguments.length)return f.widget.extend({},this.options);if("string"==typeof t)if(a={},t=(i=t.split(".")).shift(),i.length){for(s=a[t]=f.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];a[t]=e}return this._setOptions(a),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=f(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions(Line truncated
+1
View File
@@ -0,0 +1 @@
!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this.options.asNavFor;return e&&null!==e&&(e=i(e).not(this.$slider)),e},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.trLine truncated
+484
View File
@@ -0,0 +1,484 @@
(function ($) {
('use strict');
/*
|--------------------------------------------------------------------------
| Template Name: Sattiyas
| Author: Laralink
| Version: 1.0.0
|--------------------------------------------------------------------------
|--------------------------------------------------------------------------
| TABLE OF CONTENTS:
|--------------------------------------------------------------------------
|
| 1. Preloader
| 2. Mobile Menu
| 3. Sticky Header
| 4. Dynamic Background
| 5. Modal Video
| 6. Isotop Initialize
| 7. Scroll Up
| 8. Tabs
| 9. Review
| 10. Slick Slider
| 11. Price Range Slider
| 12. Single product slider
| 13. Shop General
|
*/
/*--------------------------------------------------------------
Scripts initialization
--------------------------------------------------------------*/
$.exists = function (selector) {
return $(selector).length > 0;
};
$(window).on('load', function () {
preloader();
isotopInit();
});
$(function () {
mainNav();
stickyHeader();
dynamicBackground();
modalVideo();
isotopInit();
slickInit();
scrollUp();
tabs();
review();
priceInit();
singleProductSlider();
shopGeneral();
});
$(window).on('scroll', function () {
showScrollUp();
});
/*--------------------------------------------------------------
1. Preloader
--------------------------------------------------------------*/
function preloader() {
$('.cs_perloader').fadeOut();
$('cs_perloader_in').delay(150).fadeOut('slow');
}
/*--------------------------------------------------------------
2. Mobile Menu
--------------------------------------------------------------*/
function mainNav() {
$('.cs_nav').append('<span class="cs_menu_toggle"><span></span></span>');
$('.menu-item-has-children').append(
'<span class="cs_menu_dropdown_toggle"><span></span></span>',
);
$('.cs_menu_toggle').on('click', function () {
$(this)
.toggleClass('cs_toggle_active')
.siblings('.cs_nav_list')
.slideToggle();
});
$('.cs_menu_toggle')
.parents('body')
.find('.cs_side_header')
.addClass('cs_has_main_nav');
$('.cs_menu_toggle')
.parents('body')
.find('.cs_toolbox')
.addClass('cs_has_main_nav');
$('.cs_menu_dropdown_toggle').on('click', function () {
$(this).toggleClass('active').siblings('ul').slideToggle();
$(this).parent().toggleClass('active');
});
$('.cs_header_search_btn').on('click', function () {
$('.cs_header_search_wrap').addClass('active');
});
$('.cs_header_search_close').on('click', function () {
$('.cs_header_search_wrap').removeClass('active');
});
}
/*--------------------------------------------------------------
3. Sticky Header
--------------------------------------------------------------*/
function stickyHeader() {
var $window = $(window);
var lastScrollTop = 0;
var $header = $('.cs_sticky_header');
var headerHeight = $header.outerHeight() + 30;
$window.scroll(function () {
var windowTop = $window.scrollTop();
if (windowTop >= headerHeight) {
$header.addClass('cs_gescout_sticky');
} else {
$header.removeClass('cs_gescout_sticky');
$header.removeClass('cs_gescout_show');
}
if ($header.hasClass('cs_gescout_sticky')) {
if (windowTop < lastScrollTop) {
$header.addClass('cs_gescout_show');
} else {
$header.removeClass('cs_gescout_show');
}
}
lastScrollTop = windowTop;
});
}
/*--------------------------------------------------------------
4. Dynamic Background
--------------------------------------------------------------*/
function dynamicBackground() {
$('[data-src]').each(function () {
var src = $(this).attr('data-src');
$(this).css({
'background-image': 'url(' + src + ')',
});
});
}
/*--------------------------------------------------------------
5. Modal Video
--------------------------------------------------------------*/
function modalVideo() {
if ($.exists('.cs_video_open')) {
$('body').append(`
<div class="cs_video_popup">
<div class="cs_video_popup_overlay"></div>
<div class="cs_video_popup_content">
<div class="cs_video_popup_layer"></div>
<div class="cs_video_popup_container">
<div class="cs_video_popup_align">
<div class="embed_responsive embed_responsive_16by9">
<iframe class="embed_responsive_item" src="about:blank"></iframe>
</div>
</div>
<div class="cs_video_popup_close"></div>
</div>
</div>
</div>
`);
$(document).on('click', '.cs_video_open', function (e) {
e.preventDefault();
var video = $(this).attr('href');
$('.cs_video_popup_container iframe').attr('src', `${video}`);
$('.cs_video_popup').addClass('active');
});
$('.cs_video_popup_close, .cs_video_popup_layer').on(
'click',
function (e) {
$('.cs_video_popup').removeClass('active');
$('html').removeClass('overflow-hidden');
$('.cs_video_popup_container iframe').attr('src', 'about:blank');
e.preventDefault();
},
);
}
}
/*--------------------------------------------------------------
6. Isotop Initialize
--------------------------------------------------------------*/
function isotopInit() {
if ($.exists('.cs_isotope')) {
$('.cs_isotope').isotope({
itemSelector: '.cs_isotope_item',
transitionDuration: '0.60s',
percentPosition: true,
masonry: {
columnWidth: '.cs_grid_sizer',
},
});
/* Active Class of Portfolio*/
$('.cs_isotope_filter ul li').on('click', function (event) {
$(this).siblings('.active').removeClass('active');
$(this).addClass('active');
event.preventDefault();
});
/*=== Portfolio filtering ===*/
$('.cs_isotope_filter ul').on('click', 'a', function () {
var filterElement = $(this).attr('data-filter');
$('.cs_isotope').isotope({
filter: filterElement,
});
});
}
}
/*-----------------------------------------------------------
7. Scroll Up
------------------------------------------------------------*/
function scrollUp() {
$('#cs_scroll_btn').on('click', function (e) {
e.preventDefault();
$('html,body').animate(
{
scrollTop: 0,
},
0,
);
});
}
// For Show Scroll Up
function showScrollUp() {
let scroll = $(window).scrollTop();
if (scroll >= 350) {
$('#cs_scroll_btn').addClass('cs_scrollup_show');
} else {
$('#cs_scroll_btn').removeClass('cs_scrollup_show');
}
}
/*---------------------------------------------------------
8. Tabs
------------------------------------------------------------*/
function tabs() {
$('.cs_tab_links a').on('click', function (e) {
var currentAttrValue = $(this).attr('href');
$('.cs_tabs_fade ' + currentAttrValue)
.fadeIn(400)
.siblings()
.hide();
//Tab and slider both activation code
$('.cs_tabs ' + currentAttrValue)
.addClass('active')
.siblings()
.removeClass('active');
$(this).parents('li').addClass('active').siblings().removeClass('active');
e.preventDefault();
});
}
/*-----------------------------------------------------------
9. Review
--------------------------------------------------------------*/
function review() {
$('.cs_rating').each(function () {
var review = $(this).data('rating');
var reviewVal = review * 20 + '%';
$(this).find('.cs_rating_percentage').css('width', reviewVal);
});
}
/*-----------------------------------------------------------
10. Slick Slider
--------------------------------------------------------------*/
var helpers = {
addZeros: function (n) {
return n < 10 ? '0' + n : '' + n;
},
};
function slickInit() {
if ($.exists('.cs_slider')) {
$('.cs_slider').each(function () {
// Slick Variable
var $ts = $(this).find('.cs_slider_container');
var $slickActive = $(this).find('.cs_slider_wrapper');
// Auto Play
var autoPlayVar = parseInt($ts.attr('data-autoplay'), 10);
// Auto Play Time Out
var autoplaySpdVar = 3000;
if (autoPlayVar > 1) {
autoplaySpdVar = autoPlayVar;
autoPlayVar = 1;
}
// Slide Change Speed
var speedVar = parseInt($ts.attr('data-speed'), 10);
// Slider Loop
var loopVar = Boolean(parseInt($ts.attr('data-loop'), 10));
// Slider Center
var centerVar = Boolean(parseInt($ts.attr('data-center'), 10));
// Variable Width
var variableWidthVar = Boolean(
parseInt($ts.attr('data-variable-width'), 10),
);
// Pagination
var paginaiton = $(this)
.find('.cs_pagination')
.hasClass('cs_pagination');
// Slide Per View
var slidesPerView = $ts.attr('data-slides-per-view');
if (slidesPerView == 1) {
slidesPerView = 1;
}
if (slidesPerView == 'responsive') {
var slidesPerView = parseInt($ts.attr('data-add-slides'), 10);
var lgPoint = parseInt($ts.attr('data-lg-slides'), 10);
var mdPoint = parseInt($ts.attr('data-md-slides'), 10);
var smPoint = parseInt($ts.attr('data-sm-slides'), 10);
var xsPoint = parseInt($ts.attr('data-xs-slides'), 10);
var xxsPoint = parseInt($ts.attr('data-xxs-slides'), 10);
}
// Fade Slider
var fadeVar = parseInt($($ts).attr('data-fade-slide'));
fadeVar === 1 ? (fadeVar = true) : (fadeVar = false);
// Slick Active Code
$slickActive.slick({
centerMode: centerVar,
autoplay: autoPlayVar,
dots: paginaiton,
speed: speedVar,
infinite: loopVar,
autoplaySpeed: autoplaySpdVar,
fade: fadeVar,
prevArrow: $(this).find('.cs_left_arrow'),
nextArrow: $(this).find('.cs_right_arrow'),
appendDots: $(this).find('.cs_pagination'),
slidesToShow: slidesPerView,
variableWidth: variableWidthVar,
responsive: [
{
breakpoint: 1600,
settings: {
slidesToShow: lgPoint,
},
},
{
breakpoint: 1200,
settings: {
slidesToShow: mdPoint,
},
},
{
breakpoint: 992,
settings: {
slidesToShow: smPoint,
},
},
{
breakpoint: 768,
settings: {
slidesToShow: xsPoint,
},
},
{
breakpoint: 180,
settings: {
slidesToShow: xxsPoint,
},
},
],
});
// Slider Number
if ($(this).find('.slick_slide_in').length > 1) {
$(this).siblings('.cs_slides_numbers').show();
}
$(this).on('afterChange', function (event, slick, currentSlide) {
$(this)
.find('.cs_slides_numbers .active')
.html(helpers.addZeros(currentSlide + 1));
});
var sliderItemsNum = $(this)
.find('.slick-slide')
.not('.slick-cloned').length;
$(this)
.find('.cs_slides_numbers .cs_total_slide')
.html(helpers.addZeros(sliderItemsNum));
});
}
}
/*-----------------------------------------------------------
11. Price Range Slider
------------------------------------------------------------*/
function priceInit() {
if ($.exists('#slider_range')) {
$('#slider_range').slider({
range: true,
min: 0,
max: 1000,
values: [100, 600],
slide: function (event, ui) {
$('#amount').val(
'Price: $' + ui.values[0] + '.00 - $' + ui.values[1] + '.00',
);
},
});
}
if ($.exists('#amount')) {
$('#amount').val(
'Price: $' +
$('#slider_range').slider('values', 0) +
'.00 - $' +
$('#slider_range').slider('values', 1) +
'.00',
);
}
}
/*----------------------------------------------------------
12. Single product slider
------------------------------------------------------------*/
function singleProductSlider() {
// Product Single Slider
$('.cs_single_product_thumb').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
asNavFor: '.cs_single_product_nav',
vertical: true,
});
$('.cs_single_product_nav').slick({
slidesToShow: 4,
slidesToScroll: 1,
asNavFor: '.cs_single_product_thumb',
focusOnSelect: true,
arrows: false,
vertical: true,
});
}
/*----------------------------------------------------------
13. Shop General
------------------------------------------------------------*/
function shopGeneral() {
// List and Grid View Toggle
$('.cs_grid_btn').on('click', function () {
$(this).addClass('active').siblings().removeClass('active');
$('.cs_product_grid')
.addClass('cs_grid_view')
.removeClass('cs_list_view');
});
$('.cs_list_btn').on('click', function () {
$(this).addClass('active').siblings().removeClass('active');
$('.cs_product_grid')
.addClass('cs_list_view')
.removeClass('cs_grid_view');
});
// Filter Widget Toggle
$('.cs_filter_widget_title').on('click', function () {
$(this).toggleClass('active').siblings().slideToggle();
});
// Filter Sidebar Show And Hide
$('.cs_filter_btn').on('click', function () {
$('.cs_shop_filter').addClass('active');
});
$('.cs_filter_close, .cs_filter_overlay').on('click', function () {
$('.cs_shop_filter').removeClass('active');
});
// Star Rating Input
$('.cs_input_rating i').on('click', function () {
$(this).siblings().removeClass('fa-solid');
$(this).addClass('fa-solid').prevAll().addClass('fa-solid');
});
// Quantity Increment and Decrement
$('.cs_increment').click(function () {
var countElement = $(this).siblings('.cs_quantity_input');
var count = parseInt(countElement.text());
count++;
countElement.text(count);
});
$('.cs_decrement').click(function () {
var countElement = $(this).siblings('.cs_quantity_input');
var count = parseInt(countElement.text());
if (count > 0) {
count--;
countElement.text(count);
}
});
}
})(jQuery); // End of use strict