diff --git a/_includes/header.html b/_includes/header.html --- a/_includes/header.html +++ b/_includes/header.html @@ -1,76 +1,28 @@ - - -{% if page.bigimg or page.title %} - -{% if page.bigimg %} -
-{% endif %} - -
-{% if page.bigimg %} -
-
-
-
-
-

{% if page.title %}{{ page.title }}{% else %}
{% endif %}

- {% if page.subtitle %} - {% if include.type == "page" %} -
- {{ page.subtitle }} - {% else %} -

{{ page.subtitle }}

- {% endif %} - {% endif %} - - {% if include.type == "post" %} - - {% endif %} -
-
-
-
- -
-{% endif %} -
-
-
-
-
-

{% if page.title %}{{ page.title }}{% else %}
{% endif %}

- {% if page.subtitle %} - {% if include.type == "page" %} -
- {{ page.subtitle }} - {% else %} -

{{ page.subtitle }}

- {% endif %} - {% endif %} - - {% if include.type == "post" %} - - {% endif %} +{% if page.title %} +
+
+
+
+
+
+

{% if page.title %}{{ page.title }}{% else %}
{% endif %}

+ {% if page.subtitle %} + {% if include.type == "page" %} +
+ {{ page.subtitle }} + {% else %} +

{{ page.subtitle }}

+ {% endif %} + {% endif %} + {% if include.type == "post" %} + + {% endif %} +
+
-
-
-
- - + {% else %} -
+
{% endif %} diff --git a/css/main.css b/css/main.css --- a/css/main.css +++ b/css/main.css @@ -421,38 +421,9 @@ position: relative; pointer-events: none; } -.intro-header.big-img { - background: no-repeat center center; - -webkit-background-size: cover; - -moz-background-size: cover; - background-size: cover; - -o-background-size: cover; - margin-top: 51px; /* The small navbar is 50px tall + 1px border */ - margin-bottom: 35px; -} -.intro-header.big-img .big-img-transition { - position: absolute; - width: 100%; - height: 100%; - opacity: 0; - background: no-repeat center center; - -webkit-background-size: cover; - -moz-background-size: cover; - background-size: cover; - -o-background-size: cover; - -webkit-transition: opacity 1s linear; - -moz-transition: opacity 1s linear; - transition: opacity 1s linear; -} .intro-header .page-heading { text-align: center; } -.intro-header.big-img .page-heading, -.intro-header.big-img .post-heading { - padding: 100px 0; - color: #FFF; - text-shadow: 1px 1px 3px #000; -} .intro-header .page-heading h1 { margin-top: 0; font-size: 40px; @@ -473,43 +444,10 @@ .intro-header .post-heading .post-subheading { margin-bottom: 20px; } -.intro-header.big-img .page-heading .page-subheading, -.intro-header.big-img .post-heading .post-subheading { - font-weight: 400; -} -.intro-header.big-img .page-heading hr { - box-shadow: 1px 1px 3px #000; - -webkit-box-shadow: 1px 1px 3px #000; - -moz-box-shadow: 1px 1px 3px #000; -} -.intro-header.big-img .post-heading .post-meta { - color: #EEE; -} -.intro-header.big-img .img-desc { - background: rgba(30, 30, 30, 0.6); - position: absolute; - padding: 5px 10px; - font-size: 11px; - color: #EEE; - font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - right: 0; - bottom: 0; - display: none; -} @media only screen and (min-width: 768px) { .intro-header { margin-top: 130px; } - .intro-header.big-img { - margin-top: 91px; /* Full navbar is small navbar + 20px padding on each side when expanded */ - } - .intro-header.big-img .page-heading, - .intro-header.big-img .post-heading { - padding: 150px 0; - } - .intro-header.big-img .img-desc { - font-size: 14px; - } } .header-section.has-img .no-img { @@ -527,22 +465,6 @@ .header-section.has-img .intro-header.no-img { display: block; } - .intro-header.big-img { - width: 100%; - height: 220px; - } - .intro-header.big-img .page-heading, - .intro-header.big-img .post-heading { - display: none; - } - .header-section.has-img .big-img { - margin-bottom: 0; - } -} -@media only screen and (max-width: 325px) { - .intro-header.big-img { - height: 200px; - } } .caption { diff --git a/js/main.js b/js/main.js --- a/js/main.js +++ b/js/main.js @@ -2,9 +2,6 @@ var main = { - bigImgEl : null, - numImgs : null, - init : function() { // Shorten the navbar after scrolling a little bit down $(window).scroll(function() { @@ -63,76 +60,8 @@ fakeMenu.remove(); } - - // show the big header image - main.initImgs(); - }, - - initImgs : function() { - // If the page was large images to randomly select from, choose an image - if ($("#header-big-imgs").length > 0) { - main.bigImgEl = $("#header-big-imgs"); - main.numImgs = main.bigImgEl.attr("data-num-img"); - - // 2fc73a3a967e97599c9763d05e564189 - // set an initial image - var imgInfo = main.getImgInfo(); - var src = imgInfo.src; - var desc = imgInfo.desc; - main.setImg(src, desc); - - // For better UX, prefetch the next image so that it will already be loaded when we want to show it - var getNextImg = function() { - var imgInfo = main.getImgInfo(); - var src = imgInfo.src; - var desc = imgInfo.desc; - - var prefetchImg = new Image(); - prefetchImg.src = src; - // if I want to do something once the image is ready: `prefetchImg.onload = function(){}` - - setTimeout(function(){ - var img = $("
").addClass("big-img-transition").css("background-image", 'url(' + src + ')'); - $(".intro-header.big-img").prepend(img); - setTimeout(function(){ img.css("opacity", "1"); }, 50); - - // after the animation of fading in the new image is done, prefetch the next one - //img.one("transitioned webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){ - setTimeout(function() { - main.setImg(src, desc); - img.remove(); - getNextImg(); - }, 1000); - //}); - }, 6000); - }; - - // If there are multiple images, cycle through them - if (main.numImgs > 1) { - getNextImg(); - } - } - }, - - getImgInfo : function() { - var randNum = Math.floor((Math.random() * main.numImgs) + 1); - var src = main.bigImgEl.attr("data-img-src-" + randNum); - var desc = main.bigImgEl.attr("data-img-desc-" + randNum); - - return { - src : src, - desc : desc - } }, - setImg : function(src, desc) { - $(".intro-header.big-img").css("background-image", 'url(' + src + ')'); - if (typeof desc !== typeof undefined && desc !== false) { - $(".img-desc").text(desc).show(); - } else { - $(".img-desc").hide(); - } - } }; // 2fc73a3a967e97599c9763d05e564189