mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
89 lines
2.3 KiB
HTML
89 lines
2.3 KiB
HTML
<nav>
|
|
<div class="navArtist">
|
|
<a href="/">{{- site.Title -}}</a>
|
|
</div>
|
|
<div class="links">
|
|
{{- $index := 0 -}}
|
|
{{- $currentIndex := -1 -}}
|
|
{{- with partial "function/currentMenuItem.html" . -}}
|
|
{{- $currentIndex = sub .Weight 1 -}}
|
|
{{- end -}}
|
|
{{- $menus := .Site.Menus.main -}}
|
|
{{- $len := len $menus -}}
|
|
{{- range $menus -}}
|
|
{{- $url := .URL | relURL -}}
|
|
{{- if eq (add $index 1) $len -}}
|
|
<a
|
|
href="{{- .URL | relURL -}}"
|
|
class="link{{- if eq $index $currentIndex -}}
|
|
{{- printf " current" -}}
|
|
{{- end -}}"
|
|
>{{- .Title -}}</a
|
|
>
|
|
{{- else -}}
|
|
<a
|
|
href="{{- .URL | relURL -}}"
|
|
class="link{{- if eq $index $currentIndex -}}
|
|
{{- printf " current" -}}
|
|
{{- end -}}"
|
|
>{{- .Title -}}</a
|
|
>, 
|
|
{{- end -}}
|
|
{{- $index = add $index 1 -}}
|
|
{{- end -}}
|
|
</div>
|
|
<div class="threshold">
|
|
{{- $length := 0 -}}
|
|
{{- with partial "function/getImageSlice.html" . -}}
|
|
{{- $length = len . -}}
|
|
{{- end -}}
|
|
<span>{{- i18n "threshold" | strings.FirstUpper -}}:</span>
|
|
<span>
|
|
<button class="dec">-</button>
|
|
<span class="num"></span><span class="num"></span><span class="num"></span
|
|
><span class="num"></span>
|
|
<button class="inc">+</button>
|
|
</span>
|
|
</div>
|
|
<div class="index">
|
|
<span class="num">0</span><span class="num">0</span><span class="num">0</span
|
|
><span class="num">0</span>
|
|
<span>/</span>
|
|
<span class="num">{{- math.Floor (div $length 1000) -}}</span
|
|
><span class="num">{{- mod (math.Floor (div $length 100)) 10 -}}</span
|
|
><span class="num">{{- mod (math.Floor (div $length 10)) 10 -}}</span
|
|
><span class="num">{{- mod $length 10 -}}</span>
|
|
</div>
|
|
</nav>
|
|
{{- /* for threshold */ -}}
|
|
<script>
|
|
i = 2
|
|
const s = sessionStorage.getItem('thresholdsIndex')
|
|
if (s !== null) {
|
|
i = parseInt(s)
|
|
}
|
|
var t = ''
|
|
switch (i) {
|
|
case 0:
|
|
t = '0020'
|
|
break
|
|
case 1:
|
|
t = '0040'
|
|
break
|
|
case 2:
|
|
t = '0080'
|
|
break
|
|
case 3:
|
|
t = '0140'
|
|
break
|
|
case 4:
|
|
t = '0200'
|
|
break
|
|
}
|
|
Array.from(
|
|
document.getElementsByClassName('threshold').item(0).getElementsByClassName('num')
|
|
).forEach((e, i) => {
|
|
e.innerText = t[i]
|
|
})
|
|
</script>
|