windhamdavid 10 years ago
parent
commit
2cb0d33ef2
4 changed files with 156 additions and 11 deletions
  1. 5 10
      js/init.js
  2. 151 1
      js/script.js
  3. 0 0
      js/script.min.js
  4. 0 0
      style.min.css

+ 5 - 10
js/init.js

@@ -91,7 +91,7 @@ function dw_collapse() {
 			}
 			newline();
 			self.on('keydown', '[contenteditable]', function(evt){
-				if (evt.keyCode == 13){
+				if (evt.keyCode === 13){
 					$(this).removeAttr('contenteditable'); // IE needs special handling which jQuery provides
 					effect.call($('<p class=response>').appendTo(self),handler(this.textContent || this.innerText));
 					newline();
@@ -119,13 +119,9 @@ function dw_terminal(){
 		},100);
 	}
 	$('.thermo').cli(function(text){
-		if (/good/i.test(text)) {
-			return "Very" +text;
-			$('.terminal').modal('hide');
-		};
 		if (/exit/i.test(text)) {
 			$('.terminal').modal('hide');
-		};
+		}
 		if (/help/i.test(text)) return "I need somebody. Type 'exit' to close";
 		if (/hello/i.test(text)) return "Hello to you!";
 		if (/what/i.test(text)) return "This is a website silly human";
@@ -187,7 +183,6 @@ $(function dw_hidenav() {
 ==============================================*/
 
 $('.carousel').carousel({
-	interval: 4200,
 	interval: false
 });
 
@@ -206,11 +201,11 @@ $('.caro').carousel({
 });
 
 $(document).bind('keyup', function(e) {
-    if(e.which == 39){
+    if(e.which === 39){
 		//$('#caro-lead').carousel('next');
 		$('#caro').carousel('next');
     }
-    else if(e.which == 37){
+    else if(e.which === 37){
 		//$('#caro-lead').carousel('prev');
 		$('#caro').carousel('prev');
     }
@@ -220,7 +215,7 @@ $(document).bind('keyup', function(e) {
 		      SVG Animate
 ==============================================*/
 (function() {
-	var myAnimation = new DrawFillSVG({elementId: "sv"});
+	var myAnimation = new DrawFillSVG({elementId: 'sv'});
 })();
 
 

+ 151 - 1
js/script.js

@@ -489,7 +489,157 @@ date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},da
 (function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery);
 (function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a,
 b,d){return this.bind(b,function(e){var f=c(e.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery);
-;// ------------- JQUERY TYPED.JS -------------------------------------------- //
+;// ------------- DRAW FILL SVG ---------------------------------------------- //
+// ============ https://github.com/callmenick/Draw-Fill-SVG ================= //
+// -------------------------------------------------------------------------- //
+
+(function( window ){
+
+  'use strict';
+
+  /**
+   * Cross browser transition end events
+   *
+   * Use modernizr to detect cross browser transition end events. Make sure
+   * to include Modernizr in your doc and have "Modernizr.prefixed()" checked
+   * off in the extensibility section.
+   */
+
+  var transEndEventNames = {
+    "WebkitTransition" : "webkitTransitionEnd",
+    "MozTransition"    : "transitionend",
+    "OTransition"      : "oTransitionEnd",
+    "msTransition"     : "MSTransitionEnd",
+    "transition"       : "transitionend"
+  },
+  transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
+
+  /**
+   * Extend obj function
+   *
+   */
+
+  function extend( a, b ) {
+    for( var key in b ) { 
+      if( b.hasOwnProperty( key ) ) {
+        a[key] = b[key];
+      }
+    }
+    return a;
+  }
+
+  /**
+   * DrawFillSVG constructor
+   *
+   */
+
+  function DrawFillSVG( options ) {
+    this.options = extend( {}, this.options );
+    extend( this.options, options );
+    this._init();
+  }
+
+  /**
+   * DrawFillSVG options
+   *
+   * Available options:
+   * elementId - the ID of the element to draw
+   */
+
+  DrawFillSVG.prototype.options = {
+    elementId : "svg"
+  }
+
+  /**
+   * DrawFillSVG _init
+   *
+   * Initialise DrawFillSVG
+   */
+
+  DrawFillSVG.prototype._init = function() {
+    this.svg = document.getElementById(this.options.elementId);
+    this.paths = this.svg.querySelectorAll("path");
+    this._initAnimation();
+  }
+
+  /**
+   * DrawFillSVG _initAnimation()
+   *
+   * Reset some style properties on our paths, add some transitions, set the
+   * stroke-dasharray to the length of the path, and the stroke-dashoffset to
+   * the length of the path pushing it out of view initially. Then, set the 
+   * stroke-dashoffset to 0, animating the strokes in a drawing manner. Then,
+   * run the path filler sequence.
+   */
+
+  DrawFillSVG.prototype._initAnimation = function() {
+    for ( var i = 0; i < this.paths.length; i++ ) {
+      var path = this.paths[i];
+      var length = path.getTotalLength();
+
+      // reset opacities
+      path.style.fillOpacity = 0;
+      path.style.strokeOpacity = 1;
+
+      // reset transitions
+      path.style.transition = path.style.WebkitTransition = "none";
+
+      // reset stroke dash array and stroke dash offset
+      path.style.strokeDasharray = length + " " + length;
+      path.style.strokeDashoffset = length;
+      path.getBoundingClientRect();
+
+      // apply new transitions
+      path.style.transition = path.style.WebkitTransition = "stroke-dashoffset 2s ease-in-out";
+
+      // go baby go
+      path.style.strokeDashoffset = 0;
+
+      // fill the path
+      this._fillPath( path );
+    }
+  }
+
+  /**
+   * DrawFillSVG _fillPath()
+   *
+   * Resets the transition props, then fills the path and fades out the stroke
+   * by updating the styles.
+   */
+
+  DrawFillSVG.prototype._fillPath = function( path ) {
+    path.addEventListener( transEndEventName, function() {
+      // reset transitions
+      path.style.transition = path.style.WebkitTransition = "none";
+      path.style.transition = path.style.WebkitTransition = "fill-opacity 1s ease-in-out, stroke-opacity 1s ease-in-out";
+
+      // edit props
+      path.style.fillOpacity = 1;
+      path.style.strokeOpacity = 0;
+    } );
+  }
+
+  /**
+   * DrawFillSVG replay
+   *
+   * A public function that allows you to replay the animation if you want. For
+   * example, click a button, and replay the animation.
+   */
+
+  DrawFillSVG.prototype.replay = function() {
+    this._initAnimation();
+  }
+
+  /**
+   * Add to global namespace
+   */
+
+  window.DrawFillSVG = DrawFillSVG;
+
+})( window );
+
+
+// ------------- JQUERY TYPED.JS -------------------------------------------- //
 // ============ https://github.com/mattboldt/typed.js/ ====================== //
 // -------------------------------------------------------------------------- //
 

File diff suppressed because it is too large
+ 0 - 0
js/script.min.js


File diff suppressed because it is too large
+ 0 - 0
style.min.css


Some files were not shown because too many files changed in this diff