1
0
Fork 0

AVIF and optipng!
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Hamcha 2023-09-15 23:46:50 +02:00
parent fb7a7a7485
commit 17246200c6
Signed by: hamcha
GPG key ID: 1669C533B8CF6D89
63 changed files with 41 additions and 5 deletions

View file

@ -77,7 +77,7 @@ All the functions I needed were easy to find and worked out of the box just like
I have a lot of tools I use daily that I keep around in my desk, on their side, loosely. I would like a stand where they can be popped in and out and take less footprint.
![The tools](/media/fusion360/tools.png)
![The tools](/media/fusion360/tools.jpg)
Let's design something for that!

View file

@ -103,7 +103,7 @@ Keep in mind that there are a lot of tools that I didn't exploit properly (like
I like taking SATA SSDs out of their housing and giving them a smaller one. You see, most cheap SATA SSDs nowadays only take a small part of the SATA 2.5" enclosure:
![BX500 outside of its plastic enclosure](/media/onshape/smol.png)
![BX500 outside of its plastic enclosure](/media/onshape/smol.jpg)
I like using these as powered up pendrives to bring around, so I usually try to come up with a less space wasting, more quirky enclosure... let's make one!

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 KiB

After

Width:  |  Height:  |  Size: 485 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 KiB

After

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 KiB

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 KiB

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 KiB

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 KiB

After

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

View file

@ -1,7 +1,25 @@
<figure width="100%">
<a href="#{{ .Destination | md5 }}-lightbox"
><img src="{{ .Destination | safeURL }}" alt="{{ .PlainText }}"
/></a>
><picture>
{{ $avifPath:= replace .Destination (path.Ext .Destination) ".avif" }} {{
$avifPathStatic:= printf "static/%s" $avifPath }} {{ if (fileExists
$avifPathStatic) -}}
<source srcset="{{ $avifPath | safeURL }}" type="image/avif" />
{{- end }} {{ $isPNG := eq (path.Ext .Destination) ".png" }} {{ if eq
(path.Ext .Destination) ".jpg" }}
<source type="image/jpeg" srcset="{{ .Destination | safeURL }}" />
{{ end }} {{ if eq (path.Ext .Destination) ".jpeg" }}
<source type="image/jpeg" srcset="{{ .Destination | safeURL }}" />
{{ end }} {{ if eq (path.Ext .Destination) ".png" }}
<source
type="image/png"
srcset="{{
.Destination | safeURL }}"
/>
{{ end }}
<img src="{{ .Destination | safeURL }}" alt="{{ .PlainText }}" />
</picture>
</a>
<figcaption>
{{ if .Title }}
<p>{{ .Title | markdownify }}</p>
@ -11,5 +29,23 @@
</figcaption>
</figure>
<a href="#_" class="lightbox" id="{{ .Destination | md5 }}-lightbox">
<picture>
{{ $avifPath:= replace .Destination (path.Ext .Destination) ".avif" }} {{
$avifPathStatic:= printf "static/%s" $avifPath }} {{ if (fileExists
$avifPathStatic) -}}
<source srcset="{{ $avifPath | safeURL }}" type="image/avif" />
{{- end }} {{ $isPNG := eq (path.Ext .Destination) ".png" }} {{ if eq
(path.Ext .Destination) ".jpg" }}
<source type="image/jpeg" srcset="{{ .Destination | safeURL }}" />
{{ end }} {{ if eq (path.Ext .Destination) ".jpeg" }}
<source type="image/jpeg" srcset="{{ .Destination | safeURL }}" />
{{ end }} {{ if eq (path.Ext .Destination) ".png" }}
<source
type="image/png"
srcset="{{
.Destination | safeURL }}"
/>
{{ end }}
<img src="{{ .Destination | safeURL }}" alt="{{ .PlainText }}" />
</picture>
</a>