Implement a photo carousel

The layout of this is all CSS with scroll-snap. (Neat!) Also implement a
JavaScript scroll event listener that detects when photos scroll and
updates the caption and photo data.

Refactor a few parts of the photo_exif_table into partials so they can
be reused for the carousel items.
This commit is contained in:
Eryn Wells 2023-04-02 09:56:27 -07:00
parent 0010e65428
commit f5fd358922
7 changed files with 393 additions and 21 deletions

View file

@ -0,0 +1,4 @@
{{ $lat := float .Lat }}
{{ $latDir := cond (eq $lat 0) "" (cond (gt $lat 0) "N" "S") }}
{{ $formattedLat := printf "%sº%s" (.Lat | lang.FormatNumber (cond (ne $lat 0) 3 0)) $latDir }}
{{ return $formattedLat }}

View file

@ -0,0 +1,4 @@
{{ $long := float .Long }}
{{ $longDir := cond (eq $long 0) "" (cond (gt $long 0) "E" "W") }}
{{ $formattedLong := printf "%sº%s" (.Long | lang.FormatNumber (cond (ne $long 0) 3 0)) $longDir }}
{{ return $formattedLong }}

View file

@ -0,0 +1,8 @@
{{ $widthpx := .PixelXDimension }}
{{ $heightpx := .PixelYDimension }}
{{ $megapixels := 0 }}
{{ if and (gt $widthpx 0) (gt $heightpx 0) }}
{{ $megapixels = div (mul $widthpx $heightpx) 1e6 }}
{{ end }}
{{ $formattedMegapixels := printf "%.0f MP" $megapixels }}
{{ return $formattedMegapixels }}