erynwells.me/layouts/partials/photos/megapixels.html
Eryn Wells 81a5507e8f 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.
2023-04-06 08:45:35 -07:00

8 lines
298 B
HTML

{{ $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 }}