summaryrefslogtreecommitdiff
path: root/themes/flog
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2016-10-23 19:03:43 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2016-10-23 19:03:43 +0200
commit464cce29a2e04e508a39cf9e68da4458d53873f8 (patch)
tree9d62f919b2f0a4572c50066772aec6c4b052c9a7 /themes/flog
parentd642e1328a70e9763379dd91f342dd499439c13d (diff)
downloadpragblog-464cce29a2e04e508a39cf9e68da4458d53873f8.tar.gz
pragblog-464cce29a2e04e508a39cf9e68da4458d53873f8.zip
load low-res images first
Diffstat (limited to 'themes/flog')
-rw-r--r--themes/flog/layouts/_default/single.html6
-rw-r--r--themes/flog/layouts/partials/footer.html7
-rw-r--r--themes/flog/layouts/partials/header.html3
-rw-r--r--themes/flog/layouts/partials/listing.html6
4 files changed, 15 insertions, 7 deletions
diff --git a/themes/flog/layouts/_default/single.html b/themes/flog/layouts/_default/single.html
index 44bdae9..bae38f8 100644
--- a/themes/flog/layouts/_default/single.html
+++ b/themes/flog/layouts/_default/single.html
@@ -4,7 +4,11 @@
<main role="main" class="container">
<article itemscope itemtype="http://schema.org/BlogPosting" class="section">
{{ if .Params.image }}
- <img src="/images/{{ .Params.image }}" style="width: 100%;">
+ <img class="jsonly" src="/images/min/{{ .Params.image }}" style="width: 100%;" onload="this.src = '/images/{{ .Params.image }}'">
+ <noscript>
+ <img src="/images/{{ .Params.image }}" style="width: 100%;">
+ <style>.jsonly { display: none }</style>
+ </noscript>
{{ end }}
<h1 itemprop="headline" class="header">{{ .Title }}</h1>
<span><time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time></span>
diff --git a/themes/flog/layouts/partials/footer.html b/themes/flog/layouts/partials/footer.html
index 6a2857e..0dcd9e1 100644
--- a/themes/flog/layouts/partials/footer.html
+++ b/themes/flog/layouts/partials/footer.html
@@ -17,9 +17,10 @@
$('.button-collapse').sideNav();
$('#main').smoothState({ prefetch: true, onAfter: ready });
});
-
- $(document).ready(function() {
- $('.parallax').parallax();
+ $('body').imagesLoaded({ background: true }, function() {
+ $('<img src="/images/skyline.jpg">').load(function() {
+ $('body').css('background-image', 'url(' + this.src + ')');
+ });
});
</script>
</body>
diff --git a/themes/flog/layouts/partials/header.html b/themes/flog/layouts/partials/header.html
index 07fdd3d..8016f53 100644
--- a/themes/flog/layouts/partials/header.html
+++ b/themes/flog/layouts/partials/header.html
@@ -9,8 +9,7 @@
<link rel="alternate" href="/index.xml" type="application/rss+xml" title="{{ .Site.Title }}">
<title>{{ .Title }}{{ if not .IsHome }} - {{ .Site.Title }}{{ end }}</title>
</head>
- <body style="background: url(/images/skyline.jpg); background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover;">
- <body>
+ <body style="background-image: url(/images/min/skyline.jpg); background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover;">
<div id="main">
<header class="navbar-fixed">
<nav class="black">
diff --git a/themes/flog/layouts/partials/listing.html b/themes/flog/layouts/partials/listing.html
index a893211..a5556b6 100644
--- a/themes/flog/layouts/partials/listing.html
+++ b/themes/flog/layouts/partials/listing.html
@@ -11,7 +11,11 @@
<div class="card">
{{ if .Params.image }}
<div class="card-image">
- <a href="{{ .RelPermalink }}"><img src="/images/{{ .Params.image }}"></a>
+ <a class="jsonly" href="{{ .RelPermalink }}"><img src="/images/min/{{ .Params.image }}" onload="this.src = '/images/{{ .Params.image }}'"></a>
+ <noscript>
+ <a href="{{ .RelPermalink }}"><img src="/images/{{ .Params.image }}"></a>
+ <style>.jsonly { display: none }</style>
+ </noscript>
</div>
{{ end }}
<section class="card-content" itemprop="text">