-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
158 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ | |
{% include jsdelivr-combine.html urls=urls %} | ||
|
||
{% case page.layout %} | ||
{% when 'home', 'categories', 'post', 'page' %} | ||
{% when 'home', 'categories', 'post', 'page', 'lab_life' %} | ||
{% assign js = page.layout %} | ||
{% when 'archives', 'category', 'tag' %} | ||
{% assign js = 'misc' %} | ||
|
@@ -81,6 +81,11 @@ | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/masonry.pkgd.min.js" integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D" crossorigin="anonymous"></script> | ||
<script src="https://unpkg.com/imagesloaded@5/imagesloaded.pkgd.min.js"></script> | ||
|
||
{% if page.layout == 'lab_life' %} | ||
<script src="/assets/lib/splide/splide.min.js"></script> | ||
<link href="/assets/lib/splide/splide.min.css" rel="stylesheet"> | ||
{% endif %} | ||
|
||
{% if page.math %} | ||
<!-- MathJax --> | ||
<script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
$(function () { | ||
const main = new Splide('#main-slider', { | ||
rewind: true, | ||
keyboard: true, | ||
type: 'fade', | ||
heightRatio: 0.82, // TODO make this look good on mobile | ||
pagination: false, | ||
lazyLoad: 'nearby' | ||
// arrows: false, | ||
// cover: true | ||
}); | ||
|
||
const thumbnails = new Splide('#thumbnail-slider', { | ||
lazyLoad: 'sequential', | ||
rewind: true, | ||
fixedWidth: 104, | ||
fixedHeight: 58, | ||
isNavigation: true, | ||
gap: 10, | ||
focus: 'center', | ||
pagination: false, | ||
cover: true, | ||
dragMinThreshold: { | ||
mouse: 4, | ||
touch: 10 | ||
}, | ||
breakpoints: { | ||
640: { | ||
fixedWidth: 66, | ||
fixedHeight: 38 | ||
} | ||
} | ||
}); | ||
|
||
main.sync(thumbnails); | ||
main.mount(); | ||
thumbnails.mount(); | ||
|
||
$('#main-slider').removeClass('d-none'); | ||
$('#thumbnail-slider').removeClass('d-none'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
layout: page | ||
refactor: false | ||
--- | ||
|
||
<section class="splide" aria-label="Lab life image carousel" id="main-slider" class="d-none"> | ||
<div class="splide__track"> | ||
<ul class="splide__list"> | ||
{% for image in page.images %} | ||
<li class="splide__slide d-flex align-items-center justify-content-center bg-dark flex-column"> | ||
<img data-splide-lazy="{{image.src}}" class="h-100 object-fit-contain" alt="{{image.caption}}"> | ||
<div class="text-light my-3 mx-5 text-center">{{image.caption}}</div> | ||
|
||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</section> | ||
|
||
<section class="splide" aria-label="Lab life thumbnail slider" id="thumbnail-slider" class="d-none"> | ||
<div class="splide__track"> | ||
<ul class="splide__list"> | ||
{% for image in page.images %} | ||
<li class="splide__slide"> | ||
<img data-splide-lazy="{{image.src}}" class="h-100"> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters