~mika/www.m1kadev.nl

ref: 72339ece8fd581d4f850d6131b77af099851861b www.m1kadev.nl/scripts/fetch-greet.js -rw-r--r-- 549 bytes
72339ece — m1ka fix nginx too 8 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addEventListener("load", async (ev) => {
    const isMobile = window.matchMedia("(max-width: 900px)").matches;
    if (isMobile) return;

    const authorElem = document.getElementById("author");
    const greetElem = document.getElementById("greet");
    const request = await fetch("https://api.m1kadev.nl/greet");
    const repsonse = await request.json();
    greetElem.innerHTML = repsonse.quote;
    greetElem.lang = repsonse.lang;
    authorElem.innerHTML = `- ${repsonse.author}`;

    greetElem.parentElement.style.display = "initial";
});