From c3db03e67d532d8f71ccc0b1e570b5bda18f8720 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 30 Dec 2024 19:32:29 +1100 Subject: [PATCH] feat: Update css to work on mobile and update js to use direct API not proxied --- templates/assets/css/index.css | 2 +- templates/index.html | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/assets/css/index.css b/templates/assets/css/index.css index 96c29b9..f64dd9c 100644 --- a/templates/assets/css/index.css +++ b/templates/assets/css/index.css @@ -7,7 +7,7 @@ body { flex-direction: column; align-items: center; justify-content: center; - height: 100vh; + height: 100dvh; transition: background-color 0.3s, color 0.3s; background-color: #121212; color: #e0e0e0; diff --git a/templates/index.html b/templates/index.html index 2eee1e1..7b8754f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -42,7 +42,11 @@ }; async function fetchJoke() { - const response = await fetch('/api/joke'); + const response = await fetch('https://icanhazdadjoke.com', { + headers: { + 'Accept': 'application/json' + } + }); const data = await response.json(); document.getElementById('joke').innerText = data.joke; }