From 9bf1513d24b3cd0faea021c28109c2295b2dc863 Mon Sep 17 00:00:00 2001 From: Patrick Collins Date: Sun, 15 Oct 2017 19:21:01 -0400 Subject: Css animation patch (#64) * Fix image tags and adjust featured alt * Disable "is-loading" class. --- layouts/partials/img-path.html | 2 ++ layouts/partials/sidebar.html | 6 ++++-- layouts/post/featured.html | 4 +++- layouts/shortcodes/img-fit.html | 2 +- layouts/shortcodes/img-post.html | 6 +++--- static/js/main.js | 13 +++++++------ 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/layouts/partials/img-path.html b/layouts/partials/img-path.html index dabfa61..8f82671 100644 --- a/layouts/partials/img-path.html +++ b/layouts/partials/img-path.html @@ -10,6 +10,8 @@ otherwise use the explicit path provided by the user --> {{ $path := $.Scratch.Get "path" }} +{{ $alt := $.Scratch.Get "featuredalt" }} +{{ $img := $.Scratch.Get "featured" }} {{ $structType := $.Scratch.Get "structType" }} {{ if eq $path "title" }} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index d872e75..ae61b84 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -6,11 +6,11 @@ {{ $pic := .Site.Params.intro.pic }} {{ with $pic.src }} {{ if $pic.circle }} - {{ $pic.alt }} + {{ $pic.alt }} {{ else if $pic.imperfect }} {{ else }} - {{ $pic.alt }} + {{ $pic.alt }} {{ end }} {{ end }} {{ with .Site.Params.intro }} @@ -91,6 +91,7 @@ {{ end }} {{ range $key, $value := $.Scratch.Get "categories" }} +

{{ if ne $value.Name "" }} @@ -102,6 +103,7 @@ {{ end }}
+

{{ end }} {{ end }} diff --git a/layouts/post/featured.html b/layouts/post/featured.html index 7b7aa42..191c3aa 100644 --- a/layouts/post/featured.html +++ b/layouts/post/featured.html @@ -5,9 +5,11 @@ {{ $.Scratch.Set "structType" "page" }} {{ partial "img-path" . }} {{ $path := $.Scratch.Get "path" }} + {{ $alt := $.Scratch.Get "alt" }} + {{ $img := $.Scratch.Get "img" }} - {{ .Params.featuredalt }} + {{ $alt }} {{ end }} {{ end }} diff --git a/layouts/shortcodes/img-fit.html b/layouts/shortcodes/img-fit.html index 08e8224..91493c3 100644 --- a/layouts/shortcodes/img-fit.html +++ b/layouts/shortcodes/img-fit.html @@ -63,7 +63,7 @@ {{ else }} {{ if ne ($.Scratch.Get "imgFile") "" }} {{ . }} + alt="{{ . }}"> {{ end }} {{ $.Scratch.Set "count" 0 }} diff --git a/layouts/shortcodes/img-post.html b/layouts/shortcodes/img-post.html index 6143696..7eda2ad 100644 --- a/layouts/shortcodes/img-post.html +++ b/layouts/shortcodes/img-post.html @@ -54,15 +54,15 @@ {{ if eq $type "left" }} - {{ $alt }} + {{ $alt }} {{ else if eq $type "right" }} - {{ $alt }} + {{ $alt }} {{ else }}

- {{ $alt }} + {{ $alt }}

{{ end }} {{ end }} diff --git a/static/js/main.js b/static/js/main.js index 6da34cc..b0649f6 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -23,14 +23,15 @@ $sidebar = $('#sidebar'), $main = $('#main'); + // TODO: Fix this, or implement lazy load. // Disable animations/transitions until the page has loaded. - $body.addClass('is-loading'); + // $body.addClass('is-loading'); - $window.on('load', function() { - window.setTimeout(function() { - $body.removeClass('is-loading'); - }, 100); - }); + // $window.on('load', function() { + // window.setTimeout(function() { + // $body.removeClass('is-loading'); + // }, 100); + // }); // Fix: Placeholder polyfill. $('form').placeholder(); -- cgit v1.2.3