~mika/www.m1kadev.nl

ff77115bf30bc748ccf30cf879df796128161c0a — m1ka a month ago 864f33d
fix: naming issue in api.m1kadev.nl, hide greet on mobile
3 files changed, 25 insertions(+), 9 deletions(-)

M scripts/fetch-greet.js
M styles/index.css
M templates/pages/index.thtml
M scripts/fetch-greet.js => scripts/fetch-greet.js +12 -5
@@ 1,8 1,15 @@
// TOOD: proper CORS-ing on api.m1kadev.bl
addEventListener("DOMContentLoaded", async (ev) => {
    const greetElement = document.getElementById("greet");
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();
    greetElement.innerHTML = repsonse.qoute; // this is misspelled in the prod api LMAAO
    greetElement.parentElement.style.display = "initial";
    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";
});

M styles/index.css => styles/index.css +10 -2
@@ 1,6 1,14 @@
aside > h2 {
    border-left: 0.1rem solid var(--fg-color);
}

aside > span {
    border-left: 0.1rem solid var(--fg-color);
}

aside {
    writing-mode: vertical-rl;
    border-bottom: 0;
    border-left: 0.1rem solid var(--fg-color);
    display: none;
    display: flex;
    flex-direction: column;
}

M templates/pages/index.thtml => templates/pages/index.thtml +3 -2
@@ 21,8 21,9 @@
        {{ &fxg_content }}
        {{ &footer }}
    </main>
    <aside>
        <h2 id="greet">placehoders are nice :)</h1>
    <aside style="display:none;">
        <span id="author"></span>
        <h2 id="greet">placehoders are nice :)</h2>
    </aside>
</body>
</html>