~mika/www.m1kadev.nl

ref: e82b0fb55a37d61327a5ae6ab1e8c63251b8e4ba www.m1kadev.nl/scripts/fetch-greet.js -rw-r--r-- 625 bytes
e82b0fb5 — m1ka fix footception a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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; // this is misspelled in the prod api LMAAO
    greetElem.lang = repsonse.lang;
    authorElem.innerHTML = repsonse.author;
    authorElem.style.display = "none";

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