windhamdavid 10 years ago
parent
commit
045acf75a9
3 changed files with 76 additions and 38 deletions
  1. 8 8
      header-home.php
  2. 43 28
      js/init.js
  3. 25 2
      style.css

+ 8 - 8
header-home.php

@@ -15,19 +15,12 @@
 </head>
 <body>
 <?php get_template_part('loader') ?>
-<div class="modal fade bs-example-modal-lg terminal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
-    <div class="modal-content">
-      ...
-    </div>
-  </div>
-</div>
 <div class="intro collapse in" data-toggle="collapse" data-parent="body">
 	<div class="container-full">
 		<div class="container">
 			<div class="row">
 				<div class="col-lg-8 col-lg-offset-2 col-centered">
-					<div class="typed"></div>
+					<div class="welcome"></div>
 					<div class="screen-reader">
 						<h1>Hello,</h1>
 						<h3>Welcome to my little corner of the internet.</h3>		
@@ -38,6 +31,13 @@
 		</div>
 	</div>
 </div>
+<div class="modal fade bs-example-modal-lg terminal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
+  <div class="modal-dialog modal-lg">
+    <div class="modal-content">
+      <div class="welcome-back"></div>
+    </div>
+  </div>
+</div>
 <header id="header">
 	<div id="nav">
 		<div class="navbar navbar-fixed-top">

+ 43 - 28
js/init.js

@@ -2,36 +2,48 @@ new WOW().init();
 
 jQuery(document).ready(function($) {
 
-var COOKIE_NAME = 'windhamdavid-cookie';
-	$go = $.cookie(COOKIE_NAME);
-	if ($go == null) {
-		$.cookie(COOKIE_NAME, 'yum-cookies', { path: '/', expires: 6 });
+$(window).bind("load", function () {
+	$('#loader').fadeOut(700);
+});
 
+$(function cookieset(){	
+	var COOKIE = 'windhamdavid-cookie';
+	$go = $.cookie(COOKIE);
+	if ($go == null) {
+		$.cookie(COOKIE, 'yum-cookies', { expires: 7, path: '/', expires: 6 });	
+		$(".welcome").typed({
+			strings: ["Hey,", "Hello,\n^10Welcome to ^10my domain ^10...^10", "Hello, \nWelcome to my little corner of the internet. \n^10It's nice to ", "Hello, \nWelcome to my little corner of the internet. \nIt's very nice to have you here!^10\n"],
+			typeSpeed: -40,
+			backSpeed: -70,
+			startDelay: 0,
+			backDelay: 0,
+			loop: false,
+			loopCount: false,
+			attr: null,
+			callback: function(){
+			 	shift();
+			 }
+		});	
 	}
 	else {
+		$('.intro').collapse('hide');
+		$('.terminal').modal('show');
+		$(".welcome-back").typed({
+			strings: ["Hey...", "Welcome back..."],
+			typeSpeed: -40,
+			backSpeed: -70,
+			startDelay: 0,
+			backDelay: 0,
+			loop: false,
+			loopCount: false,
+			attr: null,
+			callback: function(){
+			 	shift();
+			 }
+		});	
 	}
-
-$(window).bind("load", function () {
-	$('#loader').fadeOut(100);
-	//$('.terminal').modal('show');
 });
-
-$(function(){
-  $(".typed").typed({
-    strings: ["Hey,", "Hello,\n^10Welcome to ^10my domain ^10...^10", "Hello, \nWelcome to my little corner of the internet. \n^10It's nice to ", "Hello, \nWelcome to my little corner of the internet. \nIt's very nice to have you here!^10\n"],
-	typeSpeed: -40,
-	backSpeed: -70,
-	startDelay: 0,
-	backDelay: 0,
-	loop: false,
-	loopCount: false,
-	attr: null,
-	callback: function(){
-	 	//shift();
-	 }
-  });
-});
-  
+	
 function shift(){
 	$('.leader').ScrollTo({
 	    duration: 1500,
@@ -41,12 +53,15 @@ function shift(){
 			thecollapse();
 		}
 	});
-}
+};
 
 function thecollapse(){
 	//$('.intro').collapse('hide')
-	//$('.terminal').modal('hide')
-}
+	$('.terminal').modal('hide')
+};
+
+
+
 
 $('#nav').affix({
 	offset: {top: $('.intro').height()-$('#nav').height()}

+ 25 - 2
style.css

@@ -455,14 +455,37 @@ h1.super {
 	background-size: cover;
 	color: #cecece;
 }
-.typed {
+.welcome {
 	padding: 10px;
 	max-width: 100%;
 	display: block;
 	white-space: pre;
 	font-size: 27px;
 }
-.typed:after {
+.welcome:after {
+  visibility: visible;
+  content: '';
+  background-color: #d4f8e3;
+  opacity: .5;
+  display: inline-block;
+  position: relative;
+  width: 0.5em;
+  height: 1em;
+  top: 5px;
+  margin-left: 0;
+  margin-bottom: 2px;
+	-webkit-animation: blink 1s 30;
+	-moz-animation: blink 1s 30;
+	animation: blink 1s 30;
+}
+.welcome-back {
+	padding: 10px;
+	max-width: 100%;
+	display: block;
+	white-space: pre;
+	font-size: 27px;
+}
+.welcome-back:after {
   visibility: visible;
   content: '';
   background-color: #d4f8e3;