|
@@ -1,6 +1,578 @@
|
|
|
-(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
|
-(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
|
-m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
|
-})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
|
-ga('create', 'UA-1906067-6', 'davidawindham.com');
|
|
|
-ga('send', 'pageview');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+!function($){
|
|
|
+
|
|
|
+ "use strict";
|
|
|
+
|
|
|
+ var Typed = function(el, options){
|
|
|
+
|
|
|
+
|
|
|
+ this.el = $(el);
|
|
|
+
|
|
|
+
|
|
|
+ this.options = $.extend({}, $.fn.typed.defaults, options);
|
|
|
+
|
|
|
+
|
|
|
+ this.baseText = this.el.text() || this.el.attr('placeholder') || '';
|
|
|
+
|
|
|
+
|
|
|
+ this.typeSpeed = this.options.typeSpeed;
|
|
|
+
|
|
|
+
|
|
|
+ this.startDelay = this.options.startDelay;
|
|
|
+
|
|
|
+
|
|
|
+ this.backSpeed = this.options.backSpeed;
|
|
|
+
|
|
|
+
|
|
|
+ this.backDelay = this.options.backDelay;
|
|
|
+
|
|
|
+
|
|
|
+ this.strings = this.options.strings;
|
|
|
+
|
|
|
+
|
|
|
+ this.strPos = 0;
|
|
|
+
|
|
|
+
|
|
|
+ this.arrayPos = 0;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.stopNum = 0;
|
|
|
+
|
|
|
+
|
|
|
+ this.loop = this.options.loop;
|
|
|
+ this.loopCount = this.options.loopCount;
|
|
|
+ this.curLoop = 0;
|
|
|
+
|
|
|
+
|
|
|
+ this.stop = false;
|
|
|
+
|
|
|
+
|
|
|
+ this.showCursor = this.isInput ? false : this.options.showCursor;
|
|
|
+
|
|
|
+
|
|
|
+ this.cursorChar = this.options.cursorChar;
|
|
|
+
|
|
|
+
|
|
|
+ this.isInput = this.el.is('input');
|
|
|
+ this.attr = this.options.attr || (this.isInput ? 'placeholder' : null);
|
|
|
+
|
|
|
+
|
|
|
+ this.build();
|
|
|
+ };
|
|
|
+
|
|
|
+ Typed.prototype = {
|
|
|
+
|
|
|
+ constructor: Typed
|
|
|
+
|
|
|
+ , init: function(){
|
|
|
+
|
|
|
+
|
|
|
+ var self = this;
|
|
|
+ self.timeout = setTimeout(function() {
|
|
|
+
|
|
|
+ self.typewrite(self.strings[self.arrayPos], self.strPos);
|
|
|
+ }, self.startDelay);
|
|
|
+ }
|
|
|
+
|
|
|
+ , build: function(){
|
|
|
+
|
|
|
+ if (this.showCursor === true){
|
|
|
+ this.cursor = $("<span class=\"typed-cursor\">" + this.cursorChar + "</span>");
|
|
|
+ this.el.after(this.cursor);
|
|
|
+ }
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ , typewrite: function(curString, curStrPos){
|
|
|
+
|
|
|
+ if(this.stop === true)
|
|
|
+ return;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var humanize = Math.round(Math.random() * (100 - 30)) + this.typeSpeed;
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ self.timeout = setTimeout(function() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var charPause = 0;
|
|
|
+ var substr = curString.substr(curStrPos);
|
|
|
+ if (substr.charAt(0) === '^') {
|
|
|
+ var skip = 1;
|
|
|
+ if(/^\^\d+/.test(substr)) {
|
|
|
+ substr = /\d+/.exec(substr)[0];
|
|
|
+ skip += substr.length;
|
|
|
+ charPause = parseInt(substr);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ curString = curString.substring(0,curStrPos)+curString.substring(curStrPos+skip);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ self.timeout = setTimeout(function() {
|
|
|
+ if(curStrPos === curString.length) {
|
|
|
+
|
|
|
+ self.options.onStringTyped(self.arrayPos);
|
|
|
+
|
|
|
+
|
|
|
+ if(self.arrayPos === self.strings.length-1) {
|
|
|
+
|
|
|
+ self.options.callback();
|
|
|
+
|
|
|
+ self.curLoop++;
|
|
|
+
|
|
|
+
|
|
|
+ if(self.loop === false || self.curLoop === self.loopCount)
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ self.timeout = setTimeout(function(){
|
|
|
+ self.backspace(curString, curStrPos);
|
|
|
+ }, self.backDelay);
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+ if(curStrPos === 0)
|
|
|
+ self.options.preStringTyped(self.arrayPos);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var nextString = self.baseText + curString.substr(0, curStrPos+1);
|
|
|
+ if (self.attr) {
|
|
|
+ self.el.attr(self.attr, nextString);
|
|
|
+ } else {
|
|
|
+ self.el.text(nextString);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ curStrPos++;
|
|
|
+
|
|
|
+ self.typewrite(curString, curStrPos);
|
|
|
+ }
|
|
|
+
|
|
|
+ }, charPause);
|
|
|
+
|
|
|
+
|
|
|
+ }, humanize);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ , backspace: function(curString, curStrPos){
|
|
|
+
|
|
|
+ if (this.stop === true) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var humanize = Math.round(Math.random() * (100 - 30)) + this.backSpeed;
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ self.timeout = setTimeout(function() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (self.arrayPos == 1) {
|
|
|
+ self.stopNum = 17;
|
|
|
+ self.backDelay = 500;
|
|
|
+ }
|
|
|
+ else if (self.arrayPos == 2) {
|
|
|
+ self.stopNum = 54;
|
|
|
+ }
|
|
|
+ else{self.stopNum = 0;}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var nextString = self.baseText + curString.substr(0, curStrPos);
|
|
|
+ if (self.attr) {
|
|
|
+ self.el.attr(self.attr, nextString);
|
|
|
+ } else {
|
|
|
+ self.el.text(nextString);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (curStrPos > self.stopNum){
|
|
|
+
|
|
|
+ curStrPos--;
|
|
|
+
|
|
|
+ self.backspace(curString, curStrPos);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ else if (curStrPos <= self.stopNum) {
|
|
|
+ self.arrayPos++;
|
|
|
+
|
|
|
+ if(self.arrayPos === self.strings.length) {
|
|
|
+ self.arrayPos = 0;
|
|
|
+ self.init();
|
|
|
+ } else
|
|
|
+ self.typewrite(self.strings[self.arrayPos], curStrPos);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }, humanize);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ , reset: function(){
|
|
|
+ var self = this;
|
|
|
+ clearInterval(self.timeout);
|
|
|
+ var id = this.el.attr('id');
|
|
|
+ this.el.after('<span id="' + id + '"/>')
|
|
|
+ this.el.remove();
|
|
|
+ this.cursor.remove();
|
|
|
+
|
|
|
+ self.options.resetCallback();
|
|
|
+ }
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ $.fn.typed = function (option) {
|
|
|
+ return this.each(function () {
|
|
|
+ var $this = $(this)
|
|
|
+ , data = $this.data('typed')
|
|
|
+ , options = typeof option == 'object' && option;
|
|
|
+ if (!data) $this.data('typed', (data = new Typed(this, options)));
|
|
|
+ if (typeof option == 'string') data[option]();
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ $.fn.typed.defaults = {
|
|
|
+ strings: ["These are the default values...", "You know what you should do?", "Use your own!", "Have a great day!"],
|
|
|
+
|
|
|
+ typeSpeed: 0,
|
|
|
+
|
|
|
+ startDelay: 0,
|
|
|
+
|
|
|
+ backSpeed: 0,
|
|
|
+
|
|
|
+ backDelay: 500,
|
|
|
+
|
|
|
+ loop: false,
|
|
|
+
|
|
|
+ loopCount: false,
|
|
|
+
|
|
|
+ showCursor: true,
|
|
|
+
|
|
|
+ cursorChar: "|",
|
|
|
+
|
|
|
+ attr: null,
|
|
|
+
|
|
|
+ callback: function() {},
|
|
|
+
|
|
|
+ preStringTyped: function() {},
|
|
|
+
|
|
|
+ onStringTyped: function() {},
|
|
|
+
|
|
|
+ resetCallback: function() {}
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+}(window.jQuery);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+(function (name, context, definition) {
|
|
|
+ if (typeof module != 'undefined' && module.exports) module.exports = definition();
|
|
|
+ else if (typeof define == 'function' && define.amd) define(definition);
|
|
|
+ else context[name] = definition();
|
|
|
+})('jquery-scrollto', this, function(){
|
|
|
+
|
|
|
+ var jQuery, $, ScrollTo;
|
|
|
+ jQuery = $ = window.jQuery || require('jquery');
|
|
|
+
|
|
|
+
|
|
|
+ $.propHooks.scrollTop = $.propHooks.scrollLeft = {
|
|
|
+ get: function(elem,prop) {
|
|
|
+ var result = null;
|
|
|
+ if ( elem.tagName === 'HTML' || elem.tagName === 'BODY' ) {
|
|
|
+ if ( prop === 'scrollLeft' ) {
|
|
|
+ result = window.scrollX;
|
|
|
+ } else if ( prop === 'scrollTop' ) {
|
|
|
+ result = window.scrollY;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ( result == null ) {
|
|
|
+ result = elem[prop];
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $.Tween.propHooks.scrollTop = $.Tween.propHooks.scrollLeft = {
|
|
|
+ get: function(tween) {
|
|
|
+ return $.propHooks.scrollTop.get(tween.elem, tween.prop);
|
|
|
+ },
|
|
|
+ set: function(tween) {
|
|
|
+
|
|
|
+ if ( tween.elem.tagName === 'HTML' || tween.elem.tagName === 'BODY' ) {
|
|
|
+
|
|
|
+ tween.options.bodyScrollLeft = (tween.options.bodyScrollLeft || window.scrollX);
|
|
|
+ tween.options.bodyScrollTop = (tween.options.bodyScrollTop || window.scrollY);
|
|
|
+
|
|
|
+
|
|
|
+ if ( tween.prop === 'scrollLeft' ) {
|
|
|
+ tween.options.bodyScrollLeft = Math.round(tween.now);
|
|
|
+ }
|
|
|
+ else if ( tween.prop === 'scrollTop' ) {
|
|
|
+ tween.options.bodyScrollTop = Math.round(tween.now);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ window.scrollTo(tween.options.bodyScrollLeft, tween.options.bodyScrollTop);
|
|
|
+ }
|
|
|
+
|
|
|
+ else if ( tween.elem.nodeType && tween.elem.parentNode ) {
|
|
|
+ tween.elem[ tween.prop ] = tween.now;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ ScrollTo = {
|
|
|
+
|
|
|
+ config: {
|
|
|
+ duration: 400,
|
|
|
+ easing: 'swing',
|
|
|
+ callback: undefined,
|
|
|
+ durationMode: 'each',
|
|
|
+ offsetTop: 0,
|
|
|
+ offsetLeft: 0
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ configure: function(options){
|
|
|
+
|
|
|
+ $.extend(ScrollTo.config, options||{});
|
|
|
+
|
|
|
+
|
|
|
+ return this;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ scroll: function(collections, config){
|
|
|
+
|
|
|
+ var collection, $container, container, $target, $inline, position, containerTagName,
|
|
|
+ containerScrollTop, containerScrollLeft,
|
|
|
+ containerScrollTopEnd, containerScrollLeftEnd,
|
|
|
+ startOffsetTop, targetOffsetTop, targetOffsetTopAdjusted,
|
|
|
+ startOffsetLeft, targetOffsetLeft, targetOffsetLeftAdjusted,
|
|
|
+ scrollOptions,
|
|
|
+ callback;
|
|
|
+
|
|
|
+
|
|
|
+ collection = collections.pop();
|
|
|
+ $container = collection.$container;
|
|
|
+ $target = collection.$target;
|
|
|
+ containerTagName = $container.prop('tagName');
|
|
|
+
|
|
|
+
|
|
|
+ $inline = $('<span/>').css({
|
|
|
+ 'position': 'absolute',
|
|
|
+ 'top': '0px',
|
|
|
+ 'left': '0px'
|
|
|
+ });
|
|
|
+ position = $container.css('position');
|
|
|
+
|
|
|
+
|
|
|
+ $container.css({position:'relative'});
|
|
|
+ $inline.appendTo($container);
|
|
|
+
|
|
|
+
|
|
|
+ startOffsetTop = $inline.offset().top;
|
|
|
+ targetOffsetTop = $target.offset().top;
|
|
|
+ targetOffsetTopAdjusted = targetOffsetTop - startOffsetTop - parseInt(config.offsetTop,10);
|
|
|
+
|
|
|
+
|
|
|
+ startOffsetLeft = $inline.offset().left;
|
|
|
+ targetOffsetLeft = $target.offset().left;
|
|
|
+ targetOffsetLeftAdjusted = targetOffsetLeft - startOffsetLeft - parseInt(config.offsetLeft,10);
|
|
|
+
|
|
|
+
|
|
|
+ containerScrollTop = $container.prop('scrollTop');
|
|
|
+ containerScrollLeft = $container.prop('scrollLeft');
|
|
|
+
|
|
|
+
|
|
|
+ $inline.remove();
|
|
|
+ $container.css({position:position});
|
|
|
+
|
|
|
+
|
|
|
+ scrollOptions = {};
|
|
|
+
|
|
|
+
|
|
|
+ callback = function(event){
|
|
|
+
|
|
|
+ if ( collections.length === 0 ) {
|
|
|
+
|
|
|
+ if ( typeof config.callback === 'function' ) {
|
|
|
+ config.callback();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+
|
|
|
+ ScrollTo.scroll(collections,config);
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ if ( config.onlyIfOutside ) {
|
|
|
+
|
|
|
+ containerScrollTopEnd = containerScrollTop + $container.height();
|
|
|
+ containerScrollLeftEnd = containerScrollLeft + $container.width();
|
|
|
+
|
|
|
+
|
|
|
+ if ( containerScrollTop < targetOffsetTopAdjusted && targetOffsetTopAdjusted < containerScrollTopEnd ) {
|
|
|
+ targetOffsetTopAdjusted = containerScrollTop;
|
|
|
+ }
|
|
|
+ if ( containerScrollLeft < targetOffsetLeftAdjusted && targetOffsetLeftAdjusted < containerScrollLeftEnd ) {
|
|
|
+ targetOffsetLeftAdjusted = containerScrollLeft;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ( targetOffsetTopAdjusted !== containerScrollTop ) {
|
|
|
+ scrollOptions.scrollTop = targetOffsetTopAdjusted;
|
|
|
+ }
|
|
|
+ if ( targetOffsetLeftAdjusted !== containerScrollLeft ) {
|
|
|
+ scrollOptions.scrollLeft = targetOffsetLeftAdjusted;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ( $container.prop('scrollHeight') === $container.width() ) {
|
|
|
+ delete scrollOptions.scrollTop;
|
|
|
+ }
|
|
|
+ if ( $container.prop('scrollWidth') === $container.width() ) {
|
|
|
+ delete scrollOptions.scrollLeft;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ( scrollOptions.scrollTop != null || scrollOptions.scrollLeft != null ) {
|
|
|
+ $container.animate(scrollOptions, {
|
|
|
+ duration: config.duration,
|
|
|
+ easing: config.easing,
|
|
|
+ complete: callback
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ fn: function(options){
|
|
|
+
|
|
|
+ var collections, config, $container, container;
|
|
|
+ collections = [];
|
|
|
+
|
|
|
+
|
|
|
+ var $target = $(this);
|
|
|
+ if ( $target.length === 0 ) {
|
|
|
+
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ config = $.extend({},ScrollTo.config,options);
|
|
|
+
|
|
|
+
|
|
|
+ $container = $target.parent();
|
|
|
+ container = $container.get(0);
|
|
|
+
|
|
|
+
|
|
|
+ while ( ($container.length === 1) && (container !== document.body) && (container !== document) ) {
|
|
|
+
|
|
|
+ var containerScrollTop, containerScrollLeft;
|
|
|
+ containerScrollTop = $container.css('overflow-y') !== 'visible' && container.scrollHeight !== container.clientHeight;
|
|
|
+ containerScrollLeft = $container.css('overflow-x') !== 'visible' && container.scrollWidth !== container.clientWidth;
|
|
|
+ if ( containerScrollTop || containerScrollLeft ) {
|
|
|
+
|
|
|
+ collections.push({
|
|
|
+ '$container': $container,
|
|
|
+ '$target': $target
|
|
|
+ });
|
|
|
+
|
|
|
+ $target = $container;
|
|
|
+ }
|
|
|
+
|
|
|
+ $container = $container.parent();
|
|
|
+ container = $container.get(0);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ collections.push({
|
|
|
+ '$container': $('html'),
|
|
|
+
|
|
|
+
|
|
|
+ '$target': $target
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ if ( config.durationMode === 'all' ) {
|
|
|
+ config.duration /= collections.length;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ScrollTo.scroll(collections,config);
|
|
|
+
|
|
|
+
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ $.ScrollTo = $.ScrollTo || ScrollTo;
|
|
|
+ $.fn.ScrollTo = $.fn.ScrollTo || ScrollTo.fn;
|
|
|
+
|
|
|
+
|
|
|
+ return ScrollTo;
|
|
|
+});
|