Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Js core 3/week 2/berhane #39

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
programmer humour completed
  • Loading branch information
bireworld committed Sep 15, 2020
commit 75dc974f20f9d0e576d3e9e78743a986e3b57dab
13 changes: 13 additions & 0 deletions week-2/Homework/mandatory/4-programmer-humour/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>

<body>
<script src="script.js"></script>
</body>

</html>
11 changes: 11 additions & 0 deletions week-2/Homework/mandatory/4-programmer-humour/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fetch("https://xkcd.now.sh/?comic=latest")
.then((data) => data.json())
.then((joke) => {
let jokeDiv = document.createElement("div");
jokeDiv.innerHTML = `<img src = ${joke.img}>`;
document.body.appendChild(jokeDiv);
})
.catch((err) => console.log(err));
document.body.style.display = "flex";
document.body.style.justifyContent = "center";
document.body.style.paddingTop = "50px";