mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00
✨ feat: add 2 interactive image shortcodes
- `image_hover` changes image on mouse hover. - `image_toggler` swaps image on click.
This commit is contained in:
parent
42293b2868
commit
7ccd71736e
8 changed files with 150 additions and 4 deletions
13
templates/shortcodes/image_hover.html
Normal file
13
templates/shortcodes/image_hover.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
{%- set default_meta = get_image_metadata(path=default_src, allow_missing=true) -%}
|
||||
{%- set hovered_meta = get_image_metadata(path=hovered_src, allow_missing=true) -%}
|
||||
|
||||
<div class="image-hover-container {% if full_width | default(value=false) %}full-width{% endif %}">
|
||||
<div class="image-default">
|
||||
<img src="{{ get_url(path=default_src) }}" alt="{{ default_alt }}"
|
||||
width="{{ default_meta.width }}" height="{{ default_meta.height }}">
|
||||
</div>
|
||||
<div class="image-hovered">
|
||||
<img src="{{ get_url(path=hovered_src) }}" alt="{{ hovered_alt }}"
|
||||
width="{{ hovered_meta.width }}" height="{{ hovered_meta.height }}">
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue