windhamdavid 5 years ago
parent
commit
9d5ffbe031
9 changed files with 101 additions and 188 deletions
  1. 2 2
      card.php
  2. 3 1
      functions.php
  3. 25 6
      gruntfile.js
  4. 11 20
      header.php
  5. 1 1
      inc/template.php
  6. 14 14
      js/init.js
  7. 1 1
      js/script.js
  8. 1 0
      package.json
  9. 43 143
      style.css

File diff suppressed because it is too large
+ 2 - 2
card.php


+ 3 - 1
functions.php

@@ -18,11 +18,13 @@ add_image_size( 'post-large', 770, 577, true );
 function dw_scripts() {
 	global $post;
 	wp_enqueue_style( 'style', get_stylesheet_uri() );
-	//wp_enqueue_style( 'style', get_template_directory_uri() . '/css/style.min.css');
+	//wp_enqueue_style( 'style-min', get_template_directory_uri() . '/css/style.min.css');
 	wp_enqueue_style( 'boot', get_template_directory_uri() . '/css/bootstrap.css');
 	wp_enqueue_style( 'jasny', get_template_directory_uri() . '/css/jasny-bootstrap.css');
+	
 	wp_deregister_script('jquery');
 	wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), false, true);
+	wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', 'jquery', '', true );
 	wp_enqueue_script( 'script', get_template_directory_uri() . '/js/script.js', 'jquery', '', true );
 	wp_enqueue_script( 'init', get_template_directory_uri() . '/js/init.js', 'jquery', '', true );
 	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {

+ 25 - 6
gruntfile.js

@@ -9,6 +9,7 @@ module.exports = function(grunt) {
 			  dest: 'css/grid.min.css'
 		  }
 		},
+		
 		cssmin: {
 		  combine: {
 		    files: {
@@ -16,22 +17,40 @@ module.exports = function(grunt) {
 		    }
 		  }
 		},
+		
 		concat: {
 			options: {
 				separator: ';',
 			},
 			dist: {
-				src: ['js/bootstrap.min.js', 'js/jasny-canvas.js'],
+				src: ['js/scripts.js', 'js/bootstrap.min.js', 'js/jasny-canvas.js'],
 				dest: 'js/script.js',
 			},
-		}
+		},
+		
+	    jshint: {
+	        options: {
+	          jshintrc: 'js/.jshintrc'
+	        },
+			all: ['js/init.js'],
+	    },
+		
+		uglify: {
+		    my_target: {
+		      files: {
+		        'js/script.min.js': ['js/script.js']
+		      }
+		    }
+		  }
+		  
 	});
 
-	grunt.loadNpmTasks('grunt-contrib-jshint');
 	grunt.loadNpmTasks('grunt-contrib-cssmin');
 	grunt.loadNpmTasks('grunt-contrib-concat');
-
-	grunt.registerTask('test', [ 'cssmin' ]);
-	grunt.registerTask('default', [ 'cssmin', 'concat' ]);
+	grunt.loadNpmTasks('grunt-contrib-jshint');
+	grunt.loadNpmTasks('grunt-contrib-uglify');
+	
+	grunt.registerTask('test', [ 'jshint' ]);
+	grunt.registerTask('default', [ 'cssmin', 'concat', 'uglify' ]);
 
 };

+ 11 - 20
header.php

@@ -15,29 +15,20 @@
 <?php wp_head(); ?>
 </head>
 <body>
-	<header id="header">	
-		<nav class="navbar navbar-fixed-top" role="navigation">
-			<div class="container">
-				<div class="navbar-header">
-		            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
-		              <span class="sr-only">Toggle navigation</span>
-		              <span class="icon-bar"></span>
-		              <span class="icon-bar"></span>
-		              <span class="icon-bar"></span>
-		            </button>
-				<div class="site-title">
-					<a href="http://davidawindham.com" title="David Windham"><img class="dw" title="David Windham" src="<?php echo get_bloginfo('template_directory');?>/img/dw.png" width="17"/></a>
-					<a href="<?php echo home_url( '/' ); ?>" class="navbar-brand navbar-right" title="David A. Windham" rel="home">David A. Windham</a>			
-				</div>
-				<a href="#" class="nav-toggle navbar-right" data-toggle="offcanvas" data-target=".navmenu" data-canvas="body"><span></span></a>
-			</div>		
-		</nav>
-	</header>
-		<aside class="navmenu navmenu-default navmenu-fixed-right offcanvas" role="complementary">
+<header id="header">	
+	<div class="navbar navbar-fixed-top" role="navigation">
+		<div class="site-title">
+			<a href="http://davidawindham.com" title="David Windham"><img class="dw" title="David Windham" src="<?php echo get_bloginfo('template_directory');?>/img/dw.png" width="17"/></a>
+			<a href="<?php echo home_url( '/' ); ?>" class="navbar-brand navbar-right" title="David A. Windham" rel="home">David A. Windham</a>			
+		</div>
+		<a href="#" class="nav-toggle navbar-right" data-toggle="offcanvas" data-target=".navmenu" data-canvas="body"><span></span></a>
+	</div>
+</header>
+		<nav class="navmenu navmenu-default navmenu-fixed-right offcanvas" role="complementary">
 			<ul class="nav bs-docs-sidenav">
 				<li><a href="bio">bio</a></li>
 				<li><a href="archive">archives</a></li>
 				<li><a href="contact">contact</a></li>
 			</ul>
