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

features.ts « ts « assets - github.com/WingLim/hugo-tania.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cfe676de17c28d7925cb25e7ff85ef5ab6471e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import ThemeColorScheme from "ts/colorScheme";
import { renderFootnotes } from "ts/footnotes"

let enableFootnotes = false
if (document.currentScript) {
    enableFootnotes = document.currentScript.dataset.enableFootnotes == 'true'
}

const init = () => {
    new ThemeColorScheme(document.getElementById('dark-mode-button'))
    if (enableFootnotes) {
        renderFootnotes()
    }
}

window.addEventListener('load', () => {
    setTimeout(function () {
        init()
    }, 0)
})