diff --git a/programmer-humour/index.html b/programmer-humour/index.html new file mode 100644 index 00000000..3e5bce2a --- /dev/null +++ b/programmer-humour/index.html @@ -0,0 +1,16 @@ + + + + + + + + + Programmer humour + + + + image for comic + + + \ No newline at end of file diff --git a/programmer-humour/script.js b/programmer-humour/script.js new file mode 100644 index 00000000..2e791a13 --- /dev/null +++ b/programmer-humour/script.js @@ -0,0 +1,13 @@ +const comicImage = document.getElementById("comic-img"); +function fetchComic() { + return fetch("https://xkcd.now.sh/?comic=latest") + .then((data) => data.json()); +} + +fetchComic().then((comic) => { + comicImage.src = comic.img + console.log(comic); +}); + + + diff --git a/programmer-humour/style.css b/programmer-humour/style.css new file mode 100644 index 00000000..363235f8 --- /dev/null +++ b/programmer-humour/style.css @@ -0,0 +1,10 @@ +body { + background-color: azure; +} + +#comic-img { + display: block; + margin-left: auto; + margin-right: auto; + width: 20%; +} \ No newline at end of file