Initialize website project structure

This commit is contained in:
2026-05-29 20:13:30 -04:00
parent dd3d820d0e
commit 86fac8853a
983 changed files with 181580 additions and 0 deletions
File diff suppressed because one or more lines are too long
+815
View File
@@ -0,0 +1,815 @@
//
// SmoothScroll for websites v1.5.1 (Balazs Galambosi)
// http://www.smoothscroll.net/
//
// Licensed under the terms of the MIT license.
//
// You may use it in your theme if you credit me.
// It is also free to use on any individual website.
//
// Exception:
// The only restriction is to not publish any
// extension for browsers or native application
// without getting a written permission first.
//
(function () {
// Scroll Variables (tweakable)
var defaultOptions = {
// Scrolling Core
frameRate : 300, // [Hz]
animationTime : 600, // [ms]
stepSize : 100, // [px]
// Pulse (less tweakable)
// ratio of "tail" to "acceleration"
pulseAlgorithm : true,
pulseScale : 4,
pulseNormalize : 1,
// Acceleration
accelerationDelta : 50, // 50
accelerationMax : 3, // 3
// Keyboard Settings
keyboardSupport : true, // option
arrowScroll : 50, // [px]
// Other
fixedBackground : true,
excluded : ''
};
var options = defaultOptions;
// Other Variables
var isExcluded = false;
var isFrame = false;
var direction = { x: 0, y: 0 };
var initDone = false;
var root = document.documentElement;
var activeElement;
var observer;
var refreshSize;
var deltaBuffer = [];
var deltaBufferTimer;
var isMac = /^Mac/.test(navigator.platform);
/***********************************************
* INITIALIZE
***********************************************/
/**
* Tests if smooth scrolling is allowed. Shuts down everything if not.
*/
function initTest() {
if (options.keyboardSupport) {
addEvent('keydown', keydown);
}
}
/**
* Sets up scrolls array, determines if frames are involved.
*/
function init() {
if (initDone || !document.body) return;
initDone = true;
var body = document.body;
var html = document.documentElement;
var windowHeight = window.innerHeight;
var scrollHeight = body.scrollHeight;
// check compat mode for root element
root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;
activeElement = body;
initTest();
// Checks if this script is running in a frame
if (top != self) {
isFrame = true;
}
/**
* Safari 10 fixed it, Chrome fixed it in v45:
* This fixes a bug where the areas left and right to
* the content does not trigger the onmousewheel event
* on some pages. e.g.: html, body { height: 100% }
*/
else if (isOldSafari &&
scrollHeight > windowHeight &&
(body.offsetHeight <= windowHeight ||
html.offsetHeight <= windowHeight)) {
var fullPageElem = document.createElement('div');
fullPageElem.style.cssText = 'position:absolute; z-index:-10000; ' +
'top:0; left:0; right:0; height:' +
root.scrollHeight + 'px';
document.body.appendChild(fullPageElem);
// DOM changed (throttled) to fix height
var pendingRefresh;
refreshSize = function () {
if (pendingRefresh) return; // could also be: clearTimeout(pendingRefresh);
pendingRefresh = setTimeout(function () {
if (isExcluded) return; // could be running after cleanup
fullPageElem.style.height = '0';
fullPageElem.style.height = root.scrollHeight + 'px';
pendingRefresh = null;
}, 500); // act rarely to stay fast
};
setTimeout(refreshSize, 10);
addEvent('resize', refreshSize);
// TODO: attributeFilter?
var config = {
attributes: true,
childList: true,
characterData: false
// subtree: true
};
observer = new MutationObserver(refreshSize);
observer.observe(body, config);
if (root.offsetHeight <= windowHeight) {
var clearfix = document.createElement('div');
clearfix.style.clear = 'both';
body.appendChild(clearfix);
}
}
// disable fixed background
if (!options.fixedBackground && !isExcluded) {
body.style.backgroundAttachment = 'scroll';
html.style.backgroundAttachment = 'scroll';
}
}
/**
* Removes event listeners and other traces left on the page.
*/
function cleanup() {
observer && observer.disconnect();
removeEvent(wheelEvent, wheel);
removeEvent('mousedown', mousedown);
removeEvent('keydown', keydown);
removeEvent('resize', refreshSize);
removeEvent('load', init);
}
/************************************************
* SCROLLING
************************************************/
var que = [];
var pending = false;
var lastScroll = Date.now();
/**
* Pushes scroll actions to the scrolling queue.
*/
function scrollArray(elem, left, top) {
directionCheck(left, top);
if (options.accelerationMax != 1) {
var now = Date.now();
var elapsed = now - lastScroll;
if (elapsed < options.accelerationDelta) {
var factor = (1 + (50 / elapsed)) / 2;
if (factor > 1) {
factor = Math.min(factor, options.accelerationMax);
left *= factor;
top *= factor;
}
}
lastScroll = Date.now();
}
// push a scroll command
que.push({
x: left,
y: top,
lastX: (left < 0) ? 0.99 : -0.99,
lastY: (top < 0) ? 0.99 : -0.99,
start: Date.now()
});
// don't act if there's a pending queue
if (pending) {
return;
}
var scrollRoot = getScrollRoot();
var isWindowScroll = (elem === scrollRoot || elem === document.body);
// if we haven't already fixed the behavior,
// and it needs fixing for this sesh
if (elem.$scrollBehavior == null && isScrollBehaviorSmooth(elem)) {
elem.$scrollBehavior = elem.style.scrollBehavior;
elem.style.scrollBehavior = 'auto';
}
var step = function (time) {
var now = Date.now();
var scrollX = 0;
var scrollY = 0;
for (var i = 0; i < que.length; i++) {
var item = que[i];
var elapsed = now - item.start;
var finished = (elapsed >= options.animationTime);
// scroll position: [0, 1]
var position = (finished) ? 1 : elapsed / options.animationTime;
// easing [optional]
if (options.pulseAlgorithm) {
position = pulse(position);
}
// only need the difference
var x = (item.x * position - item.lastX) >> 0;
var y = (item.y * position - item.lastY) >> 0;
// add this to the total scrolling
scrollX += x;
scrollY += y;
// update last values
item.lastX += x;
item.lastY += y;
// delete and step back if it's over
if (finished) {
que.splice(i, 1); i--;
}
}
// scroll left and top
if (isWindowScroll) {
window.scrollBy(scrollX, scrollY);
}
else {
if (scrollX) elem.scrollLeft += scrollX;
if (scrollY) elem.scrollTop += scrollY;
}
// clean up if there's nothing left to do
if (!left && !top) {
que = [];
}
if (que.length) {
requestFrame(step, elem, (1000 / options.frameRate + 1));
} else {
pending = false;
// restore default behavior at the end of scrolling sesh
if (elem.$scrollBehavior != null) {
elem.style.scrollBehavior = elem.$scrollBehavior;
elem.$scrollBehavior = null;
}
}
};
// start a new queue of actions
requestFrame(step, elem, 0);
pending = true;
}
/***********************************************
* EVENTS
***********************************************/
/**
* Mouse wheel handler.
* @param {Object} event
*/
function wheel(event) {
if (!initDone) {
init();
}
var target = getEventTargetDeep(event);
// leave early if default action is prevented
// or it's a zooming event with CTRL
if (event.defaultPrevented || event.ctrlKey) {
return true;
}
// leave embedded content alone (flash & pdf)
if (isNodeName(activeElement, 'embed') ||
(isNodeName(target, 'embed') && /\.pdf/i.test(target.src)) ||
isNodeName(activeElement, 'object')) {
return true;
}
// TODO:
//
// wheelDeltaY (DEPRECATED):
// - Mac: positive (+) for scrolling down; Win: negative (-) for up
// - Mac & Win: in simple case multiple of 120 or 100 (except Firefox maybe)
// - scaled by zoom level (hard to detect, devicePixelRatio affected by ppi)
// deltaY (NEW):
// - Mac: negative (-) for scrolling down; Win: positive (+) for up
// - Win: in simple case it's multiple of 300
// - Mac: can be any number because of default shitty "acceleration"
// some third party apps might change it to line-based (120x)
// - scaled by zoom level (hard to detect, devicePixelRatio affected by ppi)
//
// For touchpad in Chromium this seems to hold true:
// e.wheelDeltaY === (e.deltaY * -3)
// but it also holds for mouses on Safari Mac with default "acceleration".
// Also not future-proof because wheelDeltaY is deprecated
var deltaX = -event.wheelDeltaX || event.deltaX || 0;
var deltaY = -event.wheelDeltaY || event.deltaY || 0;
if (isMac) {
if (event.wheelDeltaX && isDivisible(event.wheelDeltaX, 120)) {
deltaX = -120 * (event.wheelDeltaX / Math.abs(event.wheelDeltaX));
}
if (event.wheelDeltaY && isDivisible(event.wheelDeltaY, 120)) {
deltaY = -120 * (event.wheelDeltaY / Math.abs(event.wheelDeltaY));
}
}
// use wheelDelta if deltaX/Y is not available
if (!deltaX && !deltaY) {
deltaY = -event.wheelDelta || 0;
}
// line based scrolling (Firefox mostly)
if (event.deltaMode === 1) {
deltaX *= 40;
deltaY *= 40;
}
var overflowing = overflowingAncestor(target);
// nothing to do if there's no element that's scrollable
if (!overflowing) {
// except Chrome iframes seem to eat wheel events, which we need to
// propagate up, if the iframe has nothing overflowing to scroll
if (isFrame && isChrome) {
// change target to iframe element itself for the parent frame
Object.defineProperty(event, "target", {value: window.frameElement});
return parent.wheel(event);
}
return true;
}
// check if it's a touchpad scroll that should be ignored
if (isTouchpad(deltaY)) {
return true;
}
// scale by step size
// delta is 120 most of the time
// synaptics seems to send 1 sometimes
if (Math.abs(deltaX) > 1.2) {
deltaX *= options.stepSize / 120;
}
if (Math.abs(deltaY) > 1.2) {
deltaY *= options.stepSize / 120;
}
scrollArray(overflowing, deltaX, deltaY);
event.preventDefault();
scheduleClearCache();
}
/**
* Keydown event handler.
* @param {Object} event
*/
function keydown(event) {
var target = getEventTargetDeep(event);
var modifier = event.ctrlKey || event.altKey || event.metaKey ||
(event.shiftKey && event.code !== 'Space');
// our own tracked active element could've been removed from the DOM
if (!document.body.contains(activeElement)) {
activeElement = document.activeElement;
}
// do nothing if user is editing text
// or using a modifier key (except shift)
// or in a dropdown
// or inside interactive elements
var inputNodeNames = /^(textarea|select|embed|object)$/i;
var buttonTypes = /^(button|submit|radio|checkbox|file|color|image)$/i;
if ( event.defaultPrevented ||
inputNodeNames.test(target.nodeName) ||
isNodeName(target, 'input') && !buttonTypes.test(target.type) ||
isNodeName(activeElement, 'video') ||
isInsideYoutubeVideo(event) ||
target.isContentEditable ||
modifier ) {
return true;
}
// [spacebar] should trigger button press, leave it alone
if ((isNodeName(target, 'button') ||
isNodeName(target, 'input') && buttonTypes.test(target.type)) &&
event.code === 'Space') {
return true;
}
// [arrow keys] on radio buttons should be left alone
if (isNodeName(target, 'input') && target.type == 'radio' &&
(event.code === 'ArrowUp' || event.code === 'ArrowDown' ||
event.code === 'ArrowLeft' || event.code === 'ArrowRight')) {
return true;
}
var shift, x = 0, y = 0;
var overflowing = overflowingAncestor(activeElement);
if (!overflowing) {
// Chrome iframes seem to eat key events, which we need to
// propagate up, if the iframe has nothing overflowing to scroll
return (isFrame && isChrome) ? parent.keydown(event) : true;
}
var clientHeight = overflowing.clientHeight;
if (overflowing == document.body) {
clientHeight = window.innerHeight;
}
switch (event.code) {
case 'ArrowUp':
y = -options.arrowScroll;
break;
case 'ArrowDown':
y = options.arrowScroll;
break;
case 'Space':
shift = event.shiftKey ? 1 : -1;
y = -shift * clientHeight * 0.9;
break;
case 'PageUp':
y = -clientHeight * 0.9;
break;
case 'PageDown':
y = clientHeight * 0.9;
break;
case 'Home':
if (overflowing == document.body && document.scrollingElement)
overflowing = document.scrollingElement;
y = -overflowing.scrollTop;
break;
case 'End':
var scroll = overflowing.scrollHeight - overflowing.scrollTop;
var scrollRemaining = scroll - clientHeight;
y = (scrollRemaining > 0) ? scrollRemaining + 10 : 0;
break;
case 'ArrowLeft':
x = -options.arrowScroll;
break;
case 'ArrowRight':
x = options.arrowScroll;
break;
default:
return true; // a key we don't care about
}
scrollArray(overflowing, x, y);
event.preventDefault();
scheduleClearCache();
}
/**
* Mousedown event only for updating activeElement
*/
function mousedown(event) {
activeElement = getEventTargetDeep(event);
}
/**
* Get the deepest event target even through shadow DOM.
* @param {Object} event
* @return {Element}
*/
function getEventTargetDeep(event) {
return event.composedPath ? event.composedPath()[0] : event.target;
}
/***********************************************
* OVERFLOW
***********************************************/
var uniqueID = (function () {
var i = 0;
return function (el) {
return el.uniqueID || (el.uniqueID = i++);
};
})();
var cacheX = {}; // cleared out after a scrolling session
var cacheY = {}; // cleared out after a scrolling session
var clearCacheTimer;
var smoothBehaviorForElement = {};
//setInterval(function () { cache = {}; }, 10 * 1000);
function scheduleClearCache() {
clearTimeout(clearCacheTimer);
clearCacheTimer = setInterval(function () {
cacheX = cacheY = smoothBehaviorForElement = {};
}, 1*1000);
}
function setCache(elems, overflowing, x) {
var cache = x ? cacheX : cacheY;
for (var i = elems.length; i--;)
cache[uniqueID(elems[i])] = overflowing;
return overflowing;
}
function getCache(el, x) {
return (x ? cacheX : cacheY)[uniqueID(el)];
}
// (body) (root)
// | hidden | visible | scroll | auto |
// hidden | no | no | YES | YES |
// visible | no | YES | YES | YES |
// scroll | no | YES | YES | YES |
// auto | no | YES | YES | YES |
function overflowingAncestor(el) {
var elems = [];
var body = document.body;
var rootScrollHeight = root.scrollHeight;
while (el) {
var cached = getCache(el, false);
if (cached) {
return setCache(elems, cached);
}
elems.push(el);
if (rootScrollHeight === el.scrollHeight) {
var topOverflowsNotHidden = overflowNotHidden(root) && overflowNotHidden(body);
var isOverflowCSS = topOverflowsNotHidden || overflowAutoOrScroll(root);
if (isFrame && isContentOverflowing(root) ||
!isFrame && isOverflowCSS) {
return setCache(elems, getScrollRoot());
}
} else if (isContentOverflowing(el) && overflowAutoOrScroll(el)) {
return setCache(elems, el);
}
// Support shadow DOM
el = el.parentElement || (el.getRootNode && el.getRootNode().host);
}
}
function isContentOverflowing(el) {
return (el.clientHeight + 10 < el.scrollHeight);
}
// typically for <body> and <html>
function overflowNotHidden(el) {
var overflow = getComputedStyle(el, '').getPropertyValue('overflow-y');
return (overflow !== 'hidden');
}
// for all other elements
function overflowAutoOrScroll(el) {
var overflow = getComputedStyle(el, '').getPropertyValue('overflow-y');
return (overflow === 'scroll' || overflow === 'auto');
}
// for all other elements
function isScrollBehaviorSmooth(el) {
var id = uniqueID(el);
if (smoothBehaviorForElement[id] == null) {
var scrollBehavior = getComputedStyle(el, '')['scroll-behavior'];
smoothBehaviorForElement[id] = ('smooth' == scrollBehavior);
}
return smoothBehaviorForElement[id];
}
/***********************************************
* HELPERS
***********************************************/
function addEvent(type, fn, arg) {
window.addEventListener(type, fn, arg || false);
}
function removeEvent(type, fn, arg) {
window.removeEventListener(type, fn, arg || false);
}
function isNodeName(el, tag) {
return el && (el.nodeName||'').toLowerCase() === tag.toLowerCase();
}
function directionCheck(x, y) {
x = (x > 0) ? 1 : -1;
y = (y > 0) ? 1 : -1;
if (direction.x !== x || direction.y !== y) {
direction.x = x;
direction.y = y;
que = [];
lastScroll = 0;
}
}
try { // #46 Safari throws in private browsing for localStorage
if (localStorage.SS_deltaBuffer) {
deltaBuffer = localStorage.SS_deltaBuffer.split(',');
}
} catch (e) { }
function isTouchpad(deltaY) {
if (!deltaY) return;
if (!deltaBuffer.length) {
deltaBuffer = [deltaY, deltaY, deltaY];
}
deltaY = Math.abs(deltaY);
deltaBuffer.push(deltaY);
deltaBuffer.shift();
clearTimeout(deltaBufferTimer);
deltaBufferTimer = setTimeout(function () {
try { // #46 Safari throws in private browsing for localStorage
localStorage.SS_deltaBuffer = deltaBuffer.join(',');
} catch (e) { }
}, 1000);
var dpiScaledWheelDelta = deltaY > 120 && allDeltasDivisableBy(deltaY); // win64
var tp = !allDeltasDivisableBy(120) && !allDeltasDivisableBy(100) && !dpiScaledWheelDelta;
if (deltaY < 50) return true;
return tp;
}
function isDivisible(n, divisor) {
return (Math.floor(n / divisor) == n / divisor);
}
function allDeltasDivisableBy(divisor) {
return (isDivisible(deltaBuffer[0], divisor) &&
isDivisible(deltaBuffer[1], divisor) &&
isDivisible(deltaBuffer[2], divisor));
}
function isInsideYoutubeVideo(event) {
var elem = getEventTargetDeep(event);
var isControl = false;
if (document.URL.indexOf ('www.youtube.com/watch') != -1) {
do {
isControl = (elem.classList &&
elem.classList.contains('html5-video-controls'));
if (isControl) break;
} while ((elem = elem.parentNode));
}
return isControl;
}
var requestFrame = (function () {
return (window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function (callback, element, delay) {
window.setTimeout(callback, delay || (1000/60));
});
})();
var MutationObserver = (window.MutationObserver ||
window.WebKitMutationObserver ||
window.MozMutationObserver);
var getScrollRoot = (function() {
var SCROLL_ROOT = document.scrollingElement;
return function() {
if (!SCROLL_ROOT) {
var dummy = document.createElement('div');
dummy.style.cssText = 'height:10000px;width:1px;';
document.body.appendChild(dummy);
var bodyScrollTop = document.body.scrollTop;
var docElScrollTop = document.documentElement.scrollTop;
window.scrollBy(0, 3);
if (document.body.scrollTop != bodyScrollTop)
(SCROLL_ROOT = document.body);
else
(SCROLL_ROOT = document.documentElement);
window.scrollBy(0, -3);
document.body.removeChild(dummy);
}
return SCROLL_ROOT;
};
})();
/***********************************************
* PULSE (by Michael Herf)
***********************************************/
/**
* Viscous fluid with a pulse for part and decay for the rest.
* - Applies a fixed force over an interval (a damped acceleration), and
* - Lets the exponential bleed away the velocity over a longer interval
* - Michael Herf, http://stereopsis.com/stopping/
*/
function pulse_(x) {
var val, start, expx;
// test
x = x * options.pulseScale;
if (x < 1) { // acceleartion
val = x - (1 - Math.exp(-x));
} else { // tail
// the previous animation ended here:
start = Math.exp(-1);
// simple viscous drag
x -= 1;
expx = 1 - Math.exp(-x);
val = start + (expx * (1 - start));
}
return val * options.pulseNormalize;
}
function pulse(x) {
if (x >= 1) return 1;
if (x <= 0) return 0;
if (options.pulseNormalize == 1) {
options.pulseNormalize /= pulse_(1);
}
return pulse_(x);
}
/***********************************************
* FIRST RUN
***********************************************/
var userAgent = window.navigator.userAgent;
var isEdge = /Edge/.test(userAgent); // thank you MS
var isChrome = /chrome/i.test(userAgent) && !isEdge;
var isSafari = /safari/i.test(userAgent) && !isEdge;
var isMobile = /mobile/i.test(userAgent);
var isIEWin7 = /Windows NT 6.1/i.test(userAgent) && /rv:11/i.test(userAgent);
var isOldSafari = isSafari && (/Version\/8/i.test(userAgent) || /Version\/9/i.test(userAgent));
var isEnabledForBrowser = (isChrome || isSafari || isIEWin7) && !isMobile;
var supportsPassive = false;
try {
window.addEventListener("test", null, Object.defineProperty({}, 'passive', {
get: function () {
supportsPassive = true;
}
}));
} catch(e) {}
var wheelOpt = supportsPassive ? { passive: false } : false;
var wheelEvent = 'onwheel' in document.createElement('div') ? 'wheel' : 'mousewheel';
if (wheelEvent && isEnabledForBrowser) {
addEvent(wheelEvent, wheel, wheelOpt);
addEvent('mousedown', mousedown);
addEvent('load', init);
}
/***********************************************
* PUBLIC INTERFACE
***********************************************/
function SmoothScroll(optionsToSet) {
for (var key in optionsToSet)
if (defaultOptions.hasOwnProperty(key))
options[key] = optionsToSet[key];
}
SmoothScroll.destroy = cleanup;
if (window.SmoothScrollOptions) // async API
SmoothScroll(window.SmoothScrollOptions);
if (typeof define === 'function' && define.amd)
define(function() {
return SmoothScroll;
});
else if ('object' == typeof exports)
module.exports = SmoothScroll;
else
window.SmoothScroll = SmoothScroll;
})();
+11
View File
@@ -0,0 +1,11 @@
/*!
* SplitText 3.13.0
* https://gsap.com
*
* @license Copyright 2025, GreenSock. All rights reserved. Subject to the terms at https://gsap.com/standard-license.
* @author: Jack Doyle
*/
(function(B,A){typeof exports=="object"&&typeof module!="undefined"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(B=typeof globalThis!="undefined"?globalThis:B||self,A(B.window=B.window||{}))})(this,function(B){"use strict";let A,_,G,re=()=>G||U.register(window.gsap),V=typeof Intl!="undefined"?new Intl.Segmenter:0,P=e=>typeof e=="string"?P(document.querySelectorAll(e)):"length"in e?Array.from(e):[e],X=e=>P(e).filter(t=>t instanceof HTMLElement),J=[],K=function(){},oe=/\s+/g,Y=new RegExp("\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u{200D}\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?)*|.","gu"),Z={left:0,top:0,width:0,height:0},ee=(e,t)=>{if(t){let s=new Set(e.join("").match(t)||J),i=e.length,o,c,n,a;if(s.size)for(;--i>-1;){c=e[i];for(n of s)if(n.startsWith(c)&&n.length>c.length){for(o=0,a=c;n.startsWith(a+=e[i+ ++o])&&a.length<n.length;);if(o&&a.length===n.length){e[i]=n,e.splice(i+1,o);break}}}}return e},te=e=>window.getComputedStyle(e).display==="inline"&&(e.style.display="inline-block"),z=(e,t,s)=>t.insertBefore(typeof e=="string"?document.createTextNode(e):e,s),Q=(e,t,s)=>{let i=t[e+"sClass"]||"",{tag:o="div",aria:c="auto",propIndex:n=!1}=t,a=e==="line"?"block":"inline-block",h=i.indexOf("++")>-1,b=x=>{let g=document.createElement(o),C=s.length+1;return i&&(g.className=i+(h?" "+i+C:"")),n&&g.style.setProperty("--"+e,C+""),c!=="none"&&g.setAttribute("aria-hidden","true"),o!=="span"&&(g.style.position="relative",g.style.display=a),g.textContent=x,s.push(g),g};return h&&(i=i.replace("++","")),b.collection=s,b},ae=(e,t,s,i)=>{let o=Q("line",s,i),c=window.getComputedStyle(e).textAlign||"left";return(n,a)=>{let h=o("");for(h.style.textAlign=c,e.insertBefore(h,t[n]);n<a;n++)h.appendChild(t[n]);h.normalize()}},ie=(e,t,s,i,o,c,n,a,h,b)=>{var x;let g=Array.from(e.childNodes),C=0,{wordDelimiter:R,reduceWhiteSpace:L=!0,prepareText:$}=t,q=e.getBoundingClientRect(),j=q,D=!L&&window.getComputedStyle(e).whiteSpace.substring(0,3)==="pre",E=0,v=s.collection,r,f,H,l,m,y,I,d,u,W,S,O,T,F,w,p,k,N;for(typeof R=="object"?(H=R.delimiter||R,f=R.replaceWith||""):f=R===""?"":R||" ",r=f!==" ";C<g.length;C++)if(l=g[C],l.nodeType===3){for(w=l.textContent||"",L?w=w.replace(oe," "):D&&(w=w.replace(/\n/g,f+`
`)),$&&(w=$(w,e)),l.textContent=w,m=f||H?w.split(H||f):w.match(a)||J,k=m[m.length-1],d=r?k.slice(-1)===" ":!k,k||m.pop(),j=q,I=r?m[0].charAt(0)===" ":!m[0],I&&z(" ",e,l),m[0]||m.shift(),ee(m,h),c&&b||(l.textContent=""),u=1;u<=m.length;u++)if(p=m[u-1],!L&&D&&p.charAt(0)===`
`&&((x=l.previousSibling)==null||x.remove(),z(document.createElement("br"),e,l),p=p.slice(1)),!L&&p==="")z(f,e,l);else if(p===" ")e.insertBefore(document.createTextNode(" "),l);else{if(r&&p.charAt(0)===" "&&z(" ",e,l),E&&u===1&&!I&&v.indexOf(E.parentNode)>-1?(y=v[v.length-1],y.appendChild(document.createTextNode(i?"":p))):(y=s(i?"":p),z(y,e,l),E&&u===1&&!I&&y.insertBefore(E,y.firstChild)),i)for(S=V?ee([...V.segment(p)].map(M=>M.segment),h):p.match(a)||J,N=0;N<S.length;N++)y.appendChild(S[N]===" "?document.createTextNode(" "):i(S[N]));if(c&&b){if(w=l.textContent=w.substring(p.length+1,w.length),W=y.getBoundingClientRect(),W.top>j.top&&W.left<=j.left){for(O=e.cloneNode(),T=e.childNodes[0];T&&T!==y;)F=T,T=T.nextSibling,O.appendChild(F);e.parentNode.insertBefore(O,e),o&&te(O)}j=W}(u<m.length||d)&&z(u>=m.length?" ":r&&p.slice(-1)===" "?" "+f:f,e,l)}e.removeChild(l),E=0}else l.nodeType===1&&(n&&n.indexOf(l)>-1?(v.indexOf(l.previousSibling)>-1&&v[v.length-1].appendChild(l),E=l):(ie(l,t,s,i,o,c,n,a,h,!0),E=0),o&&te(l))};const ne=class se{constructor(t,s){this.isSplit=!1,re(),this.elements=X(t),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=s,this._split=()=>this.isSplit&&this.split(this.vars);let i=[],o,c=()=>{let n=i.length,a;for(;n--;){a=i[n];let h=a.element.offsetWidth;if(h!==a.width){a.width=h,this._split();return}}};this._data={orig:i,obs:typeof ResizeObserver!="undefined"&&new ResizeObserver(()=>{clearTimeout(o),o=setTimeout(c,200)})},K(this),this.split(s)}split(t){this.isSplit&&this.revert(),this.vars=t=t||this.vars||{};let{type:s="chars,words,lines",aria:i="auto",deepSlice:o=!0,smartWrap:c,onSplit:n,autoSplit:a=!1,specialChars:h,mask:b}=this.vars,x=s.indexOf("lines")>-1,g=s.indexOf("chars")>-1,C=s.indexOf("words")>-1,R=g&&!C&&!x,L=h&&("push"in h?new RegExp("(?:"+h.join("|")+")","gu"):h),$=L?new RegExp(L.source+"|"+Y.source,"gu"):Y,q=!!t.ignore&&X(t.ignore),{orig:j,animTime:D,obs:E}=this._data,v;return(g||C||x)&&(this.elements.forEach((r,f)=>{j[f]={element:r,html:r.innerHTML,ariaL:r.getAttribute("aria-label"),ariaH:r.getAttribute("aria-hidden")},i==="auto"?r.setAttribute("aria-label",(r.textContent||"").trim()):i==="hidden"&&r.setAttribute("aria-hidden","true");let H=[],l=[],m=[],y=g?Q("char",t,H):null,I=Q("word",t,l),d,u,W,S;if(ie(r,t,I,y,R,o&&(x||R),q,$,L,!1),x){let O=P(r.childNodes),T=ae(r,O,t,m),F,w=[],p=0,k=O.map(M=>M.nodeType===1?M.getBoundingClientRect():Z),N=Z;for(d=0;d<O.length;d++)F=O[d],F.nodeType===1&&(F.nodeName==="BR"?(w.push(F),T(p,d+1),p=d+1,N=k[p]):(d&&k[d].top>N.top&&k[d].left<=N.left&&(T(p,d),p=d),N=k[d]));p<d&&T(p,d),w.forEach(M=>{var le;return(le=M.parentNode)==null?void 0:le.removeChild(M)})}if(!C){for(d=0;d<l.length;d++)if(u=l[d],g||!u.nextSibling||u.nextSibling.nodeType!==3)if(c&&!x){for(W=document.createElement("span"),W.style.whiteSpace="nowrap";u.firstChild;)W.appendChild(u.firstChild);u.replaceWith(W)}else u.replaceWith(...u.childNodes);else S=u.nextSibling,S&&S.nodeType===3&&(S.textContent=(u.textContent||"")+(S.textContent||""),u.remove());l.length=0,r.normalize()}this.lines.push(...m),this.words.push(...l),this.chars.push(...H)}),b&&this[b]&&this.masks.push(...this[b].map(r=>{let f=r.cloneNode();return r.replaceWith(f),f.appendChild(r),r.className&&(f.className=r.className.replace(/(\b\w+\b)/g,"$1-mask")),f.style.overflow="clip",f}))),this.isSplit=!0,_&&(a?_.addEventListener("loadingdone",this._split):_.status==="loading"&&console.warn("SplitText called before fonts loaded")),(v=n&&n(this))&&v.totalTime&&(this._data.anim=D?v.totalTime(D):v),x&&a&&this.elements.forEach((r,f)=>{j[f].width=r.offsetWidth,E&&E.observe(r)}),this}revert(){var t,s;let{orig:i,anim:o,obs:c}=this._data;return c&&c.disconnect(),i.forEach(({element:n,html:a,ariaL:h,ariaH:b})=>{n.innerHTML=a,h?n.setAttribute("aria-label",h):n.removeAttribute("aria-label"),b?n.setAttribute("aria-hidden",b):n.removeAttribute("aria-hidden")}),this.chars.length=this.words.length=this.lines.length=i.length=this.masks.length=0,this.isSplit=!1,_==null||_.removeEventListener("loadingdone",this._split),o&&(this._data.animTime=o.totalTime(),o.revert()),(s=(t=this.vars).onRevert)==null||s.call(t,this),this}static create(t,s){return new se(t,s)}static register(t){A=A||t||window.gsap,A&&(P=A.utils.toArray,K=A.core.context||K),!G&&window.innerWidth>0&&(_=document.fonts,G=!0)}};ne.version="3.13.0";let U=ne;B.SplitText=U,B.default=U,Object.defineProperty(B,"__esModule",{value:!0})});
File diff suppressed because one or more lines are too long
+66
View File
@@ -0,0 +1,66 @@
{
"name": "codeigniter4/framework",
"description": "The CodeIgniter framework v4",
"license": "MIT",
"type": "project",
"homepage": "https://codeigniter.com",
"support": {
"forum": "https://forum.codeigniter.com/",
"source": "https://github.com/codeigniter4/CodeIgniter4",
"slack": "https://codeigniterchat.slack.com"
},
"require": {
"php": "^8.1",
"ext-intl": "*",
"ext-mbstring": "*",
"laminas/laminas-escaper": "^2.13",
"psr/log": "^3.0"
},
"require-dev": {
"codeigniter/coding-standard": "^1.7",
"fakerphp/faker": "^1.9",
"friendsofphp/php-cs-fixer": "^3.47.1",
"kint-php/kint": "^5.0.4",
"mikey179/vfsstream": "^1.6",
"nexusphp/cs-config": "^3.6",
"phpunit/phpunit": "^10.5.16",
"predis/predis": "^1.1 || ^2.0"
},
"suggest": {
"ext-curl": "If you use CURLRequest class",
"ext-dom": "If you use TestResponse",
"ext-exif": "If you run Image class tests",
"ext-fileinfo": "Improves mime type detection for files",
"ext-gd": "If you use Image class GDHandler",
"ext-imagick": "If you use Image class ImageMagickHandler",
"ext-libxml": "If you use TestResponse",
"ext-memcache": "If you use Cache class MemcachedHandler with Memcache",
"ext-memcached": "If you use Cache class MemcachedHandler with Memcached",
"ext-mysqli": "If you use MySQL",
"ext-oci8": "If you use Oracle Database",
"ext-pgsql": "If you use PostgreSQL",
"ext-readline": "Improves CLI::input() usability",
"ext-redis": "If you use Cache class RedisHandler",
"ext-simplexml": "If you format XML",
"ext-sodium": "If you use Encryption SodiumHandler",
"ext-sqlite3": "If you use SQLite3",
"ext-sqlsrv": "If you use SQL Server",
"ext-xdebug": "If you use CIUnitTestCase::assertHeaderEmitted()"
},
"autoload": {
"psr-4": {
"CodeIgniter\\": "system/"
},
"exclude-from-classmap": [
"**/Database/Migrations/**"
]
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"scripts": {
"test": "phpunit"
}
}
+101
View File
@@ -0,0 +1,101 @@
"use strict";
/* ====== Define JS Constants ====== */
const sidebarToggler = document.getElementById('docs-sidebar-toggler');
const sidebar = document.getElementById('docs-sidebar');
const sidebarLinks = document.querySelectorAll('#docs-sidebar .scrollto');
/* ===== Responsive Sidebar ====== */
window.onload=function()
{
responsiveSidebar();
};
window.onresize=function()
{
responsiveSidebar();
};
function responsiveSidebar() {
let w = window.innerWidth;
if(w >= 1200) {
// if larger
sidebar.classList.remove('sidebar-hidden');
sidebar.classList.add('sidebar-visible');
} else {
// if smaller
sidebar.classList.remove('sidebar-visible');
sidebar.classList.add('sidebar-hidden');
}
};
sidebarToggler.addEventListener('click', () => {
if (sidebar.classList.contains('sidebar-visible')) {
sidebar.classList.remove('sidebar-visible');
sidebar.classList.add('sidebar-hidden');
} else {
sidebar.classList.remove('sidebar-hidden');
sidebar.classList.add('sidebar-visible');
}
});
/* ===== Smooth scrolling ====== */
/* Note: You need to include smoothscroll.min.js (smooth scroll behavior polyfill) on the page to cover some browsers */
/* Ref: https://github.com/iamdustan/smoothscroll */
sidebarLinks.forEach((sidebarLink) => {
sidebarLink.addEventListener('click', (e) => {
e.preventDefault();
var target = sidebarLink.getAttribute("href").replace('#', '');
//console.log(target);
document.getElementById(target).scrollIntoView({ behavior: 'smooth' });
//Collapse sidebar after clicking
if (sidebar.classList.contains('sidebar-visible') && window.innerWidth < 1200){
sidebar.classList.remove('sidebar-visible');
sidebar.classList.add('sidebar-hidden');
}
});
});
/* ===== Gumshoe SrollSpy ===== */
/* Ref: https://github.com/cferdinandi/gumshoe */
// Initialize Gumshoe
var spy = new Gumshoe('#docs-nav a', {
offset: 69, //sticky header height
});
/* ====== SimpleLightbox Plugin ======= */
/* Ref: https://github.com/andreknieriem/simplelightbox */
var lightbox = new SimpleLightbox('.simplelightbox-gallery a', {/* options */});
hljs.initHighlighting();
+431
View File
@@ -0,0 +1,431 @@
(function ($) {
"use strict";
var $window = $(window);
var $body = $('body');
/* Preloader Effect */
$window.on('load', function(){
$(".preloader").fadeOut(600);
});
/* Sticky Header */
if($('.active-sticky-header').length){
$window.on('resize', function(){
setHeaderHeight();
});
function setHeaderHeight(){
$("header.active-sticky-header").css("height", $('header.active-sticky-header .header-sticky').outerHeight());
}
$window.on("scroll", function() {
var fromTop = $(window).scrollTop();
setHeaderHeight();
var headerHeight = $('header.active-sticky-header .header-sticky').outerHeight()
$("header.active-sticky-header .header-sticky").toggleClass("hide", (fromTop > headerHeight + 100));
$("header.active-sticky-header .header-sticky").toggleClass("active", (fromTop > 600));
});
}
/* Slick Menu JS */
$('#menu').slicknav({
label : '',
prependTo : '.responsive-menu'
});
if($("a[href='#top']").length){
$(document).on("click", "a[href='#top']", function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
}
/* testimonial Slider JS */
if ($('.testimonial-slider').length) {
const testimonial_slider = new Swiper('.testimonial-slider .swiper', {
slidesPerView : 1,
speed: 1000,
spaceBetween: 30,
loop: true,
autoplay: {
delay: 5000,
},
pagination: {
el: '.testimonial-pagination',
clickable: true,
},
breakpoints: {
768:{
slidesPerView: 2,
},
991:{
slidesPerView: 2,
}
}
});
}
if ($('.testimonial-slider-silver').length) {
const testimonial_slider_silver = new Swiper('.testimonial-slider-silver .swiper', {
slidesPerView : 1,
speed: 1000,
spaceBetween: 30,
loop: true,
autoplay: {
delay: 5000,
},
pagination: {
el: '.testimonial-pagination',
clickable: true,
},
navigation: {
nextEl: '.testimonial-button-next-silver',
prevEl: '.testimonial-button-prev-silver',
},
breakpoints: {
768:{
slidesPerView: 1,
},
991:{
slidesPerView: 1,
}
}
});
}
/* Skill Bar */
if ($('.skills-progress-bar').length) {
$('.skills-progress-bar').waypoint(function() {
$('.skillbar').each(function() {
$(this).find('.count-bar').animate({
width:$(this).attr('data-percent')
},2000);
});
},{
offset: '70%'
});
}
/* Youtube Background Video JS */
if ($('#herovideo').length) {
var myPlayer = $("#herovideo").YTPlayer();
}
/* Init Counter */
if ($('.counter').length) {
$('.counter').counterUp({ delay: 6, time: 3000 });
}
/* Image Reveal Animation */
if ($('.reveal').length) {
gsap.registerPlugin(ScrollTrigger);
let revealContainers = document.querySelectorAll(".reveal");
revealContainers.forEach((container) => {
let image = container.querySelector("img");
let tl = gsap.timeline({
scrollTrigger: {
trigger: container,
toggleActions: "play none none none"
}
});
tl.set(container, {
autoAlpha: 1
});
tl.from(container, 1, {
xPercent: -100,
ease: Power2.out
});
tl.from(image, 1, {
xPercent: 100,
scale: 1,
delay: -1,
ease: Power2.out
});
});
}
/* Text Effect Animation */
function initHeadingAnimation() {
if($('.text-effect').length) {
var textheading = $(".text-effect");
if(textheading.length === 0) return; gsap.registerPlugin(SplitText); textheading.each(function(index, el) {
el.split = new SplitText(el, {
type: "lines,words,chars",
linesClass: "split-line"
});
if( $(el).hasClass('text-effect') ){
gsap.set(el.split.chars, {
opacity: .3,
x: "-7",
});
}
el.anim = gsap.to(el.split.chars, {
scrollTrigger: {
trigger: el,
start: "top 92%",
end: "top 60%",
markers: false,
scrub: 1,
},
x: "0",
y: "0",
opacity: 1,
duration: .7,
stagger: 0.2,
});
});
}
if ($('.text-anime-style-1').length) {
let staggerAmount = 0.05,
translateXValue = 0,
delayValue = 0.5,
animatedTextElements = document.querySelectorAll('.text-anime-style-1');
animatedTextElements.forEach((element) => {
let animationSplitText = new SplitText(element, { type: "chars, words" });
gsap.from(animationSplitText.words, {
duration: 1,
delay: delayValue,
x: 20,
autoAlpha: 0,
stagger: staggerAmount,
scrollTrigger: { trigger: element, start: "top 85%" },
});
});
}
if ($('.text-anime-style-2').length) {
let staggerAmount = 0.03,
translateXValue = 20,
delayValue = 0.1,
easeType = "power2.out",
animatedTextElements = document.querySelectorAll('.text-anime-style-2');
animatedTextElements.forEach((element) => {
let animationSplitText = new SplitText(element, { type: "chars, words" });
gsap.from(animationSplitText.chars, {
duration: 1,
delay: delayValue,
x: translateXValue,
autoAlpha: 0,
stagger: staggerAmount,
ease: easeType,
scrollTrigger: { trigger: element, start: "top 85%"},
});
});
}
if ($('.text-anime-style-3').length) {
let animatedTextElements = document.querySelectorAll('.text-anime-style-3');
animatedTextElements.forEach((element) => {
//Reset if needed
if (element.animation) {
element.animation.progress(1).kill();
element.split.revert();
}
element.split = new SplitText(element, {
type: "lines,words,chars",
linesClass: "split-line",
});
gsap.set(element, { perspective: 400 });
gsap.set(element.split.chars, {
opacity: 0,
x: "50",
});
element.animation = gsap.to(element.split.chars, {
scrollTrigger: { trigger: element, start: "top 90%" },
x: "0",
y: "0",
rotateX: "0",
opacity: 1,
duration: 1,
ease: Back.easeOut,
stagger: 0.02,
});
});
}
}
if (document.fonts && document.fonts.ready) {
document.fonts.ready.then(() => {
initHeadingAnimation();
});
} else {
window.addEventListener("load", initHeadingAnimation);
}
/* Parallaxie js */
var $parallaxie = $('.parallaxie');
if($parallaxie.length && ($window.width() > 1024))
{
if ($window.width() > 768) {
$parallaxie.parallaxie({
speed: 0.55,
offset: 0,
});
}
}
/* Zoom Gallery screenshot */
$('.gallery-items').magnificPopup({
delegate: 'a',
type: 'image',
closeOnContentClick: false,
closeBtnInside: false,
mainClass: 'mfp-with-zoom',
image: {
verticalFit: true,
},
gallery: {
enabled: true
},
zoom: {
enabled: true,
duration: 300, // don't foget to change the duration also in CSS
opener: function(element) {
return element.find('img');
}
}
});
/* Contact form validation */
var $contactform = $("#contactForm");
$contactform.validator({focus: false}).on("submit", function (event) {
if (!event.isDefaultPrevented()) {
event.preventDefault();
submitForm();
}
});
function submitForm(){
/* Ajax call to submit form */
$.ajax({
type: "POST",
url: "form-process.php",
data: $contactform.serialize(),
success : function(text){
if (text === "success"){
formSuccess();
} else {
submitMSG(false,text);
}
}
});
}
function formSuccess(){
$contactform[0].reset();
submitMSG(true, "Message Sent Successfully!")
}
function submitMSG(valid, msg){
if(valid){
var msgClasses = "h4 text-success";
} else {
var msgClasses = "h4 text-danger";
}
$("#msgSubmit").removeClass().addClass(msgClasses).text(msg);
}
/* Contact form validation end */
/* Animated Wow Js */
new WOW().init();
/* Popup Video */
if ($('.popup-video').length) {
$('.popup-video').magnificPopup({
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: true
});
}
/* Projects Item (filtering) Start */
$window.on( "load", function(){
if( $(".project-item-list").length ) {
/* Init Isotope */
var $menuitem = $(".project-item-list").isotope({
itemSelector: ".project-item-box",
layoutMode: "masonry",
masonry: {
// use outer width of grid-sizer for columnWidth
columnWidth: 1,
}
});
/* Filter items on click */
var $menudisesnav = $(".project-nav li a");
$menudisesnav.on('click', function (e) {
var filterValue = $(this).attr('data-filter');
$menuitem.isotope({
filter: filterValue
});
$menudisesnav.removeClass("active-btn");
$(this).addClass("active-btn");
e.preventDefault();
});
$menuitem.isotope({ filter: ".first" });
}
});
/* Projects Item (filtering) End */
/* Service Item List Start */
var $services_item_list = $('.services-item-list');
if ($services_item_list.length) {
var $service_item = $services_item_list.find('.service-item');
if ($service_item.length) {
$service_item.on({
mouseenter: function () {
if (!$(this).hasClass('active')) {
$service_item.removeClass('active');
$(this).addClass('active');
}
},
mouseleave: function () {
// Optional: Add logic for mouse leave if needed
}
});
}
}
/* Service Item List End */
/* Service Item List gold Start */
var $services_item_list_gold = $('.services-item-list-gold');
if ($services_item_list_gold.length) {
var $service_item_gold = $services_item_list_gold.find('.service-item-gold');
if ($service_item_gold.length) {
$service_item_gold.on({
mouseenter: function () {
if (!$(this).hasClass('active')) {
$service_item_gold.removeClass('active');
$(this).addClass('active');
}
},
mouseleave: function () {
// Optional: Add logic for mouse leave if needed
}
});
}
}
/* Service Item List gold End */
})(jQuery);
+11
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+12
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
View File
@@ -0,0 +1,8 @@
/*!
* jquery.counterup.js 1.0
*
* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal
* Released under the GPL v2 License
*
* Date: Nov 26, 2013
*/!function(t){"use strict";t.fn.counterUp=function(e){var n=t.extend({time:400,delay:10},e);return this.each(function(){var e=t(this),u=n;e.waypoint({handler:function(){!function(){var t=[],n=u.time/u.delay,a=e.text(),r=/[0-9]+,[0-9]+/.test(a);a=a.replace(/,/g,"");/^[0-9]+$/.test(a);for(var o=/^[0-9]+\.[0-9]+$/.test(a),c=o?(a.split(".")[1]||[]).length:0,s=n;s>=1;s--){var i=parseInt(a/n*s);if(o&&(i=parseFloat(a/n*s).toFixed(c)),r)for(;/(\d+)(\d{3})/.test(i.toString());)i=i.toString().replace(/(\d+)(\d{3})/,"$1,$2");t.unshift(i)}e.data("counterup-nums",t),e.text("0");e.data("counterup-func",function(){e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?setTimeout(e.data("counterup-func"),u.delay):(e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null))}),setTimeout(e.data("counterup-func"),u.delay)}(),this.destroy()},offset:"100%"})})}}(jQuery);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+590
View File
@@ -0,0 +1,590 @@
/*!
* SlickNav Responsive Mobile Menu v1.0.10
* (c) 2016 Josh Cope
* licensed under MIT
*/
;(function ($, document, window) {
var
// default settings object.
defaults = {
label: 'MENU',
duplicate: true,
duration: 200,
easingOpen: 'swing',
easingClose: 'swing',
closedSymbol: '&#9658;',
openedSymbol: '&#9660;',
prependTo: 'body',
appendTo: '',
parentTag: 'a',
closeOnClick: false,
allowParentLinks: false,
nestedParentLinks: true,
showChildren: false,
removeIds: true,
removeClasses: false,
removeStyles: false,
brand: '',
animations: 'jquery',
init: function () {},
beforeOpen: function () {},
beforeClose: function () {},
afterOpen: function () {},
afterClose: function () {}
},
mobileMenu = 'slicknav',
prefix = 'slicknav';
Keyboard = {
DOWN: 40,
ENTER: 13,
ESCAPE: 27,
LEFT: 37,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38,
};
function Plugin(element, options) {
this.element = element;
// jQuery has an extend method which merges the contents of two or
// more objects, storing the result in the first object. The first object
// is generally empty as we don't want to alter the default options for
// future instances of the plugin
this.settings = $.extend({}, defaults, options);
// Don't remove IDs by default if duplicate is false
if (!this.settings.duplicate && !options.hasOwnProperty("removeIds")) {
this.settings.removeIds = false;
}
this._defaults = defaults;
this._name = mobileMenu;
this.init();
}
Plugin.prototype.init = function () {
var $this = this,
menu = $(this.element),
settings = this.settings,
iconClass,
menuBar;
// clone menu if needed
if (settings.duplicate) {
$this.mobileNav = menu.clone();
} else {
$this.mobileNav = menu;
}
// remove IDs if set
if (settings.removeIds) {
$this.mobileNav.removeAttr('id');
$this.mobileNav.find('*').each(function (i, e) {
$(e).removeAttr('id');
});
}
// remove classes if set
if (settings.removeClasses) {
$this.mobileNav.removeAttr('class');
$this.mobileNav.find('*').each(function (i, e) {
$(e).removeAttr('class');
});
}
// remove styles if set
if (settings.removeStyles) {
$this.mobileNav.removeAttr('style');
$this.mobileNav.find('*').each(function (i, e) {
$(e).removeAttr('style');
});
}
// styling class for the button
iconClass = prefix + '_icon';
if (settings.label === '') {
iconClass += ' ' + prefix + '_no-text';
}
if (settings.parentTag === 'a') {
settings.parentTag = 'a href="#"';
}
// create menu bar
$this.mobileNav.attr('class', prefix + '_nav');
menuBar = $('<div class="' + prefix + '_menu"></div>');
if (settings.brand !== '') {
var brand = $('<div class="' + prefix + '_brand">'+settings.brand+'</div>');
$(menuBar).append(brand);
}
$this.btn = $(
['<' + settings.parentTag + ' aria-haspopup="true" role="button" tabindex="0" class="' + prefix + '_btn ' + prefix + '_collapsed">',
'<span class="' + prefix + '_menutxt">' + settings.label + '</span>',
'<span class="' + iconClass + '">',
'<span class="' + prefix + '_icon-bar"></span>',
'<span class="' + prefix + '_icon-bar"></span>',
'<span class="' + prefix + '_icon-bar"></span>',
'</span>',
'</' + settings.parentTag + '>'
].join('')
);
$('.navbar-toggle').append($this.btn);
if(settings.appendTo !== '') {
$(settings.appendTo).append(menuBar);
} else {
$(settings.prependTo).prepend(menuBar);
}
menuBar.append($this.mobileNav);
// iterate over structure adding additional structure
var items = $this.mobileNav.find('li');
$(items).each(function () {
var item = $(this),
data = {};
data.children = item.children('ul').attr('role', 'menu');
item.data('menu', data);
// if a list item has a nested menu
if (data.children.length > 0) {
// select all text before the child menu
// check for anchors
var a = item.contents(),
containsAnchor = false,
nodes = [];
$(a).each(function () {
if (!$(this).is('ul')) {
nodes.push(this);
} else {
return false;
}
if($(this).is("a")) {
containsAnchor = true;
}
});
var wrapElement = $(
'<' + settings.parentTag + ' role="menuitem" aria-haspopup="true" tabindex="-1" class="' + prefix + '_item"/>'
);
// wrap item text with tag and add classes unless we are separating parent links
if ((!settings.allowParentLinks || settings.nestedParentLinks) || !containsAnchor) {
var $wrap = $(nodes).wrapAll(wrapElement).parent();
$wrap.addClass(prefix+'_row');
} else
$(nodes).wrapAll('<span class="'+prefix+'_parent-link '+prefix+'_row"/>').parent();
if (!settings.showChildren) {
item.addClass(prefix+'_collapsed');
} else {
item.addClass(prefix+'_open');
}
item.addClass(prefix+'_parent');
// create parent arrow. wrap with link if parent links and separating
var arrowElement = $('<span class="'+prefix+'_arrow">'+(settings.showChildren?settings.openedSymbol:settings.closedSymbol)+'</span>');
if (settings.allowParentLinks && !settings.nestedParentLinks && containsAnchor)
arrowElement = arrowElement.wrap(wrapElement).parent();
//append arrow
$(nodes).last().after(arrowElement);
} else if ( item.children().length === 0) {
item.addClass(prefix+'_txtnode');
}
// accessibility for links
item.children('a').attr('role', 'menuitem').on("click", function(event){
//Ensure that it's not a parent
if (settings.closeOnClick && !$(event.target).parent().closest('li').hasClass(prefix+'_parent')) {
//Emulate menu close if set
$($this.btn).trigger('click');
}
});
//also close on click if parent links are set
if (settings.closeOnClick && settings.allowParentLinks) {
item.children('a').children('a').on("click", function(event){
//Emulate menu close
$($this.btn).trigger('click');
});
item.find('.'+prefix+'_parent-link a:not(.'+prefix+'_item)').on("click", function(event){
//Emulate menu close
$($this.btn).trigger('click');
});
}
});
// structure is in place, now hide appropriate items
$(items).each(function () {
var data = $(this).data('menu');
if (!settings.showChildren){
$this._visibilityToggle(data.children, null, false, null, true);
}
});
// finally toggle entire menu
$this._visibilityToggle($this.mobileNav, null, false, 'init', true);
// accessibility for menu button
$this.mobileNav.attr('role','menu');
// outline prevention when using mouse
$(document).on( "mousedown", function() {
$this._outlines(false);
});
$(document).on( "keyup", function() {
$this._outlines(true);
});
// menu button click
$($this.btn).on("click", function(e){
e.preventDefault();
$this._menuToggle();
});
// click on menu parent
$this.mobileNav.on('click', '.' + prefix + '_item', function (e) {
e.preventDefault();
$this._itemClick($(this));
});
// check for keyboard events on menu button and menu parents
$($this.btn).on("keydown", function(e){
var ev = e || event;
switch(ev.keyCode) {
case Keyboard.ENTER:
case Keyboard.SPACE:
case Keyboard.DOWN:
e.preventDefault();
if (ev.keyCode !== Keyboard.DOWN || !$($this.btn).hasClass(prefix+'_open')){
$this._menuToggle();
}
$($this.btn).next().find('[role="menuitem"]').first().trigger( "focus" );
break;
}
});
$this.mobileNav.on('keydown', '.'+prefix+'_item', function(e) {
var ev = e || event;
switch(ev.keyCode) {
case Keyboard.ENTER:
e.preventDefault();
$this._itemClick($(e.target));
break;
case Keyboard.RIGHT:
e.preventDefault();
if ($(e.target).parent().hasClass(prefix+'_collapsed')) {
$this._itemClick($(e.target));
}
$(e.target).next().find('[role="menuitem"]').first().trigger( "focus" );
break;
}
});
$this.mobileNav.on('keydown', '[role="menuitem"]', function(e) {
var ev = e || event;
switch(ev.keyCode){
case Keyboard.DOWN:
e.preventDefault();
var allItems = $(e.target).parent().parent().children().children('[role="menuitem"]:visible');
var idx = allItems.index( e.target );
var nextIdx = idx + 1;
if (allItems.length <= nextIdx) {
nextIdx = 0;
}
var next = allItems.eq( nextIdx );
next.trigger( "focus" );
break;
case Keyboard.UP:
e.preventDefault();
var allItems = $(e.target).parent().parent().children().children('[role="menuitem"]:visible');
var idx = allItems.index( e.target );
var next = allItems.eq( idx - 1 );
next.trigger( "focus" );
break;
case Keyboard.LEFT:
e.preventDefault();
if ($(e.target).parent().parent().parent().hasClass(prefix+'_open')) {
var parent = $(e.target).parent().parent().prev();
parent.trigger( "focus" );
$this._itemClick(parent);
} else if ($(e.target).parent().parent().hasClass(prefix+'_nav')){
$this._menuToggle();
$($this.btn).trigger( "focus" );
}
break;
case Keyboard.ESCAPE:
e.preventDefault();
$this._menuToggle();
$($this.btn).trigger( "focus" );
break;
}
});
// allow links clickable within parent tags if set
if (settings.allowParentLinks && settings.nestedParentLinks) {
$('.'+prefix+'_item a').on("click", function(e){
e.stopImmediatePropagation();
});
}
};
//toggle menu
Plugin.prototype._menuToggle = function (el) {
var $this = this;
var btn = $this.btn;
var mobileNav = $this.mobileNav;
if (btn.hasClass(prefix+'_collapsed')) {
btn.removeClass(prefix+'_collapsed');
btn.addClass(prefix+'_open');
} else {
btn.removeClass(prefix+'_open');
btn.addClass(prefix+'_collapsed');
}
btn.addClass(prefix+'_animating');
$this._visibilityToggle(mobileNav, btn.parent(), true, btn);
};
// toggle clicked items
Plugin.prototype._itemClick = function (el) {
var $this = this;
var settings = $this.settings;
var data = el.data('menu');
if (!data) {
data = {};
data.arrow = el.children('.'+prefix+'_arrow');
data.ul = el.next('ul');
data.parent = el.parent();
//Separated parent link structure
if (data.parent.hasClass(prefix+'_parent-link')) {
data.parent = el.parent().parent();
data.ul = el.parent().next('ul');
}
el.data('menu', data);
}
if (data.parent.hasClass(prefix+'_collapsed')) {
data.arrow.html(settings.openedSymbol);
data.parent.removeClass(prefix+'_collapsed');
data.parent.addClass(prefix+'_open');
data.parent.addClass(prefix+'_animating');
$this._visibilityToggle(data.ul, data.parent, true, el);
} else {
data.arrow.html(settings.closedSymbol);
data.parent.addClass(prefix+'_collapsed');
data.parent.removeClass(prefix+'_open');
data.parent.addClass(prefix+'_animating');
$this._visibilityToggle(data.ul, data.parent, true, el);
}
};
// toggle actual visibility and accessibility tags
Plugin.prototype._visibilityToggle = function(el, parent, animate, trigger, init) {
var $this = this;
var settings = $this.settings;
var items = $this._getActionItems(el);
var duration = 0;
if (animate) {
duration = settings.duration;
}
function afterOpen(trigger, parent) {
$(trigger).removeClass(prefix+'_animating');
$(parent).removeClass(prefix+'_animating');
//Fire afterOpen callback
if (!init) {
settings.afterOpen(trigger);
}
}
function afterClose(trigger, parent) {
el.attr('aria-hidden','true');
items.attr('tabindex', '-1');
$this._setVisAttr(el, true);
el.hide(); //jQuery 1.7 bug fix
$(trigger).removeClass(prefix+'_animating');
$(parent).removeClass(prefix+'_animating');
//Fire init or afterClose callback
if (!init){
settings.afterClose(trigger);
} else if (trigger === 'init'){
settings.init();
}
}
if (el.hasClass(prefix+'_hidden')) {
el.removeClass(prefix+'_hidden');
//Fire beforeOpen callback
if (!init) {
settings.beforeOpen(trigger);
}
if (settings.animations === 'jquery') {
el.stop(true,true).slideDown(duration, settings.easingOpen, function(){
afterOpen(trigger, parent);
});
} else if(settings.animations === 'velocity') {
el.velocity("finish").velocity("slideDown", {
duration: duration,
easing: settings.easingOpen,
complete: function() {
afterOpen(trigger, parent);
}
});
}
el.attr('aria-hidden','false');
items.attr('tabindex', '0');
$this._setVisAttr(el, false);
} else {
el.addClass(prefix+'_hidden');
//Fire init or beforeClose callback
if (!init){
settings.beforeClose(trigger);
}
if (settings.animations === 'jquery') {
el.stop(true,true).slideUp(duration, this.settings.easingClose, function() {
afterClose(trigger, parent)
});
} else if (settings.animations === 'velocity') {
el.velocity("finish").velocity("slideUp", {
duration: duration,
easing: settings.easingClose,
complete: function() {
afterClose(trigger, parent);
}
});
}
}
};
// set attributes of element and children based on visibility
Plugin.prototype._setVisAttr = function(el, hidden) {
var $this = this;
// select all parents that aren't hidden
var nonHidden = el.children('li').children('ul').not('.'+prefix+'_hidden');
// iterate over all items setting appropriate tags
if (!hidden) {
nonHidden.each(function(){
var ul = $(this);
ul.attr('aria-hidden','false');
var items = $this._getActionItems(ul);
items.attr('tabindex', '0');
$this._setVisAttr(ul, hidden);
});
} else {
nonHidden.each(function(){
var ul = $(this);
ul.attr('aria-hidden','true');
var items = $this._getActionItems(ul);
items.attr('tabindex', '-1');
$this._setVisAttr(ul, hidden);
});
}
};
// get all 1st level items that are clickable
Plugin.prototype._getActionItems = function(el) {
var data = el.data("menu");
if (!data) {
data = {};
var items = el.children('li');
var anchors = items.find('a');
data.links = anchors.add(items.find('.'+prefix+'_item'));
el.data('menu', data);
}
return data.links;
};
Plugin.prototype._outlines = function(state) {
if (!state) {
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','none');
} else {
$('.'+prefix+'_item, .'+prefix+'_btn').css('outline','');
}
};
Plugin.prototype.toggle = function(){
var $this = this;
$this._menuToggle();
};
Plugin.prototype.open = function(){
var $this = this;
if ($this.btn.hasClass(prefix+'_collapsed')) {
$this._menuToggle();
}
};
Plugin.prototype.close = function(){
var $this = this;
if ($this.btn.hasClass(prefix+'_open')) {
$this._menuToggle();
}
};
$.fn[mobileMenu] = function ( options ) {
var args = arguments;
// Is the first parameter an object (options), or was omitted, instantiate a new instance
if (options === undefined || typeof options === 'object') {
return this.each(function () {
// Only allow the plugin to be instantiated once due to methods
if (!$.data(this, 'plugin_' + mobileMenu)) {
// if it has no instance, create a new one, pass options to our plugin constructor,
// and store the plugin instance in the elements jQuery data object.
$.data(this, 'plugin_' + mobileMenu, new Plugin( this, options ));
}
});
// If is a string and doesn't start with an underscore or 'init' function, treat this as a call to a public method.
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
// Cache the method call to make it possible to return a value
var returns;
this.each(function () {
var instance = $.data(this, 'plugin_' + mobileMenu);
// Tests that there's already a plugin-instance and checks that the requested public method exists
if (instance instanceof Plugin && typeof instance[options] === 'function') {
// Call the method of our plugin instance, and pass it the supplied arguments.
returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
}
});
// If the earlier cached method gives a value back return the value, otherwise return this to preserve chainability.
return returns !== undefined ? returns : this;
}
};
}(jQuery, document, window));
File diff suppressed because one or more lines are too long
+127
View File
@@ -0,0 +1,127 @@
class Cursor {
constructor(options) {
this.options = $.extend(true, {
container: "body",
speed: 0.7,
ease: "expo.out",
visibleTimeout: 300
}, options);
this.body = $(this.options.container);
this.el = $('<div class="cb-cursor"></div>');
this.text = $('<div class="cb-cursor-text"></div>');
this.init();
}
init() {
this.el.append(this.text);
this.body.append(this.el);
this.bind();
this.move(-window.innerWidth, -window.innerHeight, 0);
}
bind() {
const self = this;
this.body.on('mouseleave', () => {
self.hide();
}).on('mouseenter', () => {
self.show();
}).on('mousemove', (e) => {
this.pos = {
x: this.stick ? this.stick.x - ((this.stick.x - e.clientX) * 0.15) : e.clientX,
y: this.stick ? this.stick.y - ((this.stick.y - e.clientY) * 0.15) : e.clientY
};
this.update();
}).on('mousedown', () => {
self.setState('-active');
}).on('mouseup', () => {
self.removeState('-active');
}).on('mouseenter', 'a,input,textarea,button', () => {
self.setState('-pointer');
}).on('mouseleave', 'a,input,textarea,button', () => {
self.removeState('-pointer');
}).on('mouseenter', 'iframe', () => {
self.hide();
}).on('mouseleave', 'iframe', () => {
self.show();
}).on('mouseenter', '[data-cursor]', function () {
self.setState(this.dataset.cursor);
}).on('mouseleave', '[data-cursor]', function () {
self.removeState(this.dataset.cursor);
}).on('mouseenter', '[data-cursor-text]', function () {
self.setText(this.dataset.cursorText);
}).on('mouseleave', '[data-cursor-text]', function () {
self.removeText();
}).on('mouseenter', '[data-cursor-stick]', function () {
self.setStick(this.dataset.cursorStick);
}).on('mouseleave', '[data-cursor-stick]', function () {
self.removeStick();
});
}
setState(state) {
this.el.addClass(state);
}
removeState(state) {
this.el.removeClass(state);
}
toggleState(state) {
this.el.toggleClass(state);
}
setText(text) {
this.text.html(text);
this.el.addClass('-text');
}
removeText() {
this.el.removeClass('-text');
}
setStick(el) {
const target = $(el);
const bound = target.get(0).getBoundingClientRect();
this.stick = {
y: bound.top + (target.height() / 2),
x: bound.left + (target.width() / 2)
};
this.move(this.stick.x, this.stick.y, 5);
}
removeStick() {
this.stick = false;
}
update() {
this.move();
this.show();
}
move(x, y, duration) {
gsap.to(this.el, {
x: x || this.pos.x,
y: y || this.pos.y,
force3D: true,
overwrite: true,
ease: this.options.ease,
duration: this.visible ? (duration || this.options.speed) : 0
});
}
show() {
if (this.visible) return;
clearInterval(this.visibleInt);
this.el.addClass('-visible');
this.visibleInt = setTimeout(() => this.visible = true);
}
hide() {
clearInterval(this.visibleInt);
this.el.removeClass('-visible');
this.visibleInt = setTimeout(() => this.visible = false, this.options.visibleTimeout);
}
}
// Init cursor
const cursor = new Cursor();
+55
View File
@@ -0,0 +1,55 @@
/*! Copyright (c) 2016 THE ULTRASOFT (http://theultrasoft.com)
* Licensed under the MIT License (LICENSE.txt).
*
* Project: Parallaxie
* Version: 0.5
*
* Requires: jQuery 1.9+
*/
(function( $ ){
"use strict";
$.fn.parallaxie = function( options ){
var options = $.extend({
speed: 0.2,
repeat: 'no-repeat',
size: 'cover',
pos_x: 'center',
offset: 0,
}, options );
this.each(function(){
var $el = $(this);
var local_options = $el.data('parallaxie');
if( typeof local_options !== 'object' ) local_options = {};
local_options = $.extend( {}, options, local_options );
var image_url = $el.data('image');
if( typeof image_url === 'undefined' ){
image_url = $el.css('background-image');
if( !image_url ) return;
// APPLY DEFAULT CSS
var pos_y = local_options.offset + ($el.offset().top - $(window).scrollTop()) * (1 - local_options.speed );
$el.css({
'background-image': image_url,
'background-size': local_options.size,
'background-repeat': local_options.repeat,
'background-attachment': 'fixed',
'background-position': local_options.pos_x + ' ' + pos_y + 'px',
});
$(window).scroll( function(){
//var pos_y = - ( $(window).scrollTop() - $el.offset().top ) * ( 1 + local_options.speed ) - ( $el.offset().top * local_options.speed );
var pos_y = local_options.offset + ($el.offset().top - $(window).scrollTop()) * (1 - local_options.speed );
$el.data( 'pos_y', pos_y );
$el.css( 'background-position', local_options.pos_x + ' ' + pos_y + 'px' );
}
);
}
});
return this;
};
}( jQuery ));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
View File
File diff suppressed because one or more lines are too long