1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 16:45:32 -04:00

refactor responsive SCSS using mixins

This commit is contained in:
2019-11-03 21:36:51 -05:00
parent 4dd67b6723
commit 4f7c01d600
16 changed files with 182 additions and 164 deletions

View File

@@ -1,7 +1,12 @@
<video class="embed" width="{{ if .Get "width" }}{{ .Get "width" }}{{ else }}640{{ end }}" height="{{ if .Get "height" }}{{ .Get "height" }}{{ else }}385{{ end }}" {{ if .Get "poster" }}poster="{{ .Get "poster" }}" {{ end }}controls>
{{ if .Get "webm" }}<source src="{{ .Get "webm" }}" type="video/webm">{{ end }}
{{ if .Get "mp4" }}<source src="{{ .Get "mp4" }}" type="video/mp4">{{ end }}
{{ if .Get "ogg" }}<source src="{{ .Get "ogg" }}" type="video/ogg">{{ end }}
{{- $video_webm := .Page.Resources.GetMatch (.Get "webm") -}}
{{- $video_mp4 := .Page.Resources.GetMatch (.Get "mp4") -}}
{{- $video_ogg := .Page.Resources.GetMatch (.Get "ogg") -}}
{{- $img_poster := .Page.Resources.GetMatch (.Get "poster") -}}
Your browser does not support HTML5 video. <a href="{{ .Get "mp4" }}">Load the video directly.</a>
</video>
<video class="embed"{{ if .Get "width" }} width="{{ .Get "width" }}"{{ end }}{{ if .Get "height" }} height="{{ .Get "height" }}"{{ end }}{{ if .Get "poster" }} poster="{{ $img_poster.Permalink }}"{{ end }}{{ if .Get "autoplay" }} autoplay{{ end }}{{ if .Get "loop" }} loop{{ end }}{{ if ne (.Get "nocontrols") "1" }} controls{{ end }}>
{{ if .Get "webm" }}<source src="{{ $video_webm.Permalink }}" type="video/webm">{{ end }}
{{ if .Get "mp4" }}<source src="{{ $video_mp4.Permalink }}" type="video/mp4">{{ end }}
{{ if .Get "ogg" }}<source src="{{ $video_ogg.Permalink }}" type="video/ogg">{{ end }}
Your browser does not support HTML5 video. <a href="{{ $video_mp4.Permalink }}">Load the .mp4 video directly.</a>
</video>