anchors top scroll offset

master
Marcell Mars 3 years ago
parent c45feaa3a6
commit a740ac9bf8

@ -70,6 +70,14 @@ window.addEventListener('DOMContentLoaded', (e) => {
window.scrollBy({top: document.querySelector('.header').clientHeight * -1.25, behavior: 'smooth'})}, 50); window.scrollBy({top: document.querySelector('.header').clientHeight * -1.25, behavior: 'smooth'})}, 50);
}) })
}) })
document.querySelectorAll('.anchorz').forEach(i => {
i.addEventListener('click', e => {
setTimeout(() => {
window.scrollBy({ top: document.querySelector('.header').clientHeight * -1.25, behavior: 'smooth' })
}, 50);
})
})
}) })
toggleAllLinks = function () { toggleAllLinks = function () {

@ -1 +1 @@
{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}<span class="smallcaps">{{- $t -}}</span>{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}><span class="sup" style="font-size:0.7em">{{- $sup -}}</span><i>{{ .Text | safeHTML }}</i></a>{{- end -}} {{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}<span class="smallcaps">{{- $t -}}</span>{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ else if strings.HasPrefix .Destination "#"}}class="anchorz"{{ end }}><span class="sup" style="font-size:0.7em">{{- $sup -}}</span><i>{{ .Text | safeHTML }}</i></a>{{- end -}}

@ -1 +1 @@
# git.sandpoints.org/Drawwell/SandpointsTheme v0.0.0-20201207124734-b3fede2839c9 # git.sandpoints.org/Drawwell/SandpointsTheme v0.0.0-20201207142206-ba2a130517be

Loading…
Cancel
Save