diff --git a/fetch/programmer-humour/index.html b/fetch/programmer-humour/index.html new file mode 100644 index 00000000..ff262160 --- /dev/null +++ b/fetch/programmer-humour/index.html @@ -0,0 +1,18 @@ + + +
+ +Loading comic...
+${data.alt}
+ `; + }) + .catch(error => { + console.error(error); + + if (loading) { + loading.textContent = "Error loading comic 😢"; + } else { + container.innerHTML = `Error loading comic 😢
`; + } + }); +} + +window.addEventListener("load", fetchComic); \ No newline at end of file diff --git a/fetch/programmer-humour/style.css b/fetch/programmer-humour/style.css new file mode 100644 index 00000000..6a031a65 --- /dev/null +++ b/fetch/programmer-humour/style.css @@ -0,0 +1,11 @@ +body { + font-family: Arial, sans-serif; + text-align: center; + background-color: #f4f4f4; +} + +img { + max-width: 100%; + height: auto; + margin-top: 20px; +} \ No newline at end of file