Copy all assets from template

This commit is contained in:
Francesco Lorenzo D'Amico
2026-08-14 16:12:39 +02:00
parent f2a1efc807
commit 9ac80de5da
259 changed files with 33657 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
window.addEventListener("DOMContentLoaded", function () {
// get the form elements defined in your form HTML above
var form = document.getElementById("dreamit-form");
// var button = document.getElementById("my-form-button");
var status = document.getElementById("status");
// Success and Error functions for after the form is submitted
function success() {
form.reset();
status.classList.add("success");
status.innerHTML = "Thank you message sent.!";
}
function error() {
status.classList.add("error");
status.innerHTML = "Oops! There was a problem.";
}
});
// helper function for sending an AJAX request
function ajax(method, url, data, success, error) {
var xhr = new XMLHttpRequest();
xhr.open(method, url);
xhr.setRequestHeader("Accept", "application/json");
xhr.onreadystatechange = function () {
if (xhr.readyState !== XMLHttpRequest.DONE) return;
if (xhr.status === 200) {
success(xhr.response, xhr.responseType);
} else {
error(xhr.status, xhr.response, xhr.responseType);
}
};
xhr.send(data);
}
@@ -0,0 +1,14 @@
jQuery(document).ready(function($){var animationDelay=2500,barAnimationDelay=3800,barWaiting=barAnimationDelay-3000,lettersDelay=50,typeLettersDelay=150,selectionDuration=500,typeAnimationDelay=selectionDuration+800,revealDuration=600,revealAnimationDelay=1500;initHeadline();function initHeadline(){singleLetters($('.cd-headline.letters').find('b'));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')){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)};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)?!0:!1;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,!1,$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')}})
+133
View File
@@ -0,0 +1,133 @@
/* -----------------------------------------------
/* How to use? : Check the GitHub README
/* ----------------------------------------------- */
/* To load a config file (particles.json) you need to host this demo (MAMP/WAMP/local)... */
/*
particlesJS.load('particles-js', 'particles.json', function() {
console.log('particles.js loaded - callback');
});
*/
/* Otherwise just put the config content (json): */
particlesJS('particles-js',
{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#ffffff"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 5,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#ffffff",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true,
"config_demo": {
"hide_card": false,
"background_color": "#b61924",
"background_image": "",
"background_position": "50% 50%",
"background_repeat": "no-repeat",
"background_size": "cover"
}
}
);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,180 @@
/*
* File: jquery.barfiller.js
* Version: 1.0.1
* Description: A plugin that fills bars with a percentage you set.
* Author: 9bit Studios
* Copyright 2012, 9bit Studios
* http://www.9bitstudios.com
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function ($) {
$.fn.barfiller = function (options) {
var defaults = $.extend({
barColor: '#16b597',
tooltip: true,
duration: 1000,
animateOnResize: true,
symbol: "%"
}, options);
/******************************
Private Variables
*******************************/
var object = $(this);
var settings = $.extend(defaults, options);
var barWidth = object.width();
var fill = object.find('.fill');
var toolTip = object.find('.tip');
var fillPercentage = fill.attr('data-percentage');
var resizeTimeout;
var transitionSupport = false;
var transitionPrefix;
/******************************
Public Methods
*******************************/
var methods = {
init: function() {
return this.each(function () {
if(methods.getTransitionSupport()) {
transitionSupport = true;
transitionPrefix = methods.getTransitionPrefix();
}
methods.appendHTML();
methods.setEventHandlers();
methods.initializeItems();
});
},
/******************************
Append HTML
*******************************/
appendHTML: function() {
fill.css('background', settings.barColor);
if(!settings.tooltip) {
toolTip.css('display', 'none');
}
toolTip.text(fillPercentage + settings.symbol);
},
/******************************
Set Event Handlers
*******************************/
setEventHandlers: function() {
if(settings.animateOnResize) {
$(window).on("resize", function(event){
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
methods.refill();
}, 300);
});
}
},
/******************************
Initialize
*******************************/
initializeItems: function() {
var pctWidth = methods.calculateFill(fillPercentage);
object.find('.tipWrap').css({ display: 'inline' });
if(transitionSupport)
methods.transitionFill(pctWidth);
else
methods.animateFill(pctWidth);
},
getTransitionSupport: function() {
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style;
var support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
return support;
},
getTransitionPrefix: function() {
if(/mozilla/.test(navigator.userAgent.toLowerCase()) && !/webkit/.test(navigator.userAgent.toLowerCase())) {
return '-moz-transition';
}
if(/webkit/.test(navigator.userAgent.toLowerCase())) {
return '-webkit-transition';
}
if(/opera/.test(navigator.userAgent.toLowerCase())) {
return '-o-transition';
}
if (/msie/.test(navigator.userAgent.toLowerCase())) {
return '-ms-transition';
}
else {
return 'transition';
}
},
getTransition: function(val, time, type) {
var CSSObj;
if(type === 'width') {
CSSObj = { width : val };
}
else if (type === 'left') {
CSSObj = { left: val };
}
time = time/1000;
CSSObj[transitionPrefix] = type+' '+time+'s ease-in-out';
return CSSObj;
},
refill: function() {
fill.css('width', 0);
toolTip.css('left', 0);
barWidth = object.width();
methods.initializeItems();
},
calculateFill: function(percentage) {
percentage = percentage * 0.01;
var finalWidth = barWidth * percentage;
return finalWidth;
},
transitionFill: function(barWidth) {
var toolTipOffset = barWidth - toolTip.width();
fill.css( methods.getTransition(barWidth, settings.duration, 'width'));
toolTip.css( methods.getTransition(toolTipOffset, settings.duration, 'left'));
},
animateFill: function(barWidth) {
var toolTipOffset = barWidth - toolTip.width();
fill.stop().animate({width: '+=' + barWidth}, settings.duration);
toolTip.stop().animate({left: '+=' + toolTipOffset}, settings.duration);
}
};
if (methods[options]) { // $("#element").pluginName('methodName', 'arg1', 'arg2');
return methods[options].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof options === 'object' || !options) { // $("#element").pluginName({ option: 1, option:2 });
return methods.init.apply(this);
} else {
$.error( 'Method "' + method + '" does not exist in barfiller plugin!');
}
};
})(jQuery);
+1
View File
@@ -0,0 +1 @@
(function($){"use strict";$.fn.counterUp=function(options){var settings=$.extend({time:400,delay:10,offset:100,beginAt:0,formatter:false,context:"window",callback:function(){}},options),s;return this.each(function(){var $this=$(this),counter={time:$(this).data("counterup-time")||settings.time,delay:$(this).data("counterup-delay")||settings.delay,offset:$(this).data("counterup-offset")||settings.offset,beginAt:$(this).data("counterup-beginat")||settings.beginAt,context:$(this).data("counterup-context")||settings.context};var counterUpper=function(){var nums=[];var divisions=counter.time/counter.delay;var num=$(this).attr("data-num")?$(this).attr("data-num"):$this.text();var isComma=/[0-9]+,[0-9]+/.test(num);num=num.replace(/,/g,"");var decimalPlaces=(num.split(".")[1]||[]).length;if(counter.beginAt>num)counter.beginAt=num;var isTime=/[0-9]+:[0-9]+:[0-9]+/.test(num);if(isTime){var times=num.split(":"),m=1;s=0;while(times.length>0){s+=m*parseInt(times.pop(),10);m*=60}}for(var i=divisions;i>=counter.beginAt/num*divisions;i--){var newNum=parseFloat(num/divisions*i).toFixed(decimalPlaces);if(isTime){newNum=parseInt(s/divisions*i);var hours=parseInt(newNum/3600)%24;var minutes=parseInt(newNum/60)%60;var seconds=parseInt(newNum%60,10);newNum=(hours<10?"0"+hours:hours)+":"+(minutes<10?"0"+minutes:minutes)+":"+(seconds<10?"0"+seconds:seconds)}if(isComma){while(/(\d+)(\d{3})/.test(newNum.toString())){newNum=newNum.toString().replace(/(\d+)(\d{3})/,"$1"+","+"$2")}}if(settings.formatter){newNum=settings.formatter.call(this,newNum)}nums.unshift(newNum)}$this.data("counterup-nums",nums);$this.text(counter.beginAt);var f=function(){if(!$this.data("counterup-nums")){settings.callback.call(this);return}$this.html($this.data("counterup-nums").shift());if($this.data("counterup-nums").length){setTimeout($this.data("counterup-func"),counter.delay)}else{$this.data("counterup-nums",null);$this.data("counterup-func",null);settings.callback.call(this)}};$this.data("counterup-func",f);setTimeout($this.data("counterup-func"),counter.delay)};$this.waypoint(function(direction){counterUpper();this.destroy()},{offset:counter.offset+"%",context:counter.context})})}})(jQuery);
@@ -0,0 +1,289 @@
/*!
* jQuery meanMenu v2.0.8
* @Copyright (C) 2012-2014 Chris Wharton @ MeanThemes (https://github.com/meanthemes/meanMenu)
*
*/
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT
* HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR
* FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE
* OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
* COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.COPYRIGHT HOLDERS WILL NOT
* BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL
* DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://gnu.org/licenses/>.
*
* Find more information at http://www.meanthemes.com/plugins/meanmenu/
*
*/
(function ($) {
"use strict";
$.fn.meanmenu = function (options) {
var defaults = {
meanMenuTarget: jQuery(this), // Target the current HTML markup you wish to replace
meanMenuContainer: '.mobile-menu-area .container', // Choose where meanmenu will be placed within the HTML
meanMenuClose: "X", // single character you want to represent the close menu button
meanMenuCloseSize: "18px", // set font size of close button
meanMenuOpen: "<span /><span /><span />", // text/markup you want when menu is closed
meanRevealPosition: "right", // left right or center positions
meanRevealPositionDistance: "0", // Tweak the position of the menu
meanRevealColour: "", // override CSS colours for the reveal background
meanScreenWidth: "767", // set the screen width you want meanmenu to kick in at
meanNavPush: "", // set a height here in px, em or % if you want to budge your layout now the navigation is missing.
meanShowChildren: true, // true to show children in the menu, false to hide them
meanExpandableChildren: true, // true to allow expand/collapse children
meanExpand: "+", // single character you want to represent the expand for ULs
meanContract: "-", // single character you want to represent the contract for ULs
meanRemoveAttrs: false, // true to remove classes and IDs, false to keep them
onePage: false, // set to true for one page sites
meanDisplay: "block", // override display method for table cell based layouts e.g. table-cell
removeElements: "" // set to hide page elements
};
options = $.extend(defaults, options);
// get browser width
var currentWidth = window.innerWidth || document.documentElement.clientWidth;
return this.each(function () {
var meanMenu = options.meanMenuTarget;
var meanContainer = options.meanMenuContainer;
var meanMenuClose = options.meanMenuClose;
var meanMenuCloseSize = options.meanMenuCloseSize;
var meanMenuOpen = options.meanMenuOpen;
var meanRevealPosition = options.meanRevealPosition;
var meanRevealPositionDistance = options.meanRevealPositionDistance;
var meanRevealColour = options.meanRevealColour;
var meanScreenWidth = options.meanScreenWidth;
var meanNavPush = options.meanNavPush;
var meanRevealClass = ".meanmenu-reveal";
var meanShowChildren = options.meanShowChildren;
var meanExpandableChildren = options.meanExpandableChildren;
var meanExpand = options.meanExpand;
var meanContract = options.meanContract;
var meanRemoveAttrs = options.meanRemoveAttrs;
var onePage = options.onePage;
var meanDisplay = options.meanDisplay;
var removeElements = options.removeElements;
//detect known mobile/tablet usage
var isMobile = false;
if ( (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/Android/i)) || (navigator.userAgent.match(/Blackberry/i)) || (navigator.userAgent.match(/Windows Phone/i)) ) {
isMobile = true;
}
if ( (navigator.userAgent.match(/MSIE 8/i)) || (navigator.userAgent.match(/MSIE 7/i)) ) {
// add scrollbar for IE7 & 8 to stop breaking resize function on small content sites
jQuery('html').css("overflow-y" , "scroll");
}
var meanRevealPos = "";
var meanCentered = function() {
if (meanRevealPosition === "center") {
var newWidth = window.innerWidth || document.documentElement.clientWidth;
var meanCenter = ( (newWidth/2)-22 )+"px";
meanRevealPos = "left:" + meanCenter + ";right:auto;";
if (!isMobile) {
jQuery('.meanmenu-reveal').css("left",meanCenter);
} else {
jQuery('.meanmenu-reveal').animate({
left: meanCenter
});
}
}
};
var menuOn = false;
var meanMenuExist = false;
if (meanRevealPosition === "right") {
meanRevealPos = "right:" + meanRevealPositionDistance + ";left:auto;";
}
if (meanRevealPosition === "left") {
meanRevealPos = "left:" + meanRevealPositionDistance + ";right:auto;";
}
// run center function
meanCentered();
// set all styles for mean-reveal
var $navreveal = "";
var meanInner = function() {
// get last class name
if (jQuery($navreveal).is(".meanmenu-reveal.meanclose")) {
$navreveal.html(meanMenuClose);
} else {
$navreveal.html(meanMenuOpen);
}
};
// re-instate original nav (and call this on window.width functions)
var meanOriginal = function() {
jQuery('.mean-bar,.mean-push').remove();
jQuery(meanContainer).removeClass("mean-container");
jQuery(meanMenu).css('display', meanDisplay);
menuOn = false;
meanMenuExist = false;
jQuery(removeElements).removeClass('mean-remove');
};
// navigation reveal
var showMeanMenu = function() {
var meanStyles = "background:"+meanRevealColour+";color:"+meanRevealColour+";"+meanRevealPos;
if (currentWidth <= meanScreenWidth) {
jQuery(removeElements).addClass('mean-remove');
meanMenuExist = true;
// add class to body so we don't need to worry about media queries here, all CSS is wrapped in '.mean-container'
jQuery(meanContainer).addClass("mean-container");
jQuery('.mean-container').prepend('<div class="mean-bar"><a href="#nav" class="meanmenu-reveal" style="'+meanStyles+'">Show Navigation</a><nav class="mean-nav"></nav></div>');
//push meanMenu navigation into .mean-nav
var meanMenuContents = jQuery(meanMenu).html();
jQuery('.mean-nav').html(meanMenuContents);
// remove all classes from EVERYTHING inside meanmenu nav
if(meanRemoveAttrs) {
jQuery('nav.mean-nav ul, nav.mean-nav ul *').each(function() {
// First check if this has mean-remove class
if (jQuery(this).is('.mean-remove')) {
jQuery(this).attr('class', 'mean-remove');
} else {
jQuery(this).removeAttr("class");
}
jQuery(this).removeAttr("id");
});
}
// push in a holder div (this can be used if removal of nav is causing layout issues)
jQuery(meanMenu).before('<div class="mean-push" />');
jQuery('.mean-push').css("margin-top",meanNavPush);
// hide current navigation and reveal mean nav link
jQuery(meanMenu).hide();
jQuery(".meanmenu-reveal").show();
// turn 'X' on or off
jQuery(meanRevealClass).html(meanMenuOpen);
$navreveal = jQuery(meanRevealClass);
//hide mean-nav ul
jQuery('.mean-nav ul').hide();
// hide sub nav
if(meanShowChildren) {
// allow expandable sub nav(s)
if(meanExpandableChildren){
jQuery('.mean-nav ul ul').each(function() {
if(jQuery(this).children().length){
jQuery(this,'li:first').parent().append('<a class="mean-expand" href="#" style="font-size: '+ meanMenuCloseSize +'">'+ meanExpand +'</a>');
}
});
jQuery('.mean-expand').on("click",function(e){
e.preventDefault();
if (jQuery(this).hasClass("mean-clicked")) {
jQuery(this).text(meanExpand);
jQuery(this).prev('ul').slideUp(300, function(){});
} else {
jQuery(this).text(meanContract);
jQuery(this).prev('ul').slideDown(300, function(){});
}
jQuery(this).toggleClass("mean-clicked");
});
} else {
jQuery('.mean-nav ul ul').show();
}
} else {
jQuery('.mean-nav ul ul').hide();
}
// add last class to tidy up borders
jQuery('.mean-nav ul li').last().addClass('mean-last');
$navreveal.removeClass("meanclose");
jQuery($navreveal).click(function(e){
e.preventDefault();
if( menuOn === false ) {
$navreveal.css("text-align", "center");
$navreveal.css("text-indent", "0");
$navreveal.css("font-size", meanMenuCloseSize);
jQuery('.mean-nav ul:first').slideDown();
menuOn = true;
} else {
jQuery('.mean-nav ul:first').slideUp();
menuOn = false;
}
$navreveal.toggleClass("meanclose");
meanInner();
jQuery(removeElements).addClass('mean-remove');
});
// for one page websites, reset all variables...
if ( onePage ) {
jQuery('.mean-nav ul > li > a:first-child').on( "click" , function () {
jQuery('.mean-nav ul:first').slideUp();
menuOn = false;
jQuery($navreveal).toggleClass("meanclose").html(meanMenuOpen);
});
}
} else {
meanOriginal();
}
};
if (!isMobile) {
// reset menu on resize above meanScreenWidth
jQuery(window).resize(function () {
currentWidth = window.innerWidth || document.documentElement.clientWidth;
if (currentWidth > meanScreenWidth) {
meanOriginal();
} else {
meanOriginal();
}
if (currentWidth <= meanScreenWidth) {
showMeanMenu();
meanCentered();
} else {
meanOriginal();
}
});
}
jQuery(window).resize(function () {
// get browser width
currentWidth = window.innerWidth || document.documentElement.clientWidth;
if (!isMobile) {
meanOriginal();
if (currentWidth <= meanScreenWidth) {
showMeanMenu();
meanCentered();
}
} else {
meanCentered();
if (currentWidth <= meanScreenWidth) {
if (meanMenuExist === false) {
showMeanMenu();
}
} else {
meanOriginal();
}
}
});
// run main menuMenu function on load
showMeanMenu();
});
};
})(jQuery);
+19
View File
@@ -0,0 +1,19 @@
/*
* jQuery One Page Nav Plugin
* http://github.com/davist11/jQuery-One-Page-Nav
*
* Copyright (c) 2010 Trevor Davis (http://trevordavis.net)
* Dual licensed under the MIT and GPL licenses.
* Uses the same license as jQuery, see:
* http://jquery.org/license
*
* @version 3.0.0
*
* Example usage:
* $('#nav').onePageNav({
* currentClass: 'current',
* changeHmash: false,
* scrollSpeed: 750
* });
*/
!function(t,i,n,s){var e=function(s,e){this.elem=s,this.$elem=t(s),this.options=e,this.metadata=this.$elem.data("plugin-options"),this.$win=t(i),this.sections={},this.didScroll=!1,this.$doc=t(n),this.docHeight=this.$doc.height()};e.prototype={defaults:{navItems:"a",currentClass:"current",changeHmash:!1,easing:"swing",filter:"",scrollSpeed:750,scrollThreshold:.5,begin:!1,end:!1,scrollChange:!1},init:function(){return this.config=t.extend({},this.defaults,this.options,this.metadata),this.$nav=this.$elem.find(this.config.navItems),""!==this.config.filter&&(this.$nav=this.$nav.filter(this.config.filter)),this.$nav.on("click.onePageNav",t.proxy(this.handleClick,this)),this.getPositions(),this.bindInterval(),this.$win.on("resize.onePageNav",t.proxy(this.getPositions,this)),this},adjustNav:function(t,i){t.$elem.find("."+t.config.currentClass).removeClass(t.config.currentClass),i.addClass(t.config.currentClass)},bindInterval:function(){var t,i=this;i.$win.on("scroll.onePageNav",function(){i.didScroll=!0}),i.t=setInterval(function(){t=i.$doc.height(),i.didScroll&&(i.didScroll=!1,i.scrollChange()),t!==i.docHeight&&(i.docHeight=t,i.getPositions())},250)},getHmash:function(t){return t.attr("href").split("#")[1]},getPositions:function(){var i,n,s,e=this;e.$nav.each(function(){i=e.getHmash(t(this)),s=t("#"+i),s.length&&(n=s.offset().top,e.sections[i]=Math.round(n))})},getSection:function(t){var i=null,n=Math.round(this.$win.height()*this.config.scrollThreshold);for(var s in this.sections)this.sections[s]-n<t&&(i=s);return i},handleClick:function(n){var s=this,e=t(n.currentTarget),o=e.parent(),a="#"+s.getHmash(e);o.hasClass(s.config.currentClass)||(s.config.begin&&s.config.begin(),s.adjustNav(s,o),s.unbindInterval(),s.scrollTo(a,function(){s.config.changeHmash&&(i.location.hmash=a),s.bindInterval(),s.config.end&&s.config.end()})),n.preventDefault()},scrollChange:function(){var t,i=this.$win.scrollTop(),n=this.getSection(i);null!==n&&(t=this.$elem.find('a[href$="#'+n+'"]').parent(),t.hasClass(this.config.currentClass)||(this.adjustNav(this,t),this.config.scrollChange&&this.config.scrollChange(t)))},scrollTo:function(i,n){var s=t(i).offset().top;t("html, body").animate({scrollTop:s-this.config.scrollOffset},this.config.scrollSpeed,this.config.easing,n)},unbindInterval:function(){clearInterval(this.t),this.$win.unbind("scroll.onePageNav")}},e.defaults=e.prototype.defaults,t.fn.onePageNav=function(t){return this.each(function(){new e(this,t).init()})}}(jQuery,window,document);
@@ -0,0 +1,674 @@
/*
* jQuery Nivo Slider v3.2
* http://nivo.dev7studios.com
*
* Copyright 2012, Dev7studios
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function($) {
var NivoSlider = function(element, options){
// Defaults are below
var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
// Useful variables. Play carefully.
var vars = {
currentSlide: 0,
currentImage: '',
totalSlides: 0,
running: false,
paused: false,
stop: false,
controlNavEl: false
};
// Get this slider
var slider = $(element);
slider.data('nivo:vars', vars).addClass('nivoSlider');
// Find our slider children
var kids = slider.children();
kids.each(function() {
var child = $(this);
var link = '';
if(!child.is('img')){
if(child.is('a')){
child.addClass('nivo-imageLink');
link = child;
}
child = child.find('img:first');
}
// Get img width & height
var childWidth = (childWidth === 0) ? child.attr('width') : child.width(),
childHeight = (childHeight === 0) ? child.attr('height') : child.height();
if(link !== ''){
link.css('display','none');
}
child.css('display','none');
vars.totalSlides++;
});
// If randomStart
if(settings.randomStart){
settings.startSlide = Math.floor(Math.random() * vars.totalSlides);
}
// Set startSlide
if(settings.startSlide > 0){
if(settings.startSlide >= vars.totalSlides) { settings.startSlide = vars.totalSlides - 1; }
vars.currentSlide = settings.startSlide;
}
// Get initial image
if($(kids[vars.currentSlide]).is('img')){
vars.currentImage = $(kids[vars.currentSlide]);
} else {
vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
}
// Show initial link
if($(kids[vars.currentSlide]).is('a')){
$(kids[vars.currentSlide]).css('display','block');
}
// Set first background
var sliderImg = $('<img/>').addClass('nivo-main-image');
sliderImg.attr({
src : vars.currentImage.attr('src'),
alt : vars.currentImage.attr('alt')
}).show();
slider.append(sliderImg);
// Detect Window Resize
$(window).resize(function() {
slider.children('img').width(slider.width());
sliderImg.attr({
src : vars.currentImage.attr('src'),
alt : vars.currentImage.attr('alt')
});
sliderImg.stop().height('auto');
$('.nivo-slice').remove();
$('.nivo-box').remove();
});
//Create caption
slider.append($('<div class="nivo-caption"></div>'));
// Process caption function
var processCaption = function(settings){
var nivoCaption = $('.nivo-caption', slider);
if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){
var title = vars.currentImage.attr('title');
if(title.substr(0,1) == '#') title = $(title).html();
if(nivoCaption.css('display') == 'block'){
setTimeout(function(){
nivoCaption.html(title);
}, settings.animSpeed);
} else {
nivoCaption.html(title);
nivoCaption.stop().fadeIn(settings.animSpeed);
}
} else {
nivoCaption.stop().fadeOut(settings.animSpeed);
}
}
//Process initial caption
processCaption(settings);
// In the words of Super Mario "let's a go!"
var timer = 0;
if(!settings.manualAdvance && kids.length > 1){
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
}
// Add Direction nav
if(settings.directionNav){
slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+ settings.prevText +'</a><a class="nivo-nextNav">'+ settings.nextText +'</a></div>');
$(slider).on('click', 'a.nivo-prevNav', function(){
if(vars.running) { return false; }
clearInterval(timer);
timer = '';
vars.currentSlide -= 2;
nivoRun(slider, kids, settings, 'prev');
});
$(slider).on('click', 'a.nivo-nextNav', function(){
if(vars.running) { return false; }
clearInterval(timer);
timer = '';
nivoRun(slider, kids, settings, 'next');
});
}
// Add Control nav
if(settings.controlNav){
vars.controlNavEl = $('<div class="nivo-controlNav"></div>');
slider.after(vars.controlNavEl);
for(var i = 0; i < kids.length; i++){
if(settings.controlNavThumbs){
vars.controlNavEl.addClass('nivo-thumbs-enabled');
var child = kids.eq(i);
if(!child.is('img')){
child = child.find('img:first');
}
if(child.attr('data-thumb')) vars.controlNavEl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('data-thumb') +'" alt="" /></a>');
} else {
vars.controlNavEl.append('<a class="nivo-control" rel="'+ i +'">'+ (i + 1) +'</a>');
}
}
//Set initial active link
$('a:eq('+ vars.currentSlide +')', vars.controlNavEl).addClass('active');
$('a', vars.controlNavEl).bind('click', function(){
if(vars.running) return false;
if($(this).hasClass('active')) return false;
clearInterval(timer);
timer = '';
sliderImg.attr({
src : vars.currentImage.attr('src'),
alt : vars.currentImage.attr('alt')
});
vars.currentSlide = $(this).attr('rel') - 1;
nivoRun(slider, kids, settings, 'control');
});
}
//For pauseOnHover setting
if(settings.pauseOnHover){
slider.hover(function(){
vars.paused = true;
clearInterval(timer);
timer = '';
}, function(){
vars.paused = false;
// Restart the timer
if(timer === '' && !settings.manualAdvance){
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
}
});
}
// Event when Animation finishes
slider.bind('nivo:animFinished', function(){
sliderImg.attr({
src : vars.currentImage.attr('src'),
alt : vars.currentImage.attr('alt')
});
vars.running = false;
// Hide child links
$(kids).each(function(){
if($(this).is('a')){
$(this).css('display','none');
}
});
// Show current link
if($(kids[vars.currentSlide]).is('a')){
$(kids[vars.currentSlide]).css('display','block');
}
// Restart the timer
if(timer === '' && !vars.paused && !settings.manualAdvance){
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
}
// Trigger the afterChange callback
settings.afterChange.call(this);
});
// Add slices for slice animations
var createSlices = function(slider, settings, vars) {
if($(vars.currentImage).parent().is('a')) $(vars.currentImage).parent().css('display','block');
$('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').width(slider.width()).css('visibility', 'hidden').show();
var sliceHeight = ($('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').parent().is('a')) ? $('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').parent().height() : $('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').height();
for(var i = 0; i < settings.slices; i++){
var sliceWidth = Math.round(slider.width()/settings.slices);
if(i === settings.slices-1){
slider.append(
$('<div class="nivo-slice" name="'+i+'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block !important; top:0; left:-'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px;" /></div>').css({
left:(sliceWidth*i)+'px',
width:(slider.width()-(sliceWidth*i))+'px',
height:sliceHeight+'px',
opacity:'0',
overflow:'hidden'
})
);
} else {
slider.append(
$('<div class="nivo-slice" name="'+i+'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block !important; top:0; left:-'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px;" /></div>').css({
left:(sliceWidth*i)+'px',
width:sliceWidth+'px',
height:sliceHeight+'px',
opacity:'0',
overflow:'hidden'
})
);
}
}
$('.nivo-slice', slider).height(sliceHeight);
sliderImg.stop().animate({
height: $(vars.currentImage).height()
}, settings.animSpeed);
};
// Add boxes for box animations
var createBoxes = function(slider, settings, vars){
if($(vars.currentImage).parent().is('a')) $(vars.currentImage).parent().css('display','block');
$('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').width(slider.width()).css('visibility', 'hidden').show();
var boxWidth = Math.round(slider.width()/settings.boxCols),
boxHeight = Math.round($('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').height() / settings.boxRows);
for(var rows = 0; rows < settings.boxRows; rows++){
for(var cols = 0; cols < settings.boxCols; cols++){
if(cols === settings.boxCols-1){
slider.append(
$('<div class="nivo-box" name="'+ cols +'" rel="'+ rows +'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block; top:-'+ (boxHeight*rows) +'px; left:-'+ (boxWidth*cols) +'px;" /></div>').css({
opacity:0,
left:(boxWidth*cols)+'px',
top:(boxHeight*rows)+'px',
width:(slider.width()-(boxWidth*cols))+'px'
})
);
$('.nivo-box[name="'+ cols +'"]', slider).height($('.nivo-box[name="'+ cols +'"] img', slider).height()+'px');
} else {
slider.append(
$('<div class="nivo-box" name="'+ cols +'" rel="'+ rows +'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block; top:-'+ (boxHeight*rows) +'px; left:-'+ (boxWidth*cols) +'px;" /></div>').css({
opacity:0,
left:(boxWidth*cols)+'px',
top:(boxHeight*rows)+'px',
width:boxWidth+'px'
})
);
$('.nivo-box[name="'+ cols +'"]', slider).height($('.nivo-box[name="'+ cols +'"] img', slider).height()+'px');
}
}
}
sliderImg.stop().animate({
height: $(vars.currentImage).height()
}, settings.animSpeed);
};
// Private run method
var nivoRun = function(slider, kids, settings, nudge){
// Get our vars
var vars = slider.data('nivo:vars');
// Trigger the lastSlide callback
if(vars && (vars.currentSlide === vars.totalSlides - 1)){
settings.lastSlide.call(this);
}
// Stop
if((!vars || vars.stop) && !nudge) { return false; }
// Trigger the beforeChange callback
settings.beforeChange.call(this);
// Set current background before change
if(!nudge){
sliderImg.attr('src', vars.currentImage.attr('src'));
} else {
if(nudge === 'prev'){
sliderImg.attr('src', vars.currentImage.attr('src'));
}
if(nudge === 'next'){
sliderImg.attr('src', vars.currentImage.attr('src'));
}
}
vars.currentSlide++;
// Trigger the slideshowEnd callback
if(vars.currentSlide === vars.totalSlides){
vars.currentSlide = 0;
settings.slideshowEnd.call(this);
}
if(vars.currentSlide < 0) { vars.currentSlide = (vars.totalSlides - 1); }
// Set vars.currentImage
if($(kids[vars.currentSlide]).is('img')){
vars.currentImage = $(kids[vars.currentSlide]);
} else {
vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
}
// Set active links
if(settings.controlNav){
$('a', vars.controlNavEl).removeClass('active');
$('a:eq('+ vars.currentSlide +')', vars.controlNavEl).addClass('active');
}
// Process caption
processCaption(settings);
// Remove any slices from last transition
$('.nivo-slice', slider).remove();
// Remove any boxes from last transition
$('.nivo-box', slider).remove();
var currentEffect = settings.effect,
anims = '';
// Generate random effect
if(settings.effect === 'random'){
anims = new Array('sliceDownRight','sliceDownLeft','sliceUpRight','sliceUpLeft','sliceUpDown','sliceUpDownLeft','fold','fade',
'boxRandom','boxRain','boxRainReverse','boxRainGrow','boxRainGrowReverse');
currentEffect = anims[Math.floor(Math.random()*(anims.length + 1))];
if(currentEffect === undefined) { currentEffect = 'fade'; }
}
// Run random effect from specified set (eg: effect:'fold,fade')
if(settings.effect.indexOf(',') !== -1){
anims = settings.effect.split(',');
currentEffect = anims[Math.floor(Math.random()*(anims.length))];
if(currentEffect === undefined) { currentEffect = 'fade'; }
}
// Custom transition as defined by "data-transition" attribute
if(vars.currentImage.attr('data-transition')){
currentEffect = vars.currentImage.attr('data-transition');
}
// Run effects
vars.running = true;
var timeBuff = 0,
i = 0,
slices = '',
firstSlice = '',
totalBoxes = '',
boxes = '';
if(currentEffect === 'sliceDown' || currentEffect === 'sliceDownRight' || currentEffect === 'sliceDownLeft'){
createSlices(slider, settings, vars);
timeBuff = 0;
i = 0;
slices = $('.nivo-slice', slider);
if(currentEffect === 'sliceDownLeft') { slices = $('.nivo-slice', slider)._reverse(); }
slices.each(function(){
var slice = $(this);
slice.css({ 'top': '0px' });
if(i === settings.slices-1){
setTimeout(function(){
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
}, (100 + timeBuff));
} else {
setTimeout(function(){
slice.animate({opacity:'1.0' }, settings.animSpeed);
}, (100 + timeBuff));
}
timeBuff += 50;
i++;
});
} else if(currentEffect === 'sliceUp' || currentEffect === 'sliceUpRight' || currentEffect === 'sliceUpLeft'){
createSlices(slider, settings, vars);
timeBuff = 0;
i = 0;
slices = $('.nivo-slice', slider);
if(currentEffect === 'sliceUpLeft') { slices = $('.nivo-slice', slider)._reverse(); }
slices.each(function(){
var slice = $(this);
slice.css({ 'bottom': '0px' });
if(i === settings.slices-1){
setTimeout(function(){
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
}, (100 + timeBuff));
} else {
setTimeout(function(){
slice.animate({opacity:'1.0' }, settings.animSpeed);
}, (100 + timeBuff));
}
timeBuff += 50;
i++;
});
} else if(currentEffect === 'sliceUpDown' || currentEffect === 'sliceUpDownRight' || currentEffect === 'sliceUpDownLeft'){
createSlices(slider, settings, vars);
timeBuff = 0;
i = 0;
var v = 0;
slices = $('.nivo-slice', slider);
if(currentEffect === 'sliceUpDownLeft') { slices = $('.nivo-slice', slider)._reverse(); }
slices.each(function(){
var slice = $(this);
if(i === 0){
slice.css('top','0px');
i++;
} else {
slice.css('bottom','0px');
i = 0;
}
if(v === settings.slices-1){
setTimeout(function(){
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
}, (100 + timeBuff));
} else {
setTimeout(function(){
slice.animate({opacity:'1.0' }, settings.animSpeed);
}, (100 + timeBuff));
}
timeBuff += 50;
v++;
});
} else if(currentEffect === 'fold'){
createSlices(slider, settings, vars);
timeBuff = 0;
i = 0;
$('.nivo-slice', slider).each(function(){
var slice = $(this);
var origWidth = slice.width();
slice.css({ top:'0px', width:'0px' });
if(i === settings.slices-1){
setTimeout(function(){
slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
}, (100 + timeBuff));
} else {
setTimeout(function(){
slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed);
}, (100 + timeBuff));
}
timeBuff += 50;
i++;
});
} else if(currentEffect === 'fade'){
createSlices(slider, settings, vars);
firstSlice = $('.nivo-slice:first', slider);
firstSlice.css({
'width': slider.width() + 'px'
});
firstSlice.animate({ opacity:'1.0' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
} else if(currentEffect === 'slideInRight'){
createSlices(slider, settings, vars);
firstSlice = $('.nivo-slice:first', slider);
firstSlice.css({
'width': '0px',
'opacity': '1'
});
firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
} else if(currentEffect === 'slideInLeft'){
createSlices(slider, settings, vars);
firstSlice = $('.nivo-slice:first', slider);
firstSlice.css({
'width': '0px',
'opacity': '1',
'left': '',
'right': '0px'
});
firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){
// Reset positioning
firstSlice.css({
'left': '0px',
'right': ''
});
slider.trigger('nivo:animFinished');
});
} else if(currentEffect === 'boxRandom'){
createBoxes(slider, settings, vars);
totalBoxes = settings.boxCols * settings.boxRows;
i = 0;
timeBuff = 0;
boxes = shuffle($('.nivo-box', slider));
boxes.each(function(){
var box = $(this);
if(i === totalBoxes-1){
setTimeout(function(){
box.animate({ opacity:'1' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
}, (100 + timeBuff));
} else {
setTimeout(function(){
box.animate({ opacity:'1' }, settings.animSpeed);
}, (100 + timeBuff));
}
timeBuff += 20;
i++;
});
} else if(currentEffect === 'boxRain' || currentEffect === 'boxRainReverse' || currentEffect === 'boxRainGrow' || currentEffect === 'boxRainGrowReverse'){
createBoxes(slider, settings, vars);
totalBoxes = settings.boxCols * settings.boxRows;
i = 0;
timeBuff = 0;
// Split boxes into 2D array
var rowIndex = 0;
var colIndex = 0;
var box2Darr = [];
box2Darr[rowIndex] = [];
boxes = $('.nivo-box', slider);
if(currentEffect === 'boxRainReverse' || currentEffect === 'boxRainGrowReverse'){
boxes = $('.nivo-box', slider)._reverse();
}
boxes.each(function(){
box2Darr[rowIndex][colIndex] = $(this);
colIndex++;
if(colIndex === settings.boxCols){
rowIndex++;
colIndex = 0;
box2Darr[rowIndex] = [];
}
});
// Run animation
for(var cols = 0; cols < (settings.boxCols * 2); cols++){
var prevCol = cols;
for(var rows = 0; rows < settings.boxRows; rows++){
if(prevCol >= 0 && prevCol < settings.boxCols){
/* Due to some weird JS bug with loop vars
being used in setTimeout, this is wrapped
with an anonymous function call */
(function(row, col, time, i, totalBoxes) {
var box = $(box2Darr[row][col]);
var w = box.width();
var h = box.height();
if(currentEffect === 'boxRainGrow' || currentEffect === 'boxRainGrowReverse'){
box.width(0).height(0);
}
if(i === totalBoxes-1){
setTimeout(function(){
box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3, '', function(){ slider.trigger('nivo:animFinished'); });
}, (100 + time));
} else {
setTimeout(function(){
box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3);
}, (100 + time));
}
})(rows, prevCol, timeBuff, i, totalBoxes);
i++;
}
prevCol--;
}
timeBuff += 100;
}
}
};
// Shuffle an array
var shuffle = function(arr){
for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i, 10), x = arr[--i], arr[i] = arr[j], arr[j] = x);
return arr;
};
// For debugging
var trace = function(msg){
if(this.console && typeof console.log !== 'undefined') { console.log(msg); }
};
// Start / Stop
this.stop = function(){
if(!$(element).data('nivo:vars').stop){
$(element).data('nivo:vars').stop = true;
trace('Stop Slider');
}
};
this.start = function(){
if($(element).data('nivo:vars').stop){
$(element).data('nivo:vars').stop = false;
trace('Start Slider');
}
};
// Trigger the afterLoad callback
settings.afterLoad.call(this);
return this;
};
$.fn.nivoSlider = function(options) {
return this.each(function(key, value){
var element = $(this);
// Return early if this element already has a plugin instance
if (element.data('nivoslider')) { return element.data('nivoslider'); }
// Pass options to plugin constructor
var nivoslider = new NivoSlider(this, options);
// Store plugin object in this element's data
element.data('nivoslider', nivoslider);
});
};
//Default settings
$.fn.nivoSlider.defaults = {
effect: 'random',
slices: 15,
boxCols: 8,
boxRows: 4,
animSpeed: 500,
pauseTime: 3000,
startSlide: 0,
directionNav: true,
controlNav: true,
controlNavThumbs: false,
pauseOnHover: true,
manualAdvance: false,
prevText: 'Prev',
nextText: 'Next',
randomStart: false,
beforeChange: function(){},
afterChange: function(){},
slideshowEnd: function(){},
lastSlide: function(){},
afterLoad: function(){}
};
$.fn._reverse = [].reverse;
})(jQuery);
File diff suppressed because one or more lines are too long
@@ -0,0 +1,162 @@
(function ($, window, document) {
'use strict';
// Main function
$.fn.scrollUp = function (options) {
// Ensure that only one scrollUp exists
if (!$.data(document.body, 'scrollUp')) {
$.data(document.body, 'scrollUp', true);
$.fn.scrollUp.init(options);
}
};
// Init
$.fn.scrollUp.init = function (options) {
// Define vars
var o = $.fn.scrollUp.settings = $.extend({}, $.fn.scrollUp.defaults, options),
triggerVisible = false,
animIn, animOut, animSpeed, scrollDis, scrollEvent, scrollTarget, $self;
// Create element
if (o.scrollTrigger) {
$self = $(o.scrollTrigger);
} else {
$self = $('<a/>', {
id: o.scrollName,
href: '#top'
});
}
// Set scrollTitle if there is one
if (o.scrollTitle) {
$self.attr('title', o.scrollTitle);
}
$self.appendTo('body');
// If not using an image display text
if (!(o.scrollImg || o.scrollTrigger)) {
$self.html(o.scrollText);
}
// Minimum CSS to make the magic happen
$self.css({
display: 'none',
position: 'fixed',
zIndex: o.zIndex
});
// Active point overlay
if (o.activeOverlay) {
$('<div/>', {
id: o.scrollName + '-active'
}).css({
position: 'absolute',
'top': o.scrollDistance + 'px',
width: '100%',
borderTop: '1px dotted' + o.activeOverlay,
zIndex: o.zIndex
}).appendTo('body');
}
// Switch animation type
switch (o.animation) {
case 'fade':
animIn = 'fadeIn';
animOut = 'fadeOut';
animSpeed = o.animationSpeed;
break;
case 'slide':
animIn = 'slideDown';
animOut = 'slideUp';
animSpeed = o.animationSpeed;
break;
default:
animIn = 'show';
animOut = 'hide';
animSpeed = 0;
}
// If from top or bottom
if (o.scrollFrom === 'top') {
scrollDis = o.scrollDistance;
} else {
scrollDis = $(document).height() - $(window).height() - o.scrollDistance;
}
// Scroll function
scrollEvent = $(window).scroll(function () {
if ($(window).scrollTop() > scrollDis) {
if (!triggerVisible) {
$self[animIn](animSpeed);
triggerVisible = true;
}
} else {
if (triggerVisible) {
$self[animOut](animSpeed);
triggerVisible = false;
}
}
});
if (o.scrollTarget) {
if (typeof o.scrollTarget === 'number') {
scrollTarget = o.scrollTarget;
} else if (typeof o.scrollTarget === 'string') {
scrollTarget = Math.floor($(o.scrollTarget).offset().top);
}
} else {
scrollTarget = 0;
}
// To the top
$self.click(function (e) {
e.preventDefault();
$('html, body').animate({
scrollTop: scrollTarget
}, o.scrollSpeed, o.easingType);
});
};
// Defaults
$.fn.scrollUp.defaults = {
scrollName: 'scrollUp', // Element ID
scrollDistance: 300, // Distance from top/bottom before showing element (px)
scrollFrom: 'top', // 'top' or 'bottom'
scrollSpeed: 300, // Speed back to top (ms)
easingType: 'linear', // Scroll to top easing (see http://easings.net/)
animation: 'fade', // Fade, slide, none
animationSpeed: 200, // Animation in speed (ms)
scrollTrigger: false, // Set a custom triggering element. Can be an HTML string or jQuery object
scrollTarget: false, // Set a custom target element for scrolling to. Can be element or number
scrollText: 'Scroll to top', // Text for element, can contain HTML
scrollTitle: false, // Set a custom <a> title if required. Defaults to scrollText
scrollImg: false, // Set true to use image
activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
zIndex: 2147483647 // Z-Index for the overlay
};
// Destroy scrollUp plugin and clean all modifications to the DOM
$.fn.scrollUp.destroy = function (scrollEvent) {
$.removeData(document.body, 'scrollUp');
$('#' + $.fn.scrollUp.settings.scrollName).remove();
$('#' + $.fn.scrollUp.settings.scrollName + '-active').remove();
// If 1.7 or above use the new .off()
if ($.fn.jquery.split('.')[1] >= 7) {
$(window).off('scroll', scrollEvent);
// Else use the old .unbind()
} else {
$(window).unbind('scroll', scrollEvent);
}
};
$.scrollUp = $.fn.scrollUp;
})(jQuery, window, document);
File diff suppressed because one or more lines are too long
+503
View File
@@ -0,0 +1,503 @@
(function($) {
'use strict';
/*!
* Particleground
*
*/
document.addEventListener('DOMContentLoaded', function () {
particleground(document.getElementById('particles'), {
dotColor: '#fff',
lineColor: '#E92B40'
});
var intro = document.getElementById('intro');
intro.style.marginTop = - intro.offsetHeight / 2 + 'px';
}, false);
;(function(window, document) {
"use strict";
var pluginName = 'particleground';
function extend(out) {
out = out || {};
for (var i = 1; i < arguments.length; i++) {
var obj = arguments[i];
if (!obj) continue;
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'object')
deepExtend(out[key], obj[key]);
else
out[key] = obj[key];
}
}
}
return out;
};
var $ = window.jQuery;
function Plugin(element, options) {
var canvasSupport = !!document.createElement('canvas').getContext;
var canvas;
var ctx;
var particles = [];
var raf;
var mouseX = 0;
var mouseY = 0;
var winW;
var winH;
var desktop = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i);
var orientationSupport = !!window.DeviceOrientationEvent;
var tiltX = 0;
var pointerX;
var pointerY;
var tiltY = 0;
var paused = false;
options = extend({}, window[pluginName].defaults, options);
/**
* Init
*/
function init() {
if (!canvasSupport) { return; }
//Create canvas
canvas = document.createElement('canvas');
canvas.className = 'pg-canvas';
canvas.style.display = 'block';
element.insertBefore(canvas, element.firstChild);
ctx = canvas.getContext('2d');
styleCanvas();
// Create particles
var numParticles = Math.round((canvas.width * canvas.height) / options.density);
for (var i = 0; i < numParticles; i++) {
var p = new Particle();
p.setStackPos(i);
particles.push(p);
};
window.addEventListener('resize', function() {
resizeHandler();
}, false);
document.addEventListener('mousemove', function(e) {
mouseX = e.pageX;
mouseY = e.pageY;
}, false);
if (orientationSupport && !desktop) {
window.addEventListener('deviceorientation', function () {
// Contrain tilt range to [-30,30]
tiltY = Math.min(Math.max(-event.beta, -30), 30);
tiltX = Math.min(Math.max(-event.gamma, -30), 30);
}, true);
}
draw();
hook('onInit');
}
/**
* Style the canvas
*/
function styleCanvas() {
canvas.width = element.offsetWidth;
canvas.height = element.offsetHeight;
ctx.fillStyle = options.dotColor;
ctx.strokeStyle = options.lineColor;
ctx.lineWidth = options.lineWidth;
}
/**
* Draw particles
*/
function draw() {
if (!canvasSupport) { return; }
winW = window.innerWidth;
winH = window.innerHeight;
// Wipe canvas
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Update particle positions
for (var i = 0; i < particles.length; i++) {
particles[i].updatePosition();
};
// Draw particles
for (var i = 0; i < particles.length; i++) {
particles[i].draw();
};
// Call this function next time screen is redrawn
if (!paused) {
raf = requestAnimationFrame(draw);
}
}
/**
* Add/remove particles.
*/
function resizeHandler() {
// Resize the canvas
styleCanvas();
var elWidth = element.offsetWidth;
var elHeight = element.offsetHeight;
// Remove particles that are outside the canvas
for (var i = particles.length - 1; i >= 0; i--) {
if (particles[i].position.x > elWidth || particles[i].position.y > elHeight) {
particles.splice(i, 1);
}
};
// Adjust particle density
var numParticles = Math.round((canvas.width * canvas.height) / options.density);
if (numParticles > particles.length) {
while (numParticles > particles.length) {
var p = new Particle();
particles.push(p);
}
} else if (numParticles < particles.length) {
particles.splice(numParticles);
}
// Re-index particles
for (i = particles.length - 1; i >= 0; i--) {
particles[i].setStackPos(i);
};
}
/**
* Pause particle system
*/
function pause() {
paused = true;
}
/**
* Start particle system
*/
function start() {
paused = false;
draw();
}
/**
* Particle
*/
function Particle() {
this.stackPos;
this.active = true;
this.layer = Math.ceil(Math.random() * 3);
this.parallaxOffsetX = 0;
this.parallaxOffsetY = 0;
// Initial particle position
this.position = {
x: Math.ceil(Math.random() * canvas.width),
y: Math.ceil(Math.random() * canvas.height)
}
// Random particle speed, within min and max values
this.speed = {}
switch (options.directionX) {
case 'left':
this.speed.x = +(-options.maxSpeedX + (Math.random() * options.maxSpeedX) - options.minSpeedX).toFixed(2);
break;
case 'right':
this.speed.x = +((Math.random() * options.maxSpeedX) + options.minSpeedX).toFixed(2);
break;
default:
this.speed.x = +((-options.maxSpeedX / 2) + (Math.random() * options.maxSpeedX)).toFixed(2);
this.speed.x += this.speed.x > 0 ? options.minSpeedX : -options.minSpeedX;
break;
}
switch (options.directionY) {
case 'up':
this.speed.y = +(-options.maxSpeedY + (Math.random() * options.maxSpeedY) - options.minSpeedY).toFixed(2);
break;
case 'down':
this.speed.y = +((Math.random() * options.maxSpeedY) + options.minSpeedY).toFixed(2);
break;
default:
this.speed.y = +((-options.maxSpeedY / 2) + (Math.random() * options.maxSpeedY)).toFixed(2);
this.speed.x += this.speed.y > 0 ? options.minSpeedY : -options.minSpeedY;
break;
}
}
/**
* Draw particle
*/
Particle.prototype.draw = function() {
// Draw circle
ctx.beginPath();
ctx.arc(this.position.x + this.parallaxOffsetX, this.position.y + this.parallaxOffsetY, options.particleRadius / 2, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
// Draw lines
ctx.beginPath();
// Iterate over all particles which are higher in the stack than this one
for (var i = particles.length - 1; i > this.stackPos; i--) {
var p2 = particles[i];
// Pythagorus theorum to get distance between two points
var a = this.position.x - p2.position.x
var b = this.position.y - p2.position.y
var dist = Math.sqrt((a * a) + (b * b)).toFixed(2);
// If the two particles are in proximity, join them
if (dist < options.proximity) {
ctx.moveTo(this.position.x + this.parallaxOffsetX, this.position.y + this.parallaxOffsetY);
if (options.curvedLines) {
ctx.quadraticCurveTo(Math.max(p2.position.x, p2.position.x), Math.min(p2.position.y, p2.position.y), p2.position.x + p2.parallaxOffsetX, p2.position.y + p2.parallaxOffsetY);
} else {
ctx.lineTo(p2.position.x + p2.parallaxOffsetX, p2.position.y + p2.parallaxOffsetY);
}
}
}
ctx.stroke();
ctx.closePath();
}
/**
* update particle position
*/
Particle.prototype.updatePosition = function() {
if (options.parallax) {
if (orientationSupport && !desktop) {
// Map tiltX range [-30,30] to range [0,winW]
var ratioX = (winW - 0) / (30 - -30);
pointerX = (tiltX - -30) * ratioX + 0;
// Map tiltY range [-30,30] to range [0,winH]
var ratioY = (winH - 0) / (30 - -30);
pointerY = (tiltY - -30) * ratioY + 0;
} else {
pointerX = mouseX;
pointerY = mouseY;
}
// Calculate parallax offsets
this.parallaxTargX = (pointerX - (winW / 2)) / (options.parallaxMultiplier * this.layer);
this.parallaxOffsetX += (this.parallaxTargX - this.parallaxOffsetX) / 10; // Easing equation
this.parallaxTargY = (pointerY - (winH / 2)) / (options.parallaxMultiplier * this.layer);
this.parallaxOffsetY += (this.parallaxTargY - this.parallaxOffsetY) / 10; // Easing equation
}
var elWidth = element.offsetWidth;
var elHeight = element.offsetHeight;
switch (options.directionX) {
case 'left':
if (this.position.x + this.speed.x + this.parallaxOffsetX < 0) {
this.position.x = elWidth - this.parallaxOffsetX;
}
break;
case 'right':
if (this.position.x + this.speed.x + this.parallaxOffsetX > elWidth) {
this.position.x = 0 - this.parallaxOffsetX;
}
break;
default:
// If particle has reached edge of canvas, reverse its direction
if (this.position.x + this.speed.x + this.parallaxOffsetX > elWidth || this.position.x + this.speed.x + this.parallaxOffsetX < 0) {
this.speed.x = -this.speed.x;
}
break;
}
switch (options.directionY) {
case 'up':
if (this.position.y + this.speed.y + this.parallaxOffsetY < 0) {
this.position.y = elHeight - this.parallaxOffsetY;
}
break;
case 'down':
if (this.position.y + this.speed.y + this.parallaxOffsetY > elHeight) {
this.position.y = 0 - this.parallaxOffsetY;
}
break;
default:
// If particle has reached edge of canvas, reverse its direction
if (this.position.y + this.speed.y + this.parallaxOffsetY > elHeight || this.position.y + this.speed.y + this.parallaxOffsetY < 0) {
this.speed.y = -this.speed.y;
}
break;
}
// Move particle
this.position.x += this.speed.x;
this.position.y += this.speed.y;
}
/**
* Setter: particle stacking position
*/
Particle.prototype.setStackPos = function(i) {
this.stackPos = i;
}
function option (key, val) {
if (val) {
options[key] = val;
} else {
return options[key];
}
}
function destroy() {
console.log('destroy');
canvas.parentNode.removeChild(canvas);
hook('onDestroy');
if ($) {
$(element).removeData('plugin_' + pluginName);
}
}
function hook(hookName) {
if (options[hookName] !== undefined) {
options[hookName].call(element);
}
}
init();
return {
option: option,
destroy: destroy,
start: start,
pause: pause
};
}
window[pluginName] = function(elem, options) {
return new Plugin(elem, options);
};
window[pluginName].defaults = {
minSpeedX: 0.1,
maxSpeedX: 0.7,
minSpeedY: 0.1,
maxSpeedY: 0.7,
directionX: 'center', // 'center', 'left' or 'right'. 'center' = dots bounce off edges
directionY: 'center', // 'center', 'up' or 'down'. 'center' = dots bounce off edges
density: 10000, // How many particles will be generated: one particle every n pixels
dotColor: '#666666',
lineColor: '#666666',
particleRadius: 7, // Dot size
lineWidth: 1,
curvedLines: false,
proximity: 100, // How close two dots need to be before they join
parallax: true,
parallaxMultiplier: 5, // The lower the number, the more extreme the parallax effect
onInit: function() {},
onDestroy: function() {}
};
// nothing wrong with hooking into jQuery if it's there...
if ($) {
$.fn[pluginName] = function(options) {
if (typeof arguments[0] === 'string') {
var methodName = arguments[0];
var args = Array.prototype.slice.call(arguments, 1);
var returnVal;
this.each(function() {
if ($.data(this, 'plugin_' + pluginName) && typeof $.data(this, 'plugin_' + pluginName)[methodName] === 'function') {
returnVal = $.data(this, 'plugin_' + pluginName)[methodName].apply(this, args);
}
});
if (returnVal !== undefined){
return returnVal;
} else {
return this;
}
} else if (typeof options === "object" || !options) {
return this.each(function() {
if (!$.data(this, 'plugin_' + pluginName)) {
$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
}
});
}
};
}
})(window, document);
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());
// End particle
(function($) {
$('.accordion > li:eq(0) a').addClass('active').next().slideDown();
$('.accordion a').click(function(j) {
var dropDown = $(this).closest('li').find('p');
$(this).closest('.accordion').find('p').not(dropDown).slideUp();
if ($(this).hasClass('active')) {
$(this).removeClass('active');
} else {
$(this).closest('.accordion').find('a.active').removeClass('active');
$(this).addClass('active');
}
dropDown.stop(false, true).slideToggle();
j.preventDefault();
});
})(jQuery);
$(document).ready(function(){
$('.aa').counterUp({
delay: 10,
time: 1000
});
});
})(jQuery);
File diff suppressed because one or more lines are too long
+22
View File
@@ -0,0 +1,22 @@
let oness = document.querySelectorAll('.one');
let colors = [
'rgba(65, 210, 185, 1)',
'rgba(255, 240, 90, 1)',
'rgba(255, 210, 90, 1)',
'rgba(255, 170, 90, 1)',
'rgba(244, 91, 105, 1)',
]
const getRandomColorIndex = (max) => {
return Math.floor(Math.random() * Math.floor(max));
}
;[...oness].forEach( (one, i) => {
let colorIndex = getRandomColorIndex(colors.length);
one.style = `background-color: ${colors[colorIndex]}`
one.innerHTML = `box ${i+1}`;
})
// partical js
particlesJS("particles-js", {"particles":{"number":{"value":80,"density":{"enable":true,"value_area":800}},"color":{"value":"#ffffff"},"shape":{"type":"circle","stroke":{"width":0,"color":"#FFC704"},"polygon":{"nb_sides":5},"image":{"src":"img/github.svg","width":100,"height":100}},"opacity":{"value":0.5,"random":false,"anim":{"enable":false,"speed":1,"opacity_min":0.1,"sync":false}},"size":{"value":3,"random":true,"anim":{"enable":false,"speed":40,"size_min":0.1,"sync":false}},"line_linked":{"enable":true,"distance":150,"color":"#ffffff","opacity":0.4,"width":1},"move":{"enable":true,"speed":6,"direction":"none","random":false,"straight":false,"out_mode":"out","bounce":false,"attract":{"enable":false,"rotateX":600,"rotateY":1200}}},"interactivity":{"detect_on":"canvas","events":{"onhover":{"enable":true,"mode":"repulse"},"onclick":{"enable":true,"mode":"push"},"resize":true},"modes":{"grab":{"distance":400,"line_linked":{"opacity":1}},"bubble":{"distance":400,"size":40,"duration":2,"opacity":8,"speed":3},"repulse":{"distance":200,"duration":0.4},"push":{"particles_nb":4},"remove":{"particles_nb":2}}},"retina_detect":true});var count_particles, stats, update; stats = new Stats; stats.setMode(0); stats.domElement.style.position = 'absolute'; stats.domElement.style.left = '0px'; stats.domElement.style.top = '0px'; document.body.appendChild(stats.domElement); count_particles = document.querySelector('.js-count-particles'); update = function() { stats.begin(); stats.end(); if (window.pJSDom[0].pJS.particles && window.pJSDom[0].pJS.particles.array) { count_particles.innerText = window.pJSDom[0].pJS.particles.array.length; } requestAnimationFrame(update); }; requestAnimationFrame(update);;
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+149
View File
@@ -0,0 +1,149 @@
/**
* @author mrdoob / http://mrdoob.com/
*/
var Stats = function () {
var startTime = Date.now(), prevTime = startTime;
var ms = 0, msMin = Infinity, msMax = 0;
var fps = 0, fpsMin = Infinity, fpsMax = 0;
var frames = 0, mode = 0;
var container = document.createElement( 'div' );
container.id = 'stats';
container.addEventListener( 'mousedown', function ( event ) { event.preventDefault(); setMode( ++ mode % 2 ) }, false );
container.style.cssText = 'width:80px;opacity:0.9;cursor:pointer';
var fpsDiv = document.createElement( 'div' );
fpsDiv.id = 'fps';
fpsDiv.style.cssText = 'padding:0 0 3px 3px;text-align:left;background-color:#002';
container.appendChild( fpsDiv );
var fpsText = document.createElement( 'div' );
fpsText.id = 'fpsText';
fpsText.style.cssText = 'color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px';
fpsText.innerHTML = 'FPS';
fpsDiv.appendChild( fpsText );
var fpsGraph = document.createElement( 'div' );
fpsGraph.id = 'fpsGraph';
fpsGraph.style.cssText = 'position:relative;width:74px;height:30px;background-color:#0ff';
fpsDiv.appendChild( fpsGraph );
while ( fpsGraph.children.length < 74 ) {
var bar = document.createElement( 'span' );
bar.style.cssText = 'width:1px;height:30px;float:left;background-color:#113';
fpsGraph.appendChild( bar );
}
var msDiv = document.createElement( 'div' );
msDiv.id = 'ms';
msDiv.style.cssText = 'padding:0 0 3px 3px;text-align:left;background-color:#020;display:none';
container.appendChild( msDiv );
var msText = document.createElement( 'div' );
msText.id = 'msText';
msText.style.cssText = 'color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px';
msText.innerHTML = 'MS';
msDiv.appendChild( msText );
var msGraph = document.createElement( 'div' );
msGraph.id = 'msGraph';
msGraph.style.cssText = 'position:relative;width:74px;height:30px;background-color:#0f0';
msDiv.appendChild( msGraph );
while ( msGraph.children.length < 74 ) {
var bar = document.createElement( 'span' );
bar.style.cssText = 'width:1px;height:30px;float:left;background-color:#131';
msGraph.appendChild( bar );
}
var setMode = function ( value ) {
mode = value;
switch ( mode ) {
case 0:
fpsDiv.style.display = 'block';
msDiv.style.display = 'none';
break;
case 1:
fpsDiv.style.display = 'none';
msDiv.style.display = 'block';
break;
}
};
var updateGraph = function ( dom, value ) {
var child = dom.appendChild( dom.firstChild );
child.style.height = value + 'px';
};
return {
REVISION: 12,
domElement: container,
setMode: setMode,
begin: function () {
startTime = Date.now();
},
end: function () {
var time = Date.now();
ms = time - startTime;
msMin = Math.min( msMin, ms );
msMax = Math.max( msMax, ms );
msText.textContent = ms + ' MS (' + msMin + '-' + msMax + ')';
updateGraph( msGraph, Math.min( 30, 30 - ( ms / 200 ) * 30 ) );
frames ++;
if ( time > prevTime + 1000 ) {
fps = Math.round( ( frames * 1000 ) / ( time - prevTime ) );
fpsMin = Math.min( fpsMin, fps );
fpsMax = Math.max( fpsMax, fps );
fpsText.textContent = fps + ' FPS (' + fpsMin + '-' + fpsMax + ')';
updateGraph( fpsGraph, Math.min( 30, 30 - ( fps / 100 ) * 30 ) );
prevTime = time;
frames = 0;
}
return time;
},
update: function () {
startTime = this.end();
}
}
};
if ( typeof module === 'object' ) {
module.exports = Stats;
}
+223
View File
@@ -0,0 +1,223 @@
$(window).on("load", function() {
var fn = {
/*
Launch
*/
Launch: function () {
fn.IntroCanvas();
},
/*
Intro Canvas
*/
IntroCanvas: function() {
const canvas = document.getElementById('intro__canvas');
if(canvas) {
const ctx = canvas.getContext('2d');
let width = canvas.width = canvas.offsetWidth;
let height = canvas.height = canvas.offsetHeight;
const colours = JSON.parse( canvas.getAttribute('data-colors') );
const maxParticles = 200;
let particles = [];
// init client x and y values
let cx = width / 2;
let cy = height / 2;
/*window.addEventListener('mousemove', (e) => {
var bounds = canvas.getBoundingClientRect();
cx = e.clientX - bounds.left;
cy = e.clientY - bounds.top;
});*/
class Particle {
constructor(x, y, vx, vy, radius, colour) {
this.x = x;
this.y = y;
this.vx = vx;
this.vy = vy;
this.radius = radius;
this.colour = colour;
}
move() {
// Reset particle if it goes off screen
if (this.y > height || this.y < 0 || this.x > width || this.x < 0) {
this.reset();
}
// Move particles with respect to velocity vectors
this.x += this.vx;
this.y += this.vy;
}
reset() {
this.x = cx;
this.y = cy;
this.vx = 2 + Math.random() * - 4;
this.vy = 2 + Math.random() * - 4;
this.radius = 1 + Math.random() * 3;
}
draw(ctx) {
ctx.beginPath();
ctx.arc(this.x, this.y, this.radius, 0, 2 * Math.PI, false);
ctx.fillStyle = this.colour;
ctx.fill();
}
}
function initParticles() {
for (let i = 0; i < maxParticles; i++) {
setTimeout(createParticle, 10 * i, i);
}
}
function createParticle(i) {
let p = new Particle(
Math.floor(Math.random() * width), // x
Math.floor(Math.random() * height), // y
1.5 + Math.random() * - 3, // vx
1.5 + Math.random() * - 3, // vy
1 + Math.random(), // radius
colours[Math.floor(Math.random() * colours.length)]
);
particles.push(p);
}
function loop() {
ctx.clearRect(0, 0, width, height);
for (let particle of particles) {
particle.move();
particle.draw(ctx);
}
requestAnimationFrame(loop);
}
// Start animation
initParticles();
loop();
// Resize canvas - responsive
window.addEventListener('resize', resize);
function resize() {
width = canvas.width = window.innerWidth;
height = canvas.height = window.innerHeight;
}
}
},
};
fn.Launch();
setTimeout(function() {
function n() {
S.animate({
d: "M1010.1,64C1137.4,64,1350,0,1350,0H0C0,0,839.3,64,1010.1,64z"
}, 8e3, mina.easeinout, o)
}
function o() {
S.animate({
d: "M287,64C414.3,64,1350,0,1350,0H0C0,0,116.2,64,287,64z"
}, 8e3, mina.easeinout, n)
}
function a() {
y.animate({
d: "M1076.6,118.4C1247.4,118.4,1350,0.2,1350,0.2H0C0,0.2,908.6,118.4,1076.6,118.4z"
}, 12e3, mina.easeinout, i)
}
function i() {
y.animate({
d: "M307.1,118.4C477.8,118.4,1350,0.2,1350,0.2H0C0,0.2,139.5,118.4,307.1,118.4z"
}, 12e3, mina.easeinout, a)
}
function c() {
M.animate({
d: "M317.9,76C467,76,1350,0.2,1350,0.2H0C0,0.2,1,76,317.9,76z"
}, 9e3, mina.easeinout, d)
}
function d() {
M.animate({
d: "M954,76c149,0,396-75.8,396-75.8H0C0,0.2,637,76,954,76z"
}, 9e3, mina.easeinout, c)
}
function l() {
z.animate({
d: "M474,67c168,0,876-66.8,876-66.8H0C0,0.2,168.1,67,474,67z"
}, 11e3, mina.easeinout, r)
}
function r() {
z.animate({
d: "M904,67c168,0,446-66.8,446-66.8H0C0,0.2,598.2,67,904,67z"
}, 11e3, mina.easeinout, l)
}
function u() {
H.animate({
d: "M327,38C478.3,38,1350,0.1,1350,0.1H0C0,0.1,0,38,327,38z"
}, 14e3, mina.easeinout, m)
}
function m() {
H.animate({
d: "M857,38c151.3,0,493-37.9,493-37.9H0C0,0.1,530,38,857,38z"
}, 14e3, mina.easeinout, u)
}
function C() {
L.animate({
d: "M1175,103c169,0,175-102.9,175-102.9H0C0,0.1,1007,103,1175,103z"
}, 8e3, mina.easeinout, p)
}
function p() {
L.animate({
d: "M688,103c169,0,662-102.9,662-102.9H0C0,0.1,520,103,688,103z"
}, 8e3, mina.easeinout, C)
}
$window = $(window);
var f = $window.height() / 2,
h = $("#container-general"),
g = $("#section-quote").offset().top - f
$(document).on('click','#section-quote .container-pe-quote .pp-quote',function() {
var e = $(this).data("textquote");
$("#section-quote .container-pe-quote .pp-quote").removeClass("active"),
$(this).addClass("active"), $("#section-quote .container-quote").removeClass("carousel-on"),
$("#section-quote .container-quote .quote.show").removeClass("show").addClass("hide-bottom"),
$("." + e).removeClass("hide-bottom hide-top").addClass("show")
})
}, 150);
setInterval(function () {
var maxVal= $("#section-quote .container-pe-quote .pp-quote").length;
var randomVal = Math.floor((Math.random() * maxVal)+1);
var count = 1;
$('.pp-quote').each( function(){
var obj = $(this);
if(count==randomVal){
var dataRR = obj.attr('data-textquote');
$(".pp-quote[data-textquote="+dataRR+"]").click();
}
count++;
});
},4000);
});
+541
View File
@@ -0,0 +1,541 @@
(function($) {
'use strict';
// Mobile Menu
$('.mobile-menu nav').meanmenu({
meanScreenWidth: "990",
meanMenuContainer: ".mobile-menu",
onePage: false,
});
// sticky
var wind = $(window);
var sticky = $('#sticky-header');
wind.on('scroll', function () {
var scroll = wind.scrollTop();
if (scroll < 100) {
sticky.removeClass('sticky');
} else {
sticky.addClass('sticky');
}
});
//Header Search
if($('.search-box-outer').length) {
$('.search-box-outer').on('click', function() {
$('body').addClass('search-active');
});
$('.close-search').on('click', function() {
$('body').removeClass('search-active');
});
}
// Team Script
$(".team-icon").click(function(){
$(this).siblings(".team-socail-icon").toggleClass('active');
});
/ Loder /
$(function () {
$('body').addClass('loaded');
});
/*---------------------
Nivo Slider active js
--------------------- */
$('#mainSlider').nivoSlider({
directionNav: true,
animSpeed: 500,
slices: 18,
pauseTime: 900000,
pauseOnHover: false,
controlNav: true,
prevText: '<i class="fa fa-angle-left nivo-prev-icon"></i>',
nextText: '<i class="fa fa-angle-right nivo-next-icon"></i>'
});
// Slider Active
$('.slider_list').owlCarousel({
loop: true,
autoplay: true,
autoplayTimeout: 10000,
dots: true,
nav: false,
navText: ["<i class='fas fa-arrow-left''></i>", "<i class='fas fa-arrow-right''></i>"],
responsive: {
0: {
items: 1
},
768: {
items: 1
},
992: {
items: 1
},
1000: {
items: 1
},
1920: {
items: 1
}
}
})
$('.slider_list2').owlCarousel({
loop: true,
autoplay: true,
smartSpeed:5500,
autoplayTimeout: 5000,
dots: false,
nav: true,
navText: ["<i class='flaticon-next''></i>", "<i class='flaticon-back''></i>"],
responsive: {
0: {
items: 1
},
768: {
items: 1
},
992: {
items: 1
},
1000: {
items: 1
},
1920: {
items: 1
}
}
})
// service Active
$('.service-list').owlCarousel({
loop: true,
autoplay: true,
autoplayTimeout: 10000,
dots: true,
center: false,
nav: false,
navText: ["<i class='fa fa-long-arrow-left''></i>", "<i class='fa fa-long-arrow-right''></i>"],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
768: {
items: 3
},
992: {
items: 4
},
1000: {
items: 4
},
1400: {
items: 4
},
1920: {
items: 4
}
}
})
// testimonial Active
$('.testimonial_list').owlCarousel({
loop: true,
autoplay: true,
autoplayTimeout: 10000,
dots: true,
center: false,
nav: false,
navText: ["<i class='fas fa-long-arrow-alt-right''></i>", "<i class='fas fa-long-arrow-alt-left''></i>"],
responsive: {
0: {
items: 1
},
768: {
items: 1
},
992: {
items: 1
},
1000: {
items: 1
},
1400: {
items: 1
},
1920: {
items: 1
}
}
})
// testimonial Active
$('.testimonial-list').owlCarousel({
loop: true,
autoplay: true,
autoplayTimeout: 10000,
dots: false,
center: false,
nav: false,
navText: ["<i class='fas fa-long-arrow-alt-right''></i>", "<i class='fas fa-long-arrow-alt-left''></i>"],
responsive: {
0: {
items: 1
},
768: {
items: 1
},
992: {
items: 2
},
1000: {
items: 2
},
1400: {
items: 2
},
1920: {
items: 2
}
}
})
// testimonial Active
$('.testis_lists').owlCarousel({
loop: true,
autoplay: true,
autoplayTimeout: 10000,
dots: false,
center: false,
nav: false,
navText: ["<i class='fas fa-long-arrow-alt-right''></i>", "<i class='fas fa-long-arrow-alt-left''></i>"],
responsive: {
0: {
items: 1
},
768: {
items: 1
},
992: {
items: 2
},
1000: {
items: 2
},
1400: {
items: 2
},
1920: {
items: 2
}
}
})
// testimonial Active
$('.portfolio-list').owlCarousel({
loop: true,
smartSpeed:2500,
autoplay: true,
autoplayTimeout: 4000,
dots: true,
center: true,
nav: false,
navText: ["<i class='fas fa-long-arrow-alt-right''></i>", "<i class='fas fa-long-arrow-alt-left''></i>"],
responsive: {
0: {
items: 1
},
768: {
items: 2
},
992: {
items: 4
},
1000: {
items: 5
},
1400: {
items: 5
},
1920: {
items: 5
}
}
})
$('.portfolio-list2').owlCarousel({
loop: true,
smartSpeed:false,
autoplay: true,
autoplayTimeout: 4000,
dots: false,
center: true,
nav: false,
navText: ["<i class='fas fa-long-arrow-alt-right''></i>", "<i class='fas fa-long-arrow-alt-left''></i>"],
responsive: {
0: {
items: 1
},
768: {
items: 2
},
992: {
items: 4
},
1000: {
items: 5
},
1400: {
items: 4
},
1920: {
items: 4
}
}
})
$('.portfolio-list3').owlCarousel({
loop: true,
smartSpeed:false,
autoplay: true,
autoplayTimeout: 4000,
dots: false,
center: true,
nav: false,
navText: ["<i class='fas fa-long-arrow-alt-right''></i>", "<i class='fas fa-long-arrow-alt-left''></i>"],
responsive: {
0: {
items: 1
},
768: {
items: 2
},
992: {
items: 3
},
1000: {
items: 3
},
1400: {
items: 3
},
1920: {
items: 3
}
}
})
// Case Study Active
$('.brand-list').owlCarousel({
loop: true,
autoplay: true,
autoplayTimeout: 10000,
dots: false,
center: false,
nav: false,
navText: ["<i class='fa fa-long-arrow-left''></i>", "<i class='fa fa-long-arrow-right''></i>"],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
768: {
items: 3
},
992: {
items: 4
},
1000: {
items: 5
},
1400: {
items: 5
},
1920: {
items: 5
}
}
})
// Case Study Active
$('.team-list').owlCarousel({
loop: true,
autoplay: true,
autoplayTimeout: 10000,
dots: true,
center: false,
dotsEach: true,
nav: false,
navText: ["<i class='fa fa-long-arrow-left''></i>", "<i class='fa fa-long-arrow-right''></i>"],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
768: {
items: 3
},
992: {
items: 4
},
1000: {
items: 4
},
1400: {
items: 4
},
1920: {
items: 4
}
}
})
// feature Active
$('.blog-list').owlCarousel({
loop: true,
autoplay: true,
autoplayTimeout: 10000,
dots: true,
dotsEach: false,
center: false,
nav: false,
navText: ["<i class='fa fa-long-arrow-left''></i>", "<i class='fa fa-long-arrow-right''></i>"],
responsive: {
0: {
items: 1
},
600: {
items: 1
},
768: {
items: 2
},
992: {
items: 2
},
1000: {
items: 2
},
1400: {
items: 2
},
1920: {
items: 2
}
}
})
// counterUp
$('.counter').counterUp({
delay: 10,
time: 1000
});
/* Portfolio Isotope */
$('.image_load').imagesLoaded(function() {
if ($.fn.isotope) {
var $portfolio = $('.image_load');
$portfolio.isotope({
itemSelector: '.grid-item',
filter: '*',
resizesContainer: true,
layoutMode: 'masonry',
transitionDuration: '0.8s'
});
$('.menu-filtering li').on('click', function() {
$('.menu-filtering li').removeClass('current_menu_item');
$(this).addClass('current_menu_item');
var selector = $(this).attr('data-filter');
$portfolio.isotope({
filter: selector,
});
});
};
});
// Venubox
$('.venobox').venobox({
numeratio: true,
infinigall: true
});
/*--------------------------
scrollUp
---------------------------- */
$.scrollUp({
scrollText: '<i class="fa fa-angle-up"></i>',
easingType: 'linear',
scrollSpeed: 900,
animation: 'fade'
})
// Calender Jquery
var curDate = (new Date()).getDate();
var curMonth = (new Date()).getMonth();
var curYear = (new Date()).getFullYear();
var startDay = (new Date(curYear, curMonth, 1)).getDay();
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var noofdays = ["31", "29", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31"];
var prevMonth = noofdays[curMonth - 1];
if (curMonth == 11) {
prevMonth = noofdays[0]
} else if (curMonth == 0) {
prevMonth = noofdays[11]
};
var totalDays = noofdays[curMonth];
var counter = 0;
var precounter = prevMonth - (startDay - 1);
var rightbox = 6;
var flag = true;
jQuery('.curr-month b').text(months[curMonth]);
for (var i = 0; i < 42; i++) {
if (i >= startDay) {
counter++;
if (counter > totalDays) {
counter = 1;
flag = false;
}
if (flag == true) {
jQuery('.all-date ul').append('<li class="monthdate">' + counter + '</li>');
} else {
jQuery('.all-date ul').append('<li style="opacity:.8">' + counter + '</li>');
}
} else {
jQuery('.all-date ul').append('<li style="opacity:.8">' + precounter + '</li>');
precounter++;
}
if (i == rightbox) {
jQuery(jQuery('.all-date ul li')[rightbox]).addClass("b-right");
rightbox = rightbox + 7;
}
if (i > 34) {
jQuery(jQuery('.all-date ul li')[i]).addClass("b-bottom");
}
if ((jQuery(jQuery('.all-date ul li')[i]).text() == curDate) && (jQuery(jQuery('.all-date ul li')[i]).css('opacity') == 1)) {
jQuery(jQuery('.all-date ul li')[i]).css({
"background-color": "#02548b",
"color": "#fff"
});
}
};
})(jQuery);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long