Added JPEG-xl support, with size alternatives for picture

This commit is contained in:
Edgar P. Burkhart 2022-01-01 10:12:10 +01:00
parent 81d479e09b
commit 108f7e2968
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
9 changed files with 17 additions and 3 deletions

View file

@ -7,7 +7,7 @@
}
.biglinks > a,
.biglinks > img {
.biglinks > picture {
max-width: calc(100% - 24px);
}
@ -22,8 +22,13 @@
display: block;
}
.biglinks > img {
.biglinks > picture {
display: inline-block;
height: 156px;
margin: 12px;
}
.biglinks > picture > img {
height: 100%;
width: 100%;
object-fit: cover;
}

BIN
src/static/pic/pic.jxl Normal file

Binary file not shown.

BIN
src/static/pic/pic.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

BIN
src/static/pic/picx2.jxl Normal file

Binary file not shown.

BIN
src/static/pic/picx2.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
src/static/pic/picx4.jxl Normal file

Binary file not shown.

BIN
src/static/pic/picx4.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View file

@ -27,7 +27,16 @@
<img class="svg" src="/static/picto/summit.svg" alt="" />
Komoot
</a>
<img src="/static/pic/pic1.webp" alt="Paysage" />
<picture>
<source type="image/jxl"
srcset="/static/pic/pic.jxl,
/static/pic/picx2.jxl 2x,
/static/pic/picx4.jxl 4x" />
<img alt="Paysage"
src="/static/pic/pic.webp"
srcset="/static/pic/picx2.webp 2x,
/static/pic/picx4.webp 4x" />
</picture>
</div>
<nav>
<a href="#">