This repository was archived by the owner on Apr 18, 2025. It is now read-only.
generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 83
NW-6 | Fikret Ellek | JS3| [TECH ED] Programmer Humour | WEEK-3 #309
Open
fikretellek
wants to merge
1
commit into
CodeYourFuture:main
Choose a base branch
from
fikretellek:programmerHumour-week3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Programmer Humour</title> | ||
| <link rel="stylesheet" href="style.css" /> | ||
| <script defer src="script.js"></script> | ||
| </head> | ||
| <body></body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| fetch("https://xkcd.now.sh/?comic=latest") | ||
| .then((response) => response.json()) | ||
| .then((data) => generateImg(data)); | ||
|
|
||
| function generateImg(data) { | ||
| const myCont = document.createElement("div"); | ||
|
|
||
| const myTitle = document.createElement("h3"); | ||
| myTitle.innerText = data.title; | ||
|
|
||
| const myDate = document.createElement("p"); | ||
| myDate.id = "date"; | ||
| myDate.innerText = `${data.day}/${data.month}/${data.year}`; | ||
|
|
||
| const myImg = document.createElement("img"); | ||
| myImg.setAttribute("src", data.img); | ||
| myImg.setAttribute("alt", data.safe_title); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice touch!!! |
||
|
|
||
| const mySummary = document.createElement("p"); | ||
| mySummary.innerText = data.alt; | ||
|
|
||
| myCont.append(myTitle, myDate, myImg, mySummary); | ||
|
|
||
| document.body.append(myCont); | ||
|
Comment on lines
+22
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is very clean, very readable, and also shows the correct use of the order of the |
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| * { | ||
| padding: 0px; | ||
| margin: 0px; | ||
| } | ||
| body { | ||
| background-color: black; | ||
| } | ||
|
|
||
| div { | ||
| width: 300px; | ||
| padding: 30px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 20px; | ||
| margin: 0px auto; | ||
| margin-top: 30px; | ||
| background-color: white; | ||
| align-items: center; | ||
| border-radius: 10px; | ||
|
|
||
| box-shadow: 5px 5px 5px 2px rgba(255, 255, 255, 0.34); | ||
|
|
||
| border: solid 1px black; | ||
| } | ||
| img { | ||
| width: auto; | ||
| } | ||
|
|
||
| #date { | ||
| align-self: flex-end; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have used semantic HTML elements well here, great work!