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: ad27b9a174f007a201145615899a6a12bbaf0f71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import ThemeColorScheme from "ts/colorScheme"
import { renderCopyButton } from "ts/copyButton"
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()
    }
    renderCopyButton()
}

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