-		</aside>
+		</nav>
 	<div class="container">

+ 1 - 1
inc/template.php

@@ -47,7 +47,7 @@ function dw_paging_nav() {
 	if ( $links ) :
 
 	?>
-	<nav class="navigation paging-navigation" role="navigation">
+	<nav class="navigation pagination paging-navigation" role="navigation">
 		<h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'dw' ); ?></h1>
 		<div class="pagination loop-pagination">
 			<?php echo $links; ?>

+ 14 - 14
js/init.js

@@ -1,17 +1,17 @@
 jQuery(document).ready(function($) {
 
-$( ".nav-toggle" ).on( "click", function() {
-	$( this ).toggleClass( "active" );
+$( '.nav-toggle' ).on( 'click', function() {
+	$( this ).toggleClass( 'active' );
 });
 	
 var headerHeight = $('.navbar').height();
 $(window).on('scroll', {
-    previousTop: 0
+	previousTop: 0
 },
 function() {
     var currentTop = $(window).scrollTop();
     if (currentTop < this.previousTop) {
-        if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
+        if (currentTop > 0 && !$('.navbar').hasClass('fixed')) {
             $('.navbar').addClass('visible');
         } else {
             $('.navbar').removeClass('visible fixed');
@@ -24,16 +24,16 @@ function() {
 });
 
 var commentsDiv = $('#comments');
-if (commentsDiv.length) {
-  $(commentsDiv).hide();
-  $('.toggle-comments').on('click', function(e) {
-    e.preventDefault();
-    $(commentsDiv).toggle('slow', function() {
-      var anchor = $('.toggle-comments');
-      var anchorText = anchor.text() == 'Hide Comments' ? 'Show Comments' : 'Hide Comments';
-      $(anchor).text(anchorText);
-    });
-  });
+	if (commentsDiv.length) {
+	$(commentsDiv).hide();
+	$('.toggle-comments').on('click', function(e) {
+		e.preventDefault();
+		$(commentsDiv).toggle('slow', function() {
+			var anchor = $('.toggle-comments');
+			var anchorText = anchor.text() === 'Hide Comments' ? 'Show Comments' : 'Hide Comments';
+			$(anchor).text(anchorText);
+		});
+	});
 }
 
 });

+ 1 - 1
js/script.js

@@ -1,4 +1,4 @@
-/*!
+;/*!
  * Bootstrap v3.2.0 (http://getbootstrap.com)
  * Copyright 2011-2014 Twitter, Inc.
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)

+ 1 - 0
package.json

@@ -4,6 +4,7 @@
   "devDependencies": {
     "grunt": "~0.4.5",
     "grunt-contrib-jshint": "~0.10.0",
+	"grunt-contrib-uglify": "~0.6.0",
 	"grunt-contrib-cssmin": "~0.10.0",
 	"grunt-contrib-concat": "~0.5.0"
   }

+ 43 - 143
style.css

@@ -28,6 +28,13 @@ a:focus {outline:thin dotted;}
 a img {border: 0;}
 .clear {clear: both;}
 
+
+/*===== Body =====*/
+
+body { background: rgba(242,242,242,.7) }
+body,input,textarea {color: #666;font-size: 12px;line-height: 18px;}
+
+
 /*====== Type ======*/
 
 body {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;font-size: 14px;line-height: 1.42857143;}
@@ -35,142 +42,23 @@ input,button,select,textarea {font-family: inherit;font-size: inherit;line-heigh
 .glyphicon  {
     font-size: 16px;
 }
-
+.container {
+	background: #fff;
+}
 
 /*===== Structure =====*/
 
-.wrap {
-  margin: 0 auto;
-  width: 100%;
-  background: #fff;
-}
-
 
 /*===== Layouts =====*/
 
 
 
-
-/*===== Body =====*/
-
-body { background: rgba(242,242,242,.7) }
-body,input,textarea {color: #666;font-size: 12px;line-height: 18px;}
-hr {background-color: #e7e7e7;border: 0;clear: both;height: 1px;margin-bottom: 18px;}
-p {
-	margin-bottom: 18px;
-	text-indent : 35px;
-}
-	p.noindent {
-	margin-bottom: 10px;
-	text-indent : 0px;
-}
-ul {
-	list-style: square;
-	margin: 0 0 18px 1.5em;
-}
-ol {
-	list-style: decimal;
-	margin: 0 0 18px 1.5em;
-}
-ol ol {
-	list-style: upper-alpha;
-}
-ol ol ol {
-	list-style: lower-roman;
-}
-ol ol ol ol {
-	list-style: lower-alpha;
-}
-ul ul,
-ol ol,
-ul ol,
-ol ul {
-	margin-bottom: 0;
-}
-dl {
-	margin: 0 0 24px 0;
-}
-dt {
-	font-weight: bold;
-}
-dd {
-	margin-bottom: 18px;
-}
-strong {
-	font-weight: bold;
-}
-cite,
-em,
-i {
-	font-style: italic;
-}
-big {
-	font-size: 131.25%;
-}
-ins {
-	background: #ffc;
-	text-decoration: none;
-}
-blockquote {
-	font-style: italic;
-	padding: 0 3em;
-}
-blockquote cite,
-blockquote em,
-blockquote i {
-	font-style: normal;
-}
-pre {
-	background: #f7f7f7;
-	color: #222;
-	line-height: 18px;
-	margin-bottom: 18px;
-	padding: 1.5em;
-}
-abbr,acronym {
-border-bottom: 1px dotted #666;
-	cursor: help;
-}
-sup,
-sub {
-	height: 0;
-	line-height: 1;
-	position: relative;
-	vertical-align: baseline;
-}
-sup {
-	bottom: 1ex;
-}
-sub {
-	top: .5ex;
-}
-input[type="text"],
-textarea {
-	background: #f9f9f9;
-	border: 1px solid #ccc;
-	box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
-	-moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
-	-webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1);
-	padding: 2px;
-}
-a:link {
-	color: #251a86;
-	text-decoration: none;
-}
-a:visited {
-	color: #251a86;
-	text-decoration: none;
-}
-a:active, a:hover { color: #757576; text-decoration: none;}
-
-
 /*===== Header =====*/
 
-#header {
-	padding: 50px 0 0 0;
-}
+
 .site-title {
-	float: left;
+	float: right;
+	padding: 15px 0;
 	font: 21px/27px "Courier New", Courier, mono;
 }
 .site-title a {
@@ -196,17 +84,6 @@ img.dw {
   background-color: rgba(237, 237, 237, 0.7);
 }
 
-.navbar-center
-{
-    position: absolute;
-    width: 100%;
-    left: 0;
-    top: 0;
-    text-align: center;
-    margin: auto;
-  height:100%;
-}
-
 .navbar {
   -webkit-transition: background-color 0.3s;
   -moz-transition: background-color 0.3s;
@@ -221,8 +98,8 @@ img.dw {
 }
 .navbar.fixed {
   position: fixed;
-  top: -61px;
-  background-color: rgba(255, 255, 255, 0.7);
+  top: -80px;
+  background-color: rgba(237, 237, 237, 0.7);
   border-bottom: 1px solid #f2f2f2;
   -webkit-transition: -webkit-transform 0.3s;
   -moz-transition: -moz-transform 0.3s;
@@ -238,7 +115,7 @@ img.dw {
 
 .navmenu,
 .navbar-offcanvas {
-  width: 200px;
+  width: 120px;
   height: auto;
   border-style: solid;
   border-width: 1px;
@@ -269,10 +146,9 @@ img.dw {
 
 .nav-toggle { 
 	padding: 15px 0;
-	padding: 10px 35px 16px 0px; 
-	float: right;
-	left: 10px;
-	top: 20px;
+	padding: 10px 35px 16px 0px;
+	left: 15px;
+	top: 25px;
 	cursor: pointer;
 	position: absolute; 
 }
@@ -318,6 +194,7 @@ img.dw {
 
 #content {
 	margin-bottom: 36px;
+	margin-top: 100px;
 }
 #content,
 #content input,
@@ -1106,3 +983,26 @@ p.cc {
 span.quiet {
 	display: none;
 }
+
+
+/*====== Grid =====*/
+/* Containers {768|750 992|970 1200|1170}*/
+
+@media (min-width: 768px) {
+	.site-title {
+		font-size: 25px;
+		font-family:"Courier New", Courier, mono;
+		padding: 15px 15px;
+	}
+  
+}
+
+@media (min-width: 992px) {
+
+  
+}
+
+@media (min-width: 1200px) {
+
+  
+}