-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,57 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>My Bucket List</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div class="bucket container"> | ||
<h1>DK's Bucket List</h1> | ||
<ul> | ||
<!-- Add more items as needed --> | ||
</ul> | ||
</div> | ||
</body> | ||
<script> | ||
const bucket = { | ||
gobekliTepe: { | ||
name: "Gobekli Tepe", | ||
location: "Turkey", | ||
description: "The world's oldest known temple.", | ||
url: "https://en.wikipedia.org/wiki/G%C3%B6bekli_Tepe", | ||
bucketEntryTitle: "Visit Gobekli Tepe", | ||
}, | ||
tuvalu_islands: { | ||
name: "Tuvalu Islands", | ||
location: "Tuvalu", | ||
description: "A group of nine islands in the Pacific Ocean.", | ||
url: "https://en.wikipedia.org/wiki/Tuvalu", | ||
bucketEntryTitle: "Visit Tuvalu Islands", | ||
}, | ||
} | ||
|
||
const bucketList = document.querySelector('.bucket ul'); | ||
|
||
for (const item in bucket) { | ||
const listItem = document.createElement('li'); | ||
const bucketEntry = document.createElement('a'); | ||
bucketEntry.href = bucket[item].url; | ||
bucketEntry.textContent = bucket[item].bucketEntryTitle; | ||
|
||
listItem.appendChild(bucketEntry); | ||
bucketList.appendChild(listItem); | ||
for (const key in bucket[item]) { | ||
const bucketDetail = document.createElement('p'); | ||
if (key !== 'bucketEntryTitle' && key !== 'url') { | ||
bucketDetail.textContent = `${key}: ${bucket[item][key]}`; | ||
}else{ | ||
bucketEntry.textContent = bucket[item][key]; | ||
} | ||
listItem.appendChild(bucketDetail); | ||
} | ||
} | ||
|
||
</script> | ||
</html> |
This file contains 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 |
---|---|---|
|
@@ -89,4 +89,8 @@ height: auto; | |
width: 90%; | ||
margin: 50px auto; | ||
} | ||
} | ||
|
||
.bucket { | ||
color: #d9d7d6; | ||
} |