Browse Source

localstorage

windhamdavid 10 years ago
parent
commit
0f0c84acbe
3 changed files with 57 additions and 8 deletions
  1. 2 3
      header-home.php
  2. 18 3
      js/init.js
  3. 37 2
      style.css

+ 2 - 3
header-home.php

@@ -25,7 +25,7 @@
 					<h4>It's very nice to have you here!</h4>
 					<h4>It's very nice to have you here!</h4>
 				</div>
 				</div>
 				<div class="welcome"></div>
 				<div class="welcome"></div>
-				<div class="thermo"></div>
+				<div class="thermo-intro"></div>
 			</div>
 			</div>
 		</div>
 		</div>
 	</div>
 	</div>
@@ -45,9 +45,8 @@
 		<div class="navbar navbar-fixed-top">
 		<div class="navbar navbar-fixed-top">
 			<div class="container">
 			<div class="container">
 				<img class="navbar-brand" src="<?php echo get_bloginfo('template_directory');?>/img/daw.png" width="70" class="logo" alt="David Windham"/>
 				<img class="navbar-brand" src="<?php echo get_bloginfo('template_directory');?>/img/daw.png" width="70" class="logo" alt="David Windham"/>
-
 				<div class="site-title">
 				<div class="site-title">
-					<a href="#" class="navbar-brand navbar-right"  data-toggle="offcanvas" data-target=".navmenu" title="David A. Windham" rel="home">David A. Windham</a>			
+					<a href="#" class="navbar-brand navbar-right light"  data-toggle="offcanvas" data-target=".navmenu" title="David A. Windham" rel="home">David A. Windham</a>			
 				</div>
 				</div>
 			</div>
 			</div>
 		</div>
 		</div>

+ 18 - 3
js/init.js

@@ -18,7 +18,7 @@ $(function dw_set_cookie() {
 		$.cookie(COOKIE, 'yum-cookies', { expires: 7, path: '/'});
 		$.cookie(COOKIE, 'yum-cookies', { expires: 7, path: '/'});
 		$('.terminal-welcome').modal('show');	
 		$('.terminal-welcome').modal('show');	
 		$('.welcome').typed({
 		$('.welcome').typed({
-			strings: ['Hey,', 'Hello,\n^10Welcome to ^10my domain ^10...^10', 'Hello, \nWelcome to my little corner of the internet. \n^10It is nice to ', 'Hello, \nWelcome to my little corner of the internet. \nIt is very nice to have you here!^200\n'],
+			strings: ['Hey,', 'Hello,\n^10Welcome to ^10my domain ^10...^10', 'Hello, \nWelcome to my little corner of the internet. \n^10It is nice to ', 'Hello, \nWelcome to my little corner of the internet. \nWhat is your name?^200\n'],
 			typeSpeed: 30,
 			typeSpeed: 30,
 			backSpeed: 50,
 			backSpeed: 50,
 			startDelay: 0,
 			startDelay: 0,
@@ -27,15 +27,21 @@ $(function dw_set_cookie() {
 			loopCount: false,
 			loopCount: false,
 			attr: null,
 			attr: null,
 			callback: function(){
 			callback: function(){
-				dw_shift();
+				dw_terminal();
 			 }
 			 }
 		});
 		});
 		$('.first-slide').css('visibility','hidden');	
 		$('.first-slide').css('visibility','hidden');	
 	}
 	}
 	else {
 	else {
 		$('.terminal').modal('show');
 		$('.terminal').modal('show');
+		if (localStorage.getItem('person') === null) {
+			var person = 'anonymous person';
+		}
+		else {
+			var person = localStorage.getItem('person');
+		}
 		$('.welcome-back-text').typed({
 		$('.welcome-back-text').typed({
-			strings: ['...', 'Welcome back'],
+			strings: ['...', 'Welcome back ' +person],
 			typeSpeed: 30,
 			typeSpeed: 30,
 			backSpeed: 50,
 			backSpeed: 50,
 			startDelay: 0,
 			startDelay: 0,
@@ -110,6 +116,13 @@ function dw_terminal(){
 			}
 			}
 		},100);
 		},100);
 	}
 	}
+	$('.thermo-intro').cli(function(text){
+		if (text.length > 1) {
+			localStorage.setItem('person', text),
+			dw_shift();
+		};
+		return '';
+		}, null, type);
 	$('.thermo').cli(function(text){
 	$('.thermo').cli(function(text){
 		if (/exit/i.test(text)) {
 		if (/exit/i.test(text)) {
 			$('.terminal').modal('hide');
 			$('.terminal').modal('hide');
@@ -156,8 +169,10 @@ $(function dw_hidenav() {
 		if (currentTop < this.previousTop) {
 		if (currentTop < this.previousTop) {
 			if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
 			if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
 					$('.navbar').addClass('visible');
 					$('.navbar').addClass('visible');
+					$('.site-title a').removeClass('light');
 				} else {
 				} else {
 					$('.navbar').removeClass('visible fixed');
 					$('.navbar').removeClass('visible fixed');
+					$('.site-title a').addClass('light');
 				}
 				}
 		} 
 		} 
 		else {
 		else {

+ 37 - 2
style.css

@@ -138,7 +138,10 @@ input,button,select,textarea {
 	line-height: inherit;
 	line-height: inherit;
 }
 }
 .light {
 .light {
-	color:#fcfcfc;
+	color:#fcfcfc !important;
+}
+.darken {
+	color:#333
 }
 }
 .dim {
 .dim {
 	color: #737373;
 	color: #737373;
@@ -211,6 +214,16 @@ h1.super {
 
 
 }
 }
 
 
+@media print {
+  * {
+    color: #000 !important;
+    text-shadow: none !important;
+    background: transparent !important;
+    -webkit-box-shadow: none !important;
+            box-shadow: none !important;
+  }
+  
+}
 
 
 
 
 
 
@@ -532,6 +545,28 @@ h1.super {
 .thermo span.mee {
 .thermo span.mee {
 	color: #389436;
 	color: #389436;
 }
 }
+.thermo-intro span.prompt {
+	color: #389436;
+}
+.thermo-intro p.input {
+	line-height: 11px !important;
+	margin: 0px;
+}
+.thermo-intro p.response {
+	line-height: 11px !important;
+	margin: 0px;
+	color:#34F743;
+}
+.thermo-intro span.u {
+	color: #389436;
+}
+.thermo-intro span.at {
+	color: #38BBC6;
+}
+.thermo-intro span.mee {
+	color: #389436;
+}
+
 
 
 
 
 
 
@@ -822,7 +857,7 @@ ul.social li {
 	padding: 15px 0;
 	padding: 15px 0;
 }
 }
 .site-title a {
 .site-title a {
-	color: #000;
+	color: #333;
 	text-decoration: none;
 	text-decoration: none;
 }
 }
 img.dw {
 img.dw {