summaryrefslogtreecommitdiff
path: root/examples/assets/js/footer.js
blob: df46a42bde18db7224b76d6b191bd8d39756992f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Footer {
    constructor() {}

    Init() {this.#EventListener()}

    #EventListener() {
        const links = document.getElementsByClassName('footer-links')
        for(let i = 0; i < links.length; i++) {links[i].addEventListener('click', () => this.#Copy(links[i].textContent))}
    }
    #Copy(x) {
        navigator.clipboard.writeText(x).then(() => {
            console.log('copied')
        }).catch((err) => {
            console.error(err)
        })
    }
}

new Footer().Init()