Welcome to mirror list, hosted at ThFree Co, Russian Federation.

foot.html « partials « layouts - github.com/kc0bfv/ticky_tacky_dark.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 286cb6b9e9c73fdca832d48d8cad04f96096fe5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<script>
    function toggleDisplay( elementID ) {
        elem = document.getElementById(elementID);
        if( elem.style.display == "none" ) {
            elem.style.display = "block";
        } else if( elem.style.display == "block" ) {
            elem.style.display = "none";
        }
    }
    {{ with .Site.Params.headerimages }}
    function randomHeaderImg() {
        images = [
            {{- $last_elem := sub (len .) 1 -}}
            {{ range $index, $component := . -}}
                {{ . | relURL }}{{ if lt $index $last_elem }},{{ end }}
            {{- end -}}
        ];
        i = Math.ceil(Math.random() * images.length) - 1;
        document.getElementById("headerimg").src = images[i];
    }
    window.onload = randomHeaderImg;
    {{ end }}
    {{ with .Params.sideimages }}
    function randomSideAndHeaderImg() {
        randomHeaderImg();
        images = [
            {{- $last_elem := sub (len .) 1 -}}
            {{ range $index, $component := . -}}
                {{ . | relURL }}{{ if lt $index $last_elem }},{{ end }}
            {{- end -}}
        ];
        i = Math.ceil(Math.random() * images.length) - 1;
        document.getElementById("sideimage").src = images[i];
    }
    window.onload = randomSideAndHeaderImg;
    {{ end }}
</script>