Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

add portofolio #430

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions Intermediate Level πŸ“/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Joy Boy ID",
"country": "Indonesia",
"usergithub": "joyboyid"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions Intermediate Level πŸ“/joyboyid/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bio</title>
</head>
<body>
<table width="100%">
<tr>
<td align="center">
<img src="./img/free-bsd.png" height="300" width="300" />
<p><a href="https://www.joyboy-project.tech/">Portofolio</a></p>
<div id="dataDisplay">
<!-- JSON data will be displayed here -->
</div>
</td>
</tr>
</table>
</body>
<script src="js/script.js"></script>
</html>
23 changes: 23 additions & 0 deletions Intermediate Level πŸ“/joyboyid/js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
document.addEventListener("DOMContentLoaded", function () {
fetch("/Intermediate Level πŸ“/data.json")
.then((response) => response.json())
.then((data) => {
const dataDisplay = document.getElementById("dataDisplay");

// Create HTML elements to display the JSON data
const nameElement = document.createElement("p");
nameElement.textContent = "Name: " + data.name;

const countryElement = document.createElement("p");
countryElement.textContent = "Country: " + data.country;

const ghElement = document.createElement("p");
ghElement.textContent = "Gh Username:" + data.usergithub;

// Append the elements to the "dataDisplay" div
dataDisplay.appendChild(nameElement);
dataDisplay.appendChild(countryElement);
dataDisplay.appendChild(ghElement);
})
.catch((error) => console.error("Error fetching JSON data:", error));
});