first commit

This commit is contained in:
ameye
2020-03-15 13:32:24 -04:00
commit 76b297da83
455 changed files with 98148 additions and 0 deletions
Vendored Executable
+7
View File
File diff suppressed because one or more lines are too long
+1004
View File
File diff suppressed because it is too large Load Diff
+4
View File
File diff suppressed because one or more lines are too long
Vendored Executable
+85
View File
@@ -0,0 +1,85 @@
/*
Plugin Name: Count To
Written by: Matt Huggins - https://github.com/mhuggins/jquery-countTo
*/
(function ($) {
$.fn.countTo = function (options) {
options = options || {};
return $(this).each(function () {
// set options for current element
var settings = $.extend({}, $.fn.countTo.defaults, {
from: $(this).data('from'),
to: $(this).data('to'),
speed: $(this).data('speed'),
refreshInterval: $(this).data('refresh-interval'),
decimals: $(this).data('decimals')
}, options);
// how many times to update the value, and how much to increment the value on each update
var loops = Math.ceil(settings.speed / settings.refreshInterval),
increment = (settings.to - settings.from) / loops;
// references & variables that will change with each update
var self = this,
$self = $(this),
loopCount = 0,
value = settings.from,
data = $self.data('countTo') || {};
$self.data('countTo', data);
// if an existing interval can be found, clear it first
if (data.interval) {
clearInterval(data.interval);
}
data.interval = setInterval(updateTimer, settings.refreshInterval);
// initialize the element with the starting value
render(value);
function updateTimer() {
value += increment;
loopCount++;
render(value);
if (typeof(settings.onUpdate) == 'function') {
settings.onUpdate.call(self, value);
}
if (loopCount >= loops) {
// remove the interval
$self.removeData('countTo');
clearInterval(data.interval);
value = settings.to;
if (typeof(settings.onComplete) == 'function') {
settings.onComplete.call(self, value);
}
}
}
function render(value) {
var formattedValue = settings.formatter.call(self, value, settings);
$self.text(formattedValue);
}
});
};
$.fn.countTo.defaults = {
from: 0, // the number the element should start at
to: 0, // the number the element should end at
speed: 1000, // how long it should take to count between the target numbers
refreshInterval: 100, // how often the element should be updated
decimals: 0, // the number of decimal places to show
formatter: formatter, // handler for formatting the value before rendering
onUpdate: null, // callback method for every time the element is updated
onComplete: null // callback method for when the element finishes updating
};
function formatter(value, settings) {
return value.toFixed(settings.decimals);
}
}(jQuery));
+150
View File
@@ -0,0 +1,150 @@
/*
* jQuery.appear
* https://github.com/bas2k/jquery.appear/
* http://code.google.com/p/jquery-appear/
*
* Copyright (c) 2009 Michael Hixson
* Copyright (c) 2012 Alexander Brovikov
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*/
(function($) {
$.fn.appear = function(fn, options) {
var settings = $.extend({
//arbitrary data to pass to fn
data: undefined,
//call fn only on the first appear?
one: true,
// X & Y accuracy
accX: 0,
accY: 0
}, options);
return this.each(function() {
var t = $(this);
//whether the element is currently visible
t.appeared = false;
if (!fn) {
//trigger the custom event
t.trigger('appear', settings.data);
return;
}
var w = $(window);
//fires the appear event when appropriate
var check = function() {
//is the element hidden?
if (!t.is(':visible')) {
//it became hidden
t.appeared = false;
return;
}
//is the element inside the visible window?
var a = w.scrollLeft();
var b = w.scrollTop();
var o = t.offset();
var x = o.left;
var y = o.top;
var ax = settings.accX;
var ay = settings.accY;
var th = t.height();
var wh = w.height();
var tw = t.width();
var ww = w.width();
if (y + th + ay >= b &&
y <= b + wh + ay &&
x + tw + ax >= a &&
x <= a + ww + ax) {
//trigger the custom event
if (!t.appeared) t.trigger('appear', settings.data);
} else {
//it scrolled out of view
t.appeared = false;
}
};
//create a modified fn with some additional logic
var modifiedFn = function() {
//mark the element as visible
t.appeared = true;
//is this supposed to happen only once?
if (settings.one) {
//remove the check
w.unbind('scroll', check);
var i = $.inArray(check, $.fn.appear.checks);
if (i >= 0) $.fn.appear.checks.splice(i, 1);
}
//trigger the original fn
fn.apply(this, arguments);
};
//bind the modified fn to the element
if (settings.one) t.one('appear', settings.data, modifiedFn);
else t.bind('appear', settings.data, modifiedFn);
//check whenever the window scrolls
w.scroll(check);
//check whenever the dom changes
$.fn.appear.checks.push(check);
//check now
(check)();
});
};
//keep a queue of appearance checks
$.extend($.fn.appear, {
checks: [],
timeout: null,
//process the queue
checkAll: function() {
var length = $.fn.appear.checks.length;
if (length > 0) while (length--) ($.fn.appear.checks[length])();
},
//check the queue asynchronously
run: function() {
if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
$.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20);
}
});
//run checks when these methods are called
$.each(['append', 'prepend', 'after', 'before', 'attr',
'removeAttr', 'addClass', 'removeClass', 'toggleClass',
'remove', 'css', 'show', 'hide'], function(i, n) {
var old = $.fn[n];
if (old) {
$.fn[n] = function() {
var r = old.apply(this, arguments);
$.fn.appear.run();
return r;
}
}
});
})(jQuery);
+258
View File
@@ -0,0 +1,258 @@
// The MIT License (MIT)
// Copyright (c) 2015 BG Stock - html5backgroundvideos.com
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
(function($) {
// Add js class to html
$('html').addClass('js');
// Add IE8 shim for Date.now()
if (!Date.now) {
Date.now = function() { return new Date().getTime(); }
}
// Return current time in seconds
function currentTime() {
return Math.floor(Date.now() / 1000);
}
// The plugin
$.fn.bgVideo = function( options ) {
// @bool iOS
var iOS = /iPad|iPhone|iPod/.test(navigator.platform) || /iPad|iPhone|iPod/.test(navigator.userAgent);
// Settings
var settings = $.extend({}, $.fn.bgVideo.defaults, options );
// Do the things
return this.each(function() {
// Set some handy variables
var $video = $(this); // jQuery Object
var video = $video[0]; // DOM node
var poster = $video.attr('poster') || '';
var $container = $video.parent();
var $pauseplay = $('<button class="jquery-background-video-pauseplay pause"><span>Pause</span></button>');
var start_time; // We'll set this when it starts playing
// Check for any data attributes that will override the settings for this particular element
var el_settings = $.extend({}, settings);
var data_attrs = $video.data();
$.each( data_attrs, function( data_name, data_val ) {
if( data_name.indexOf('bgvideo') === 0 ) {
// It's a match! Strip the bgvideo prefix and lowercase the first letter
data_name = data_name.replace('bgvideo', '');
data_name = data_name.charAt(0).toLowerCase() + data_name.slice(1);
// Then set the setting
el_settings[data_name] = data_val;
}
});
// Attach to playing event
$video.on('playing', function(){
if(start_time == null){
start_time = currentTime();
}
$video.addClass('is-playing is-visible');
$pauseplay.removeClass('play').addClass('pause').find('span').text('Pause');
$.fn.bgVideo.fitVideo( $video );
});
// If the video is already playing before js loads
if( video.currentTime > 0 ) {
$video.addClass('is-playing is-visible');
}
// Attach to pause event
$video.on('pause', function(){
$video.removeClass('is-playing');
$pauseplay.removeClass('pause').addClass('play').find('span').text('Play');
if(el_settings.fadeOnPause) {
$video.removeClass('is-visible');
}
});
// Set default styles
$container.css({
'position': 'relative',
'overflow': 'hidden',
'background-size': 'cover',
'background-position': 'center center',
'background-repeat': 'no-repeat',
'background-image': 'url(' + poster + ')'
});
$video.css({
'min-width': 'auto',
'min-height': 'auto',
'width': '100%',
'height': 'auto',
'position': 'absolute',
'left': '50%',
'top': '50%',
'transform': 'translate(-50%,-50%)'
});
if( el_settings.fullScreen ) {
$container.css({
'position': 'fixed',
'top': '0',
'bottom': '0',
'left': '0',
'right': '0',
'height': 'auto',
'margin': '0',
'z-index': '-1'
});
}
// Fade in video by setting the transition duration
$video.css('transition-duration', el_settings.fadeIn + 'ms');
// Remove on iOS
if( iOS ) {
// Unset sources to prevent them from continuing to download
$video.attr('src', '');
$video.find('source').attr('src', '');
$video.remove();
}
// Mimic background-size: cover with video element
$.fn.bgVideo.fitVideo( $video );
$(window).resize(function(){
$.fn.bgVideo.fitVideo( $video );
});
// Pause after X seconds
el_settings.pauseAfter = parseInt( el_settings.pauseAfter, 10 );
if( el_settings.pauseAfter > 0 ) {
$video.on('timeupdate', function(){
var now = currentTime();
if( now > start_time + el_settings.pauseAfter ) {
video.pause();
if( el_settings.fadeOnEnd ) {
$video.removeClass('is-visible');
}
}
});
}
// Play / pause button
if( el_settings.showPausePlay && !iOS ) {
// Append pauseplay element created earlier
$container.append($pauseplay);
// Position element
$pauseplay.css({
'left': 'auto',
'right': 'auto',
'top': 'auto',
'bottom': 'auto'
});
$pauseplay.css(el_settings.pausePlayXPos, el_settings.pausePlayXOffset);
$pauseplay.css(el_settings.pausePlayYPos, el_settings.pausePlayYOffset);
if( el_settings.pausePlayXPos === 'center' ) {
$pauseplay.css({
'left': '50%',
'margin-left': '-10px'
});
}
if( el_settings.pausePlayYPos === 'center' ) {
$pauseplay.css({
'top': '50%',
'margin-top': '-10px'
});
}
// Add functionality
$pauseplay.on('click', function(){
if(video.paused) {
video.play();
start_time = currentTime();
} else {
video.pause();
}
});
}
});
};
// Default settings
$.fn.bgVideo.defaults = {
fullScreen: false, // Sets the video to be fixed to the full window
fadeIn: 500, // Milliseconds to fade video in/out (0 for no fade)
pauseAfter: 120, // Seconds to play before pausing (0 for forever)
fadeOnPause: false, // For all (including manual) pauses
fadeOnEnd: true, // When we've reached the pauseAfter time
showPausePlay: true, // Show pause/play button
pausePlayXPos: 'right', // left|right|center
pausePlayYPos: 'top', // top|bottom|center
pausePlayXOffset: '15px', // pixels or percent from side - ignored if positioned center
pausePlayYOffset: '15px' // pixels or percent from top/bottom - ignored if positioned center
};
// Fit video
$.fn.bgVideo.fitVideo = function( $video ) {
var $container = $video.parent(),
container_height = $container.outerHeight(),
container_width = $container.outerWidth();
// Do this again every time the screen size changes
$video.css({
'height': 'auto',
'width': container_width + 'px'
});
var video_height = $video.height();
if( container_height > video_height ) {
//console.log('Container height > video height');
$video.css({
'height': container_height + 'px',
'width': 'auto'
});
}
};
// Auto run based on data attributes
$(document).ready(function(){
$('[data-bgvideo]').bgVideo();
});
}(jQuery));
+13
View File
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
+12
View File
@@ -0,0 +1,12 @@
/*
* jquery-match-height 0.7.2 by @liabru
* http://brm.io/jquery-match-height/
* License MIT
*/
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=-1,o=-1,n=function(t){return parseFloat(t)||0},a=function(e){var o=1,a=t(e),i=null,r=[];return a.each(function(){var e=t(this),a=e.offset().top-n(e.css("margin-top")),s=r.length>0?r[r.length-1]:null;null===s?r.push(e):Math.floor(Math.abs(i-a))<=o?r[r.length-1]=s.add(e):r.push(e),i=a}),r},i=function(e){var o={
byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(o,e):("boolean"==typeof e?o.byRow=e:"remove"===e&&(o.remove=!0),o)},r=t.fn.matchHeight=function(e){var o=i(e);if(o.remove){var n=this;return this.css(o.property,""),t.each(r._groups,function(t,e){e.elements=e.elements.not(n)}),this}return this.length<=1&&!o.target?this:(r._groups.push({elements:this,options:o}),r._apply(this,o),this)};r.version="0.7.2",r._groups=[],r._throttle=80,r._maintainScroll=!1,r._beforeUpdate=null,
r._afterUpdate=null,r._rows=a,r._parse=n,r._parseOptions=i,r._apply=function(e,o){var s=i(o),h=t(e),l=[h],c=t(window).scrollTop(),p=t("html").outerHeight(!0),u=h.parents().filter(":hidden");return u.each(function(){var e=t(this);e.data("style-cache",e.attr("style"))}),u.css("display","block"),s.byRow&&!s.target&&(h.each(function(){var e=t(this),o=e.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block"),e.data("style-cache",e.attr("style")),e.css({display:o,"padding-top":"0",
"padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=a(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var a=t(o),i=0;if(s.target)i=s.target.outerHeight(!1);else{if(s.byRow&&a.length<=1)return void a.css(s.property,"");a.each(function(){var e=t(this),o=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var a={
display:n};a[s.property]="",e.css(a),e.outerHeight(!1)>i&&(i=e.outerHeight(!1)),o?e.attr("style",o):e.css("display","")})}a.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),o+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(s.property,i-o+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)),
this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),n=o.attr("data-mh")||o.attr("data-match-height");n in e?e[n]=e[n].add(o):e[n]=o}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(n,a){if(a&&"resize"===a.type){var i=t(window).width();if(i===e)return;e=i;
}n?o===-1&&(o=setTimeout(function(){s(a),o=-1},r._throttle)):s(a)},t(r._applyDataApi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})});
File diff suppressed because one or more lines are too long
+164
View File
@@ -0,0 +1,164 @@
/**
* jQuery simple Ticker plugin
*
* Copyright (c) 2012 miraoto
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* ticker plugin
*
* @name $.simpleTiecker();
* @cat Plugins/Preload
* @author miraoto
*
* @example $.simpleTiecker();
* @desc default setting
*/
(function($) {
$.simpleTicker =function(element, options) {
var defaults = {
speed : 1000,
delay : 3000,
easing : 'swing',
effectType : 'slide'
}
var param = {
'ul' : '',
'li' : '',
'initList' : '',
'ulWidth' : '',
'liHeight' : '',
'tickerHook' : 'tickerHook',
'effect' : {}
}
var plugin = this;
plugin.settings = {}
var $element = $(element),
element = element;
plugin.init = function() {
plugin.settings = $.extend({}, defaults, options);
param.ul = element.children('ul');
param.li = element.find('li');
param.initList = element.find('li:first');
param.ulWidth = param.ul.width();
param.liHeight = param.li.height();
element.css({height:(param.liHeight)});
param.li.css({top:'0',left:'0',position:'absolute'});
//dispatch
switch (plugin.settings.effectType) {
case 'fade':
plugin.effect.fade();
break;
case 'roll':
plugin.effect.roll();
break;
case 'slide':
plugin.effect.slide();
break;
}
plugin.effect.exec();
}
plugin.effect = {};
plugin.effect.exec = function() {
param.initList.css(param.effect.init.css)
.animate(param.effect.init.animate,plugin.settings.speed,plugin.settings.easing)
.addClass(param.tickerHook);
if (element.find(param.li).length > 1) {
setInterval(function(){
element.find('.' + param.tickerHook)
.animate(param.effect.start.animate,plugin.settings.speed,plugin.settings.easing)
.next()
.css(param.effect.next.css)
.animate(param.effect.next.animate,plugin.settings.speed,plugin.settings.easing)
.addClass(param.tickerHook)
.end()
.appendTo(param.ul)
.css(param.effect.end.css)
.removeClass(param.tickerHook);
},plugin.settings.delay);
}
}
plugin.effect.fade = function() {
param.effect = {
'init' : {
'css' : {display:'block',opacity:'0'},
'animate' : {opacity:'1',zIndex:'98'}
},
'start' : {
'animate' : {opacity:'0'}
},
'next' : {
'css' : {display:'block',opacity:'0',zIndex:'99'},
'animate' : {opacity:'1'}
},
'end' : {
'css' : {display:'none',zIndex:'98'}
}
}
}
plugin.effect.roll = function() {
param.effect = {
'init' : {
'css' : {top:'3em',display:'block',opacity:'0'},
'animate' : {top:'0',opacity:'1',zIndex:'98'}
},
'start' : {
'animate' : {top:'-3em',opacity:'0'}
},
'next' : {
'css' : {top:'3em',display:'block',opacity:'0',zIndex:'99'},
'animate' : {top:'0',opacity:'1'}
},
'end' : {
'css' : {zIndex:'98'}
}
}
}
plugin.effect.slide = function() {
param.effect = {
'init' : {
'css' : {left:(200),display:'block',opacity:'0'},
'animate' : {left:'0',opacity:'1',zIndex:'98'}
},
'start' : {
'animate' : {left:(-(200)),opacity:'0'}
},
'next' : {
'css' : {left:(param.ulWidth),display:'block',opacity:'0',zIndex:'99'},
'animate' : {left:'0',opacity:'1'}
},
'end' : {
'css' : {zIndex:'98'}
}
}
}
plugin.init();
}
$.fn.simpleTicker = function(options) {
return this.each(function() {
if (undefined == $(this).data('simpleTicker')) {
var plugin = new $.simpleTiecker(this, options);
$(this).data('simpleTicker', plugin);
}
});
}
})(jQuery);
+7
View File
File diff suppressed because one or more lines are too long
+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( $ ){
$.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 ));
Vendored Executable
+9
View File
File diff suppressed because one or more lines are too long
Vendored Executable
+5
View File
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
+7
View File
@@ -0,0 +1,7 @@
/********************************************
* REVOLUTION 5.4.6.5 EXTENSION - KEN BURN
* @version: 1.3.1 (15.05.2017)
* @requires jquery.themepunch.revolution.js
* @author ThemePunch
*********************************************/
!function(a){"use strict";var b=jQuery.fn.revolution,c={alias:"KenBurns Min JS",name:"revolution.extensions.kenburn.min.js",min_core:"5.4",version:"1.3.1"};jQuery.extend(!0,b,{stopKenBurn:function(a){if("stop"===b.compare_version(c).check)return!1;void 0!=a.data("kbtl")&&a.data("kbtl").pause()},startKenBurn:function(a,d,e){if("stop"===b.compare_version(c).check)return!1;var f=a.data(),g=a.find(".defaultimg"),h=g.data("lazyload")||g.data("src"),j=(f.owidth,f.oheight,"carousel"===d.sliderType?d.carousel.slide_width:d.ul.width()),k=d.ul.height();if(a.data("kbtl")&&a.data("kbtl").kill(),e=e||0,0==a.find(".tp-kbimg").length){var m=g.data("mediafilter");m=void 0===m?"":m,a.append('<div class="tp-kbimg-wrap '+m+'" style="z-index:2;width:100%;height:100%;top:0px;left:0px;position:absolute;"><img class="tp-kbimg" src="'+h+'" style="position:absolute;" width="'+f.owidth+'" height="'+f.oheight+'"></div>'),a.data("kenburn",a.find(".tp-kbimg"))}var n=function(a,b,c,d,e,f,g){var h=a*c,i=b*c,j=Math.abs(d-h),k=Math.abs(e-i),l=new Object;return l.l=(0-f)*j,l.r=l.l+h,l.t=(0-g)*k,l.b=l.t+i,l.h=f,l.v=g,l},o=function(a,b,c,d,e){var f=a.bgposition.split(" ")||"center center",g="center"==f[0]?"50%":"left"==f[0]||"left"==f[1]?"0%":"right"==f[0]||"right"==f[1]?"100%":f[0],h="center"==f[1]?"50%":"top"==f[0]||"top"==f[1]?"0%":"bottom"==f[0]||"bottom"==f[1]?"100%":f[1];g=parseInt(g,0)/100||0,h=parseInt(h,0)/100||0;var i=new Object;return i.start=n(e.start.width,e.start.height,e.start.scale,b,c,g,h),i.end=n(e.start.width,e.start.height,e.end.scale,b,c,g,h),i},p=function(a,b,c){var d=c.scalestart/100,e=c.scaleend/100,f=void 0!=c.offsetstart?c.offsetstart.split(" ")||[0,0]:[0,0],g=void 0!=c.offsetend?c.offsetend.split(" ")||[0,0]:[0,0];c.bgposition="center center"==c.bgposition?"50% 50%":c.bgposition;var h=new Object,i=a*d,k=(c.owidth,c.oheight,a*e);c.owidth,c.oheight;if(h.start=new Object,h.starto=new Object,h.end=new Object,h.endo=new Object,h.start.width=a,h.start.height=h.start.width/c.owidth*c.oheight,h.start.height<b){var m=b/h.start.height;h.start.height=b,h.start.width=h.start.width*m}h.start.transformOrigin=c.bgposition,h.start.scale=d,h.end.scale=e,c.rotatestart=0===c.rotatestart?.01:c.rotatestart,h.start.rotation=c.rotatestart+"deg",h.end.rotation=c.rotateend+"deg";var n=o(c,a,b,f,h);f[0]=parseFloat(f[0])+n.start.l,g[0]=parseFloat(g[0])+n.end.l,f[1]=parseFloat(f[1])+n.start.t,g[1]=parseFloat(g[1])+n.end.t;var p=n.start.r-n.start.l,q=n.start.b-n.start.t,r=n.end.r-n.end.l,s=n.end.b-n.end.t;return f[0]=f[0]>0?0:p+f[0]<a?a-p:f[0],g[0]=g[0]>0?0:r+g[0]<a?a-r:g[0],f[1]=f[1]>0?0:q+f[1]<b?b-q:f[1],g[1]=g[1]>0?0:s+g[1]<b?b-s:g[1],h.starto.x=f[0]+"px",h.starto.y=f[1]+"px",h.endo.x=g[0]+"px",h.endo.y=g[1]+"px",h.end.ease=h.endo.ease=c.ease,h.end.force3D=h.endo.force3D=!0,h};void 0!=a.data("kbtl")&&(a.data("kbtl").kill(),a.removeData("kbtl"));var q=a.data("kenburn"),r=q.parent(),s=p(j,k,f),t=new punchgs.TimelineLite;if(t.pause(),s.start.transformOrigin="0% 0%",s.starto.transformOrigin="0% 0%",t.add(punchgs.TweenLite.fromTo(q,f.duration/1e3,s.start,s.end),0),t.add(punchgs.TweenLite.fromTo(r,f.duration/1e3,s.starto,s.endo),0),void 0!==f.blurstart&&void 0!==f.blurend&&(0!==f.blurstart||0!==f.blurend)){var u={a:f.blurstart},v={a:f.blurend,ease:s.endo.ease},w=new punchgs.TweenLite(u,f.duration/1e3,v);w.eventCallback("onUpdate",function(a){punchgs.TweenLite.set(a,{filter:"blur("+u.a+"px)",webkitFilter:"blur("+u.a+"px)"})},[r]),t.add(w,0)}t.progress(e),t.play(),a.data("kbtl",t)}})}(jQuery);
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
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
+29
View File
@@ -0,0 +1,29 @@
/*
* Title: Typewriter JS
* Descritpion: A native javascript plugin that can be used to create an elegent automatic typewriter animation effect on websites.
* Author: Tameem Safi
* Website: https://safi.me.uk
* Version: 1.0.0
*/
(function(){(function(){for(var a=0,c=["ms","moz","webkit","o"],b=0;b<c.length&&!window.requestAnimationFrame;++b)window.requestAnimationFrame=window[c[b]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[c[b]+"CancelAnimationFrame"]||window[c[b]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(c,b){var f=(new Date).getTime(),d=Math.max(0,16-(f-a)),e=window.setTimeout(function(){c(f+d)},d);a=f+d;return e});window.cancelAnimationFrame||(window.cancelAnimationFrame=
function(a){clearTimeout(a)})})();window.Typewriter=function(a,c){this._settings={cursorAnimationPaused:!1,opacityIncreasing:!1,currentOpacity:1,delayedQue:[],delayItemsCount:0,eventQue:[],calledEvents:[],eventRunning:!1,timeout:!1,delayExecution:!1,fps:.06,typingFrameCount:0,stringToTypeHTMLArray:[],currentTypedCharacters:[],typing:!1,usedIDs:[],charAmountToDelete:!1,userOptions:{},eventLoopRerun:0};if(!a)return console.error("Please choose an DOM element so that type writer can display itself.");
if("object"!==typeof c)return console.error("Typewriter only accepts the options as an object.");this._settings.userOptions=c;this.default_options={strings:!1,cursorClassName:"typewriter-cursor",cursor:"|",animateCursor:!0,blinkSpeed:50,typingSpeed:"natural",deleteSpeed:"natural",charSpanClassName:"typewriter-char",wrapperClassName:"typewriter-wrapper",loop:!1,autoStart:!1,devMode:!1};this.options=this._setupOptions(c);this.el=a;this._setupTypwriterWrapper();this._startCursorAnimation();!0===this.options.autoStart&&
this.options.strings&&this.typeOutAllStrings()};var b=window.Typewriter.prototype;b.stop=function(){this._addToEventQue(this._stopEventLoop);return this};b.start=function(){this._startEventLoop();return this};b.rerun=function(){this._addToEventQue(this._rerunCalledEvents);return this};b.typeString=function(a){if(!a||"string"!=typeof a)return console.error("Please enter a string as the paramater.");a=this._getCharacters(a);this._addToEventQue([this._typeCharacters,[a]]);return this};b.deleteAll=function(){this._addToEventQue([this._deleteChars,
["all"]]);return this};b.deleteChars=function(a){this._addToEventQue([this._deleteChars,[a]]);return this};b.pauseFor=function(a){this._addToEventQue([this._pauseFor,[a]]);return this};b.typeOutAllStrings=function(){var a=this._getStringsAsCharsArray();if(1===a.length)this._typeCharacters(a[0]);else for(var c=0,b=a.length;c<b;c++)this._addToEventQue([this._typeCharacters,[a[c]]]),this.pauseFor(this._randomInteger(1500,2500)),this.deleteAll(),this.pauseFor(this._randomInteger(1500,2500));return this};
b.changeSettings=function(a){if(!a&&"object"!==typeof a)return console.error("Typewriter will only accept an object as the settings.");this._addToEventQue([this._changeSettings,[JSON.stringify(a)]]);return this};b.changeBlinkSpeed=function(a){if(!a&&"number"!==typeof a)return console.error("Please enter a number for the new blink speed.");this.changeSettings({blinkSpeed:a});return this};b.changeTypingSpeed=function(a){if(!a&&"number"!==typeof a)return console.error("Please enter a number for the new typing speed.");
this.changeSettings({typingSpeed:a});return this};b.changeDeleteSpeed=function(a){if(!a&&"number"!==typeof a)return console.error("Please enter a number for the new delete speed.");this.changeSettings({changeDeleteSpeed:a});return this};b._rerunCalledEvents=function(){0<this._settings.currentTypedCharacters.length?(this.deleteAll(),this._resetEventLoop("rerunCalledEvents")):(this._settings.eventQue=this._settings.calledEvents,this._settings.calledEvents=[],this.options=this._setupOptions(this._settings.userOptions),
this._settings.usedIDs=[],this.charAmountToDelete=!1,this._startEventLoop())};b._deleteChars=function(a){a&&(this._settings.charAmountToDelete=a);this._deletingCharIdsAnimation=window.requestAnimationFrame(this._deletingCharAnimationFrame.bind(this));return this};b._pauseFor=function(a){var c=this;c._settings.eventRunning=!0;setTimeout(function(){c._resetEventLoop("pauseFor")},a)};b._changeSettings=function(a){this.options=this._setupOptions(JSON.parse(a[0]));this._resetEventLoop("changeSettings");
this.options.devMode&&console.log("New settings",this.options)};b._deletingCharAnimationFrame=function(){var a=this,c=this.options.deleteSpeed,b=a.options.wrapperClassName,d=a._settings.currentTypedCharacters,e=a._settings.charAmountToDelete;if(!a._settings.charAmountToDelete||0===a._settings.charAmountToDelete||0===d)return a._resetEventLoop("deletingCharAnimationFrame"),!0;"natural"==c&&(c=a._randomInteger(50,150));"all"==e&&(e=d.length,a._settings.charAmountToDelete=e);setTimeout(function(){if(a._settings.charAmountToDelete){var c=
d.length-1,f=d[c];a._settings.currentTypedCharacters.splice(c,1);if(c=document.getElementById(f))a.el.querySelector("."+b).removeChild(c),a._settings.charAmountToDelete=e-1,a.options.devMode&&console.log("Deleted char with ID",f)}a._deletingCharIdsAnimation=window.requestAnimationFrame(a._deletingCharAnimationFrame.bind(a))},c)};b._setupOptions=function(a){var c={},b;for(b in this.default_options)c[b]=this.default_options[b];if(this._settings.userOptions)for(b in this._settings.userOptions)c[b]=this._settings.userOptions[b];
for(b in a)c[b]=a[b];return c};b._addToEventQue=function(a){this._settings.eventQue.push(a);0<this._settings.eventQue.length&&!this._settings.eventRunning&&this.options.autoStart&&this._startEventLoop()};b._startEventLoop=function(){this.options.devMode&&console.log("Event loop started.");if(!this._settings.eventRunning){if(0<this._settings.eventQue.length){this.eventLoopRerun=0;var a=this._settings.eventQue[0];"function"==typeof a?(this._settings.eventRunning=!0,this._settings.calledEvents.push(a),
this._settings.eventQue.splice(0,1),a.call(this),this.options.devMode&&console.log("Event started.")):a instanceof Array&&"function"==typeof a[0]&&a[1]instanceof Array&&(this._settings.eventRunning=!0,this._settings.calledEvents.push(a),this._settings.eventQue.splice(0,1),a[0].call(this,a[1]),this.options.devMode&&console.log("Event started."))}this._eventQueAnimation=window.requestAnimationFrame(this._startEventLoop.bind(this))}if(!this._settings.eventRunning&&0>=this._settings.eventQue.length){var c=
this;c._stopEventLoop();setTimeout(function(){c.options.loop&&(c.eventLoopRerun++,c.options.devMode&&console.log("Before Loop State",c._settings),4<c.eventLoopRerun?(console.error("Maximum amount of loop retries reached."),c._stopEventLoop()):(c.options.devMode&&console.log("Looping events."),c._rerunCalledEvents()))},1E3)}};b._resetEventLoop=function(a){a=a||"Event";this._settings.eventRunning=!1;this._startEventLoop();this.options.devMode&&console.log(a,"Finished")};b._stopEventLoop=function(){window.cancelAnimationFrame(this._eventQueAnimation);
this.options.devMode&&console.log("Event loop stopped.")};b._setupTypwriterWrapper=function(){var a=this.options.wrapperClassName,c=document.createElement("span");c.className=a;this.el.innerHTML="";this.el.appendChild(c)};b._typeCharacters=function(a){this._settings.stringToTypeHTMLArray=this._convertCharsToHTML(a);this._typingAnimation=window.requestAnimationFrame(this._typingAnimationFrame.bind(this,a.length));return this};b._typingAnimationFrame=function(a){var c=this,b=this.options.typingSpeed,
d=c.options.wrapperClassName;if(0==c._settings.stringToTypeHTMLArray.length)return window.cancelAnimationFrame(c._typingAnimation),this._resetEventLoop("typingAnimationFrame"),!0;"natural"==b&&(b=this._randomInteger(50,150));setTimeout(function(){var b=c._settings.stringToTypeHTMLArray[0];c.el.querySelector("."+d).appendChild(b.el);c._settings.currentTypedCharacters.push(b.id);c._settings.stringToTypeHTMLArray.splice(0,1);c._typingAnimation=window.requestAnimationFrame(c._typingAnimationFrame.bind(c,
a));c.options.devMode&&console.log("Typed",b)},b)};b._convertCharsToHTML=function(a){var c=[],b=this.options.charSpanClassName;a=a[0];for(var d=0,e=a.length;d<e;d++){var g=document.createElement("span"),h=this._generateUniqueID();g.id=h;g.className=b+" typewriter-item-"+d;g.innerHTML=a[d];c.push({id:h,el:g})}return c};b._getCharacters=function(a){return"string"!==typeof a?!1:a.split("")};b._getStringsAsCharsArray=function(){var a="string"===typeof this.options.strings;if(!(this.options.strings instanceof
Array))return a?[this.options.strings.split("")]:console.error("Typewriter only accepts strings or an array of strings as the input.");for(var a=[],c=0,b=this.options.strings.length;c<b;c++){var d=this._getCharacters(this.options.strings[c]);if(!d){console.error("Please enter only strings.");break}a.push(d)}return a};b._cursorAnimationFrame=function(){if(!this._settings.cursorAnimationPaused){var a=.001*this.options.blinkSpeed,c=this.el.querySelector(".typewriter-cursor");1==this._settings.opacityIncreasing&&
(1<=this._settings.currentOpacity&&(this._settings.opacityIncreasing=!1,this._settings.currentOpacity=1),this._settings.currentOpacity+=a);0==this._settings.opacityIncreasing&&(0>=this._settings.currentOpacity&&(this._settings.opacityIncreasing=!0,this._settings.currentOpacity=0),this._settings.currentOpacity-=a);c.style.opacity=this._settings.currentOpacity;this._cursorAnimation=window.requestAnimationFrame(this._cursorAnimationFrame.bind(this))}};b._startCursorAnimation=function(){var a=this.options.cursor,
c=this.options.cursorClassName,b=document.createElement("span");b.className=c;b.innerHTML=a;this.el.appendChild(b);this.options.animateCursor&&(this._cursorAnimation=window.requestAnimationFrame(this._cursorAnimationFrame.bind(this)))};b._pauseCursorAnimation=function(){this._settings.cursorAnimationPaused||(window.cancelAnimationFrame(this._cursorAnimation),this._settings.cursorAnimationPaused=!0)};b._restartCursorAnimation=function(){if(!this._settings.cursorAnimationPaused)return console.error("Cursor animation is already running.");
this._settings.cursorAnimationPaused=!1;this._cursorAnimation=window.requestAnimationFrame(this._cursorAnimationFrame.bind(this))};b._randomInteger=function(a,b){return Math.floor(Math.random()*(b-a+1))+a};b._randomID=function(){for(var a="",b=0;b<this._randomInteger(5,15);b++)a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return a};b._generateUniqueID=function(){var a=this._randomID();return-1==this._settings.usedIDs.indexOf(a)?(this._settings.usedIDs.push(a),
a):this._generateUniqueID.call(this)}})();
Vendored Executable
+2
View File
File diff suppressed because one or more lines are too long