From 4e03c7ad1fbac059e7d7ae5ac8c4c8bca98d6e87 Mon Sep 17 00:00:00 2001 From: Sean Dockray Date: Sat, 12 Sep 2020 16:41:11 +1000 Subject: [PATCH] merging from motw --- .../sandpoints/layouts/_default/single.html | 30 +++---- .../sandpoints/layouts/partials/header.html | 32 +++---- themes/sandpoints/static/css/player.css | 84 +++++++++++++++++++ 3 files changed, 111 insertions(+), 35 deletions(-) create mode 100644 themes/sandpoints/static/css/player.css diff --git a/themes/sandpoints/layouts/_default/single.html b/themes/sandpoints/layouts/_default/single.html index 1b862db..e061b84 100644 --- a/themes/sandpoints/layouts/_default/single.html +++ b/themes/sandpoints/layouts/_default/single.html @@ -1,21 +1,20 @@ {{ define "main" }} {{$currentNode := . }} -{{ $graphOptions := newScratch }} {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} {{ if eq (substr $currentNode.File.Dir 0 -1) $k }} - {{ $graphOptions.Set "plural" (index $v "plural") }} - {{ $graphOptions.Set "depth" (index $v "depth") }} + {{ $.Scratch.Set "plural" (index $v "plural") }} + {{ $.Scratch.Set "depth" (index $v "depth") }} {{ with index $v "in" }} - {{ $graphOptions.Set "in" (index $v "in") }} + {{ $.Scratch.Set "in" (index $v "in") }} {{ end }} {{ with index $v "has" }} - {{ $graphOptions.Set "has" (index $v "has") }} + {{ $.Scratch.Set "has" (index $v "has") }} {{ end }} {{ end }} {{ end }} -
{{ substr .File.Dir 0 -1 }}⁄{{ substr .Title 0 1 }}{{ substr .Title 1 }}
+
{{ substr .File.Dir 0 -1 }}⁄{{ substr .Title 0 1 }}{{ substr .Title 1 }}
@@ -24,26 +23,27 @@ {{ end }}
- {{ if (not (eq ($graphOptions.Get "depth") "crust")) }} + {{ if (not (eq ($.Scratch.Get "depth") "crust")) }}
- has {{ index ($graphOptions.Get "has") 1 }}⁄ + has {{ index ($.Scratch.Get "has") 1 }}⁄
- {{ range index $currentNode.Params (printf "has_%s" (index ($graphOptions.Get "has") 1) )}} - {{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($graphOptions.Get "has") 0)) . ) }} -
+ {{ range index $currentNode.Params (printf "has_%s" (index ($.Scratch.Get "has") 1) )}} + {{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($.Scratch.Get "has") 0)) . ) }} + {{ end }} {{ end }} {{ end }} - {{ if eq ($graphOptions.Get "depth") "crust" }} + {{ if eq ($.Scratch.Get "depth") "crust" }}
- in {{ index ($graphOptions.Get "in") 1 }}⁄ + in {{ index ($.Scratch.Get "in") 1 }}⁄
- {{ range where $.Site.RegularPages ".Section" (index ($graphOptions.Get "in") 0) }} - {{ if in (index .Params (printf "has_%s" ($graphOptions.Get "plural"))) $currentNode.File.LogicalName }} +
+ {{ range where $.Site.RegularPages ".Section" (index ($.Scratch.Get "in") 0) }} + {{ if in (index .Params (printf "has_%s" ($.Scratch.Get "plural"))) $currentNode.File.LogicalName }} diff --git a/themes/sandpoints/layouts/partials/header.html b/themes/sandpoints/layouts/partials/header.html index 501263a..b40fca1 100644 --- a/themes/sandpoints/layouts/partials/header.html +++ b/themes/sandpoints/layouts/partials/header.html @@ -1,44 +1,36 @@ {{ $currentSession := . }} -{{ $_ := newScratch }} {{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}} {{ if eq $currentSession.File.Dir (printf "%s/" $k) }} - {{ $_.Add "depth" (index $v "depth") }} + {{ $.Scratch.Add "depth" (index $v "depth") }} {{ if eq (index $v "depth") "mantle" }} - {{ $_.Add "home" (index $v "in" 0) }} + {{ $.Scratch.Add "home" (index $v "in" 0) }} {{ end }} {{ if eq (index $v "depth") "crust" }} - {{ $_.Add "home" (index (index $currentSession.Site.Data.sandpointsnamegraph (index $v "in" 0)) "in" 0) }} - {{ $_.Add "mantle" (index $v "in" 0) }} - {{ $_.Add "mantle_has" (index (index $currentSession.Site.Data.sandpointsnamegraph (index $v "in" 0)) "has" 1) }} + {{ $.Scratch.Add "home" (index (index $currentSession.Site.Data.sandpointsnamegraph (index $v "in" 0)) "in" 0) }} + {{ $.Scratch.Add "mantle" (index $v "in" 0) }} + {{ $.Scratch.Add "mantle_has" (index (index $currentSession.Site.Data.sandpointsnamegraph (index $v "in" 0)) "has" 1) }} {{ end }} {{ end }} {{- end -}} -
diff --git a/themes/sandpoints/static/css/player.css b/themes/sandpoints/static/css/player.css new file mode 100644 index 0000000..5d6025b --- /dev/null +++ b/themes/sandpoints/static/css/player.css @@ -0,0 +1,84 @@ +/* soundcite - v0.5.1 - 2017-07-10 + * Copyright (c) 2017 Tyler J. Fisher and Northwestern University Knight Lab + */ + +/*PLAYER CHROME*/ + +@-webkit-keyframes spin { + from { -webkit-transform: rotate(0deg); opacity: 0.4; } + 50% { -webkit-transform: rotate(180deg); opacity: 1; } + to { -webkit-transform: rotate(360deg); opacity: 0.4; } +} + +@-moz-keyframes spin { + from { -moz-transform: rotate(0deg); opacity: 0.4; } + 50% { -moz-transform: rotate(180deg); opacity: 1; } + to { -moz-transform: rotate(360deg); opacity: 0.4; } +} + +@-ms-keyframes spin { + from { -ms-transform: rotate(0deg); opacity: 0.4; } + 50% { -ms-transform: rotate(180deg); opacity: 1; } + to { -ms-transform: rotate(360deg); opacity: 0.4; } +} + +@-o-keyframes spin { + from { -o-transform: rotate(0deg); opacity: 0.4; } + 50% { -o-transform: rotate(180deg); opacity: 1; } + to { -o-transform: rotate(360deg); opacity: 0.4; } +} + +@keyframes spin { + from { transform: rotate(0deg); opacity: 0.2; } + 50% { transform: rotate(180deg); opacity: 1; } + to { transform: rotate(360deg); opacity: 0.2; } +} + +.soundcite-loaded { + border-radius: 6px; + padding: 0 5px 0 5px; + display: inline-block; + cursor: pointer; +} + +.soundcite-loaded:before { + display: inline-block; + content: ""; + vertical-align: -10%; + margin-right: 0.25em; +} + +.soundcite-loading:before { + margin-right: 0.5em; + font-size: 0.9em; + position: relative; + top: -.05em; + height: 0.75em; + width: 0.75em; + border: 2px solid #000; + border-right-color: transparent; + border-radius: 50%; + -webkit-animation: spin 1s linear infinite; + -moz-animation: spin 1s linear infinite; + -ms-animation: spin 1s linear infinite; + -o-animation: spin 1s linear infinite; + animation: spin 1s linear infinite; +} + +.soundcite-play:before { + font-size: 0.9em; + position: relative; + top: -.05em; + border: 0.5em solid transparent; + border-left: 0.75em solid black; +} + +.soundcite-pause:before { + font-size: 0.9em; + position: relative; + top: -.05em; + height: 1em; + border-left: .75em double black; + border-right: .5em solid transparent; +} +