Add blazy

This commit is contained in:
Jeremy Thomas 2017-08-02 09:01:38 +01:00
parent e98c98c6fd
commit 3b7f2e3e9b
29 changed files with 48 additions and 29 deletions

View File

@ -33,20 +33,17 @@
.expo
padding-bottom: 3rem
padding-top: 3rem
.website
margin-top: 3rem
&:nth-child(1),
&:nth-child(2)
margin-top: 0
.website-image
margin-bottom: 3rem
+widescreen
.websites
display: flex
flex-wrap: wrap
justify-content: space-between
.website
margin-top: 3rem
width: calc(50% - 3rem)
&:nth-child(1),
&:nth-child(2)
margin-top: 0
&.is-highlighted
width: 100%
width: 100%
.website-image
margin-bottom: 3rem

File diff suppressed because one or more lines are too long

View File

@ -100,13 +100,33 @@ websites:
<div class="websites">
{% for website in page.websites %}
{% assign imageName = website.name | slugify %}
{% assign imagePath = "/images/expo/" | prepend: site.url | append: imageName %}
<article class="website {% if website.highlighted %}is-highlighted{% endif %}">
<a class="website-image" href="{{ website.url }}" target="_blank">
<img
src="{{ site.url }}/images/expo/{{ website.name | slugify }}.jpg"
srcset="{{ site.url }}/images/expo/{{ website.name | slugify }}@2x.jpg 2x"
width="1344"
height="840">
{% if website.highlighted %}
{% assign size1x = "1344x840" %}
{% assign size2x = "2688x1680" %}
<img
class="b-lazy"
src="{{ site.url }}/images/placeholders/empty.png"
data-src="{{ imagePath }}-{{ size1x }}.jpg"
data-srcset="{{ imagePath }}-{{ size2x }}.jpg 2x,
{{ imagePath }}-{{ size1x }}.jpg 1x"
width="1344"
height="840">
{% else %}
{% assign size1x = "672x420" %}
{% assign size2x = "1344x840" %}
<img
class="b-lazy"
src="{{ site.url }}/images/placeholders/empty.png"
data-src="{{ imagePath }}-{{ size1x }}.jpg"
data-srcset="{{ imagePath }}-{{ size2x }}.jpg 2x,
{{ imagePath }}-{{ size1x }}.jpg 1x"
width="672"
height="420">
{% endif %}
<span class="website-overlay is-overlay"></span>
</a>
<h2 class="title is-5 website-name is-marginless">
@ -121,4 +141,11 @@ websites:
{{ embrace_expo }}
</div>
</main>
</main>
<script src="{{ site.url }}/vendor/blazy-1.8.2.min.js"></script>
<script type="text/javascript">
;(function() {
var bLazy = new Blazy();
})();
</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 KiB