feat: compress even moooooarr!

This commit is contained in:
max_richter 2023-11-13 14:38:59 +01:00
parent 9c395d82f3
commit 286e331cd2
4 changed files with 34 additions and 36 deletions

View File

@ -3,31 +3,26 @@
</script> </script>
<div class="background" class:visible> <div class="background" class:visible>
<div class="drapery" /> <div class="drapery">
<img {#each Array.from({ length: 5 }) as _}
alt="curtain left" <picture>
class="curtain-right" <source srcset="/drapery.avif" type="image/avif" />
src="/curtain.png" <source srcset="/drapery.webp" type="image/webp" />
srcset=" <img alt="drapery" src="/drapery.png" />
/curtain.png, <!-- Fallback for browsers that don't support the format --> </picture>
/curtain.webp 1x, <!-- 1x resolution for browsers that support WebP --> {/each}
/curtain.webp 2x, <!-- 2x resolution for browsers that support WebP --> </div>
/curtain.avif 1x, <!-- 1x resolution for browsers that support AVIF --> <picture>
/curtain.avif 2x <!-- 2x resolution for browsers that support AVIF --> <source srcset="/curtain.avif" type="image/avif" />
" <source srcset="/curtain.webp" type="image/webp" />
/> <img alt="curtain left" class="curtain-right" src="/curtain.png" />
<img </picture>
alt="curtain right"
class="curtain-left" <picture>
src="/curtain.png" <source srcset="/curtain.avif" type="image/avif" />
srcset=" <source srcset="/curtain.webp" type="image/webp" />
/curtain.png, <!-- Fallback for browsers that don't support the format --> <img alt="curtain right" class="curtain-left" src="/curtain.png" />
/curtain.webp 1x, <!-- 1x resolution for browsers that support WebP --> </picture>
/curtain.webp 2x, <!-- 2x resolution for browsers that support WebP -->
/curtain.avif 1x, <!-- 1x resolution for browsers that support AVIF -->
/curtain.avif 2x <!-- 2x resolution for browsers that support AVIF -->
"
/>
</div> </div>
<style> <style>
@ -45,24 +40,28 @@
} }
.drapery { .drapery {
background-image: url('/drapery.avif'), url('/drapery.webp'), url('/drapery.png');
background-position: center top;
position: absolute; position: absolute;
top: -50px; top: -50px;
left: 0px; left: 50vw;
width: 100vw; width: fit-content;
height: 300px; height: 250px;
background-repeat: repeat-x;
background-size: 600px 200px;
z-index: 3; z-index: 3;
filter: brightness(1.2) contrast(1.2) saturate(1.3) hue-rotate(-15deg) filter: brightness(1.2) contrast(1.2) saturate(1.3) hue-rotate(-15deg)
drop-shadow(0px 0px 50px black); drop-shadow(0px 0px 50px black);
transform: translateY(-500px) scaleY(0); transform: translateY(-500px) translateX(-50%) scaleY(0);
transition: transform 2s ease; transition: transform 2s ease;
white-space: nowrap;
}
.drapery img {
height: 100%;
width: auto;
margin-left: -5px;
object-fit: cover;
display: inline;
} }
.visible .drapery { .visible .drapery {
transform: translateY(0px) scaleY(1); transform: translateY(0px) scaleY(1) translateX(-50%);
} }
img.curtain-right { img.curtain-right {

View File

@ -25,7 +25,7 @@
</script> </script>
<div class="wrapper"> <div class="wrapper">
<h1>Gallerie</h1> <h1>Gallerie der Gäste</h1>
<div class="grid"> <div class="grid">
{#each items as item} {#each items as item}
<div <div
@ -59,7 +59,6 @@
font-size: 5rem; font-size: 5rem;
font-family: Parisienne, cursive; font-family: Parisienne, cursive;
color: white; color: white;
margin-left: 50px;
text-align: center; text-align: center;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB