瀏覽代碼

merging from motw

master
Sean Dockray 4 年之前
父節點
當前提交
4e03c7ad1f
共有 3 個文件被更改,包括 111 次插入35 次删除
  1. +15
    -15
      themes/sandpoints/layouts/_default/single.html
  2. +12
    -20
      themes/sandpoints/layouts/partials/header.html
  3. +84
    -0
      themes/sandpoints/static/css/player.css

+ 15
- 15
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 }}

<div class="{{ $graphOptions.Get "depth" }}title"><span class="sup">{{ substr .File.Dir 0 -1 }}⁄{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>
<div class="{{ $.Scratch.Get "depth" }}title"><span class="sup">{{ substr .File.Dir 0 -1 }}⁄{{ substr .Title 0 1 }}</span>{{ substr .Title 1 }}</div></div>

<div class="grid">
<div class="leftcolumn">
@@ -24,26 +23,27 @@
{{ end }}
</div>
<div class="rightcolumn">
{{ if (not (eq ($graphOptions.Get "depth") "crust")) }}
{{ if (not (eq ($.Scratch.Get "depth") "crust")) }}
<div class="has">
<span class="sup">has {{ index ($graphOptions.Get "has") 1 }}⁄</span>
<span class="sup">has {{ index ($.Scratch.Get "has") 1 }}⁄</span>
</div>
<div class="afterhas">
{{ range index $currentNode.Params (printf "has_%s" (index ($graphOptions.Get "has") 1) )}}
{{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($graphOptions.Get "has") 0)) . ) }}
<div class="{{ index $.Site.Data.sandpointsnamegraph (index ($graphOptions.Get "has") 0) "depth" }}">
{{ range index $currentNode.Params (printf "has_%s" (index ($.Scratch.Get "has") 1) )}}
{{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($.Scratch.Get "has") 0)) . ) }}
<div class="{{ index $.Site.Data.sandpointsnamegraph (index ($.Scratch.Get "has") 0) "depth" }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>
{{ end }}
{{ end }}
{{ end }}

{{ if eq ($graphOptions.Get "depth") "crust" }}
{{ if eq ($.Scratch.Get "depth") "crust" }}
<div class="has">
<span class="sup">in {{ index ($graphOptions.Get "in") 1 }}⁄</span>
<span class="sup">in {{ index ($.Scratch.Get "in") 1 }}⁄</span>
</div>
{{ range where $.Site.RegularPages ".Section" (index ($graphOptions.Get "in") 0) }}
{{ if in (index .Params (printf "has_%s" ($graphOptions.Get "plural"))) $currentNode.File.LogicalName }}
<div class="afterhas">
{{ range where $.Site.RegularPages ".Section" (index ($.Scratch.Get "in") 0) }}
{{ if in (index .Params (printf "has_%s" ($.Scratch.Get "plural"))) $currentNode.File.LogicalName }}
<div class="{{ substr .File.Dir 0 -1 }}">
<a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a>
</div>


+ 12
- 20
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 -}}


<div class="header">
<a title="{{ $.Site.Home.Title }}'s Bibliotheke" href="/library/BROWSE_LIBRARY.html" class="bibliotheke" target="_blank">
<img src="/images/bibliotheke.svg" />
</a>
<div class="breadcrumbs">
{{ if ne ($_.Get "depth") "core" }}
<a href="{{ with $currentSession.Site.GetPage (printf "/%s/index.md" ($_.Get "home")) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><span class="sup">{{ with $currentSession.Site.GetPage (printf "/%s/index.md" ($_.Get "home")) }}{{ substr .Title 0 1 }}</span><i>{{ substr .Title 1 }}</i></a>{{ end }}
{{ if ne ($.Scratch.Get "depth") "core" }}
<a href="{{ with $currentSession.Site.GetPage (printf "/%s/index.md" ($.Scratch.Get "home")) }}{{ .RelPermalink }}{{ end }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}"><span class="sup">{{ with $currentSession.Site.GetPage (printf "/%s/index.md" ($.Scratch.Get "home")) }}{{ substr .Title 0 1 }}</span><i>{{ substr .Title 1 }}</i></a>{{ end }}
{{ end }}

{{ if eq ($_.Get "depth") "mantle" }}
{{ if eq ($.Scratch.Get "depth") "mantle" }}
<span class="mantlebar"><i> » <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a></i></span>
{{ end }}

{{ if eq ($_.Get "depth") "crust" }}
{{ $.Scratch.Set "counter" 0 }}
{{ range where $.Site.RegularPages ".Section" ($_.Get "mantle") }}
{{ if in (index .Params (printf "has_%s" ($_.Get "mantle_has"))) $currentSession.File.LogicalName }}
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
{{ if lt ($.Scratch.Get "counter") 2 }}
<span><i> » <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a></i></span>
{{ end }}
{{ end }}
{{ end }}
{{ if eq ($.Scratch.Get "depth") "crust" }}
{{ range first 1 (where (where $.Site.RegularPages ".Section" ($.Scratch.Get "mantle")) (printf ".Params.has_%s" ($.Scratch.Get "mantle_has")) "intersect" (slice $currentSession.File.LogicalName)) }}
<span><i> » <a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a></i></span>
{{ end }}
<span class="mantlebar"><i> » <a href="{{ $currentSession.RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $currentSession.Title }}</a></i></span>
{{ end }}
</div>


+ 84
- 0
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;
}


Loading…
取消
儲存