forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Advanced image viewers (alshedivat#2132)
Image slider with [Swiper](https://swiperjs.com/). ![image](https://github.com/alshedivat/al-folio/assets/31376482/9068823c-571a-4d31-8e95-755a40a15ec9) Image comparison slider with [img-comparison-slider](https://img-comparison-slider.sneas.io/). ![image](https://github.com/alshedivat/al-folio/assets/31376482/97812477-c13b-43b1-8f0b-cb098462de3c) --------- Signed-off-by: George Araújo <[email protected]>
- Loading branch information
1 parent
2492ab3
commit 8e93db5
Showing
8 changed files
with
76 additions
and
3 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
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 |
---|---|---|
|
@@ -71,3 +71,18 @@ | |
crossorigin="" | ||
> | ||
{% endif %} | ||
|
||
<!-- Image comparison slider --> | ||
{% if page.images %} | ||
{% if page.images.compare %} | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/styles.min.css"> | ||
{% endif %} | ||
{% if page.images.slider %} | ||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/swiper-bundle.min.css" | ||
integrity="sha256-yUoNxsvX+Vo8Trj3lZ/Y5ZBf8HlBFsB6Xwm7rH75/9E=" | ||
crossorigin="anonymous" | ||
> | ||
{% endif %} | ||
{% endif %} |
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,12 @@ | ||
{% if page.images %} | ||
{% if page.images.compare %} | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js"></script> | ||
{% endif %} | ||
{% if page.images.slider %} | ||
<script | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/swiper-element-bundle.min.js" | ||
integrity="sha256-BPrwikijIybg9OQC5SYFFqhBjERYOn97tCureFgYH1E=" | ||
crossorigin="anonymous" | ||
></script> | ||
{% endif %} | ||
{% endif %} |
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,35 @@ | ||
--- | ||
layout: post | ||
title: a post with advanced image components | ||
date: 2024-01-27 11:46:00 | ||
description: this is what advanced image components could look like | ||
tags: formatting images | ||
categories: sample-posts | ||
thumbnail: assets/img/9.jpg | ||
images: | ||
compare: true | ||
slider: true | ||
--- | ||
|
||
This is an example post with advanced image components. | ||
|
||
## Image Slider | ||
|
||
This is a simple image slider. It uses the [Swiper](https://swiperjs.com/) library. Check the [examples page](https://swiperjs.com/demos) for more information of what you can achieve with it. | ||
|
||
<swiper-container keyboard="true" navigation="true" pagination="true" pagination-clickable="true" pagination-dynamic-bullets="true" rewind="true"> | ||
<swiper-slide>{% include figure.liquid path="assets/img/9.jpg" class="img-fluid rounded z-depth-1" %}</swiper-slide> | ||
<swiper-slide>{% include figure.liquid path="assets/img/7.jpg" class="img-fluid rounded z-depth-1" %}</swiper-slide> | ||
<swiper-slide>{% include figure.liquid path="assets/img/8.jpg" class="img-fluid rounded z-depth-1" %}</swiper-slide> | ||
<swiper-slide>{% include figure.liquid path="assets/img/10.jpg" class="img-fluid rounded z-depth-1" %}</swiper-slide> | ||
<swiper-slide>{% include figure.liquid path="assets/img/12.jpg" class="img-fluid rounded z-depth-1" %}</swiper-slide> | ||
</swiper-container> | ||
|
||
## Image Comparison Slider | ||
|
||
This is a simple image comparison slider. It uses the [img-comparison-slider](https://img-comparison-slider.sneas.io/) library. Check the [examples page](https://img-comparison-slider.sneas.io/examples.html) for more information of what you can achieve with it. | ||
|
||
<img-comparison-slider> | ||
{% include figure.liquid path="assets/img/prof_pic.jpg" class="img-fluid rounded z-depth-1" slot="first" %} | ||
{% include figure.liquid path="assets/img/prof_pic_color.png" class="img-fluid rounded z-depth-1" slot="second" %} | ||
</img-comparison-slider> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.