Skip to content

Commit

Permalink
feat: Adding icons for aperture and focal length
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Nov 23, 2023
1 parent 3dd7b23 commit 4b93c43
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/fibr/templates/story.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,17 @@
{{ if index .Exif.Data "Model" }}
<p class="context">
<img class="icon margin-right-half" src="{{ url "/svg/camera?fill=%23000000" }}" alt="camera">
{{ index .Exif.Data "Model" }}{{- if index .Exif.Data "FocalLength" }}, {{ index .Exif.Data "FocalLength" }}{{ end }}{{- if index .Exif.Data "Aperture" }} f/{{ index .Exif.Data "Aperture" }}{{ end }}
{{ index .Exif.Data "Model" }}

{{ if index .Exif.Data "FocalLength" }}
<img class="icon margin-right-half" src="{{ url "/svg/lens?fill=%23000000" }}" alt="lens">
{{ index .Exif.Data "FocalLength" }}
{{ end }}

{{ if index .Exif.Data "Aperture" }}
<img class="icon margin-right-half" src="{{ url "/svg/aperture?fill=%23000000" }}" alt="aperture">
f/{{ index .Exif.Data "Aperture" }}
{{ end }}
</p>
{{ end }}

Expand Down
8 changes: 8 additions & 0 deletions cmd/fibr/templates/svg.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,11 @@
{{ define "svg-tag" }}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="{{ . }}" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2ZM7 7h.01"/></svg>
{{ end }}

{{ define "svg-aperture" }}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="{{ . }}" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="m14.31 8 5.74 9.94M9.69 8h11.48M7.38 12l5.74-9.94M9.69 16 3.95 6.06M14.31 16H2.83M16.62 12l-5.74 9.94"/></svg>
{{ end }}

{{ define "svg-lens" }}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="{{ . }}" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2"/></svg>
{{ end }}

0 comments on commit 4b93c43

Please sign in to comment.