Skip to content

Commit 7aff516

Browse files
Merge pull request #1 from vistula-team-project-79822/feature/team-contribution
Add contributor page - 79822
2 parents 6ce0e03 + e4d394f commit 7aff516

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

‎contribution.html‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Team Contribution</title>
7+
<style>
8+
body {
9+
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
10+
max-width: 640px;
11+
margin: 0 auto;
12+
padding: 2.5rem 1.25rem;
13+
line-height: 1.5;
14+
}
15+
button { font: inherit; padding: 0.45rem 0.9rem; cursor: pointer; }
16+
#contributor-student-id { margin: 1rem 0; font-weight: bold; }
17+
</style>
18+
</head>
19+
<body>
20+
<h1>Team Contribution</h1>
21+
22+
<button id="load-contributor" type="button">Show Contributor</button>
23+
24+
<p id="contributor-student-id"></p>
25+
26+
<p><a href="index.html">Back to Task Manager</a></p>
27+
28+
<script>
29+
const button = document.getElementById("load-contributor");
30+
const output = document.getElementById("contributor-student-id");
31+
32+
button.addEventListener("click", async () => {
33+
try {
34+
const response = await fetch("contribution.json", { cache: "no-store" });
35+
if (!response.ok) {
36+
throw new Error("Could not load contribution.json (HTTP " + response.status + ").");
37+
}
38+
const data = await response.json();
39+
output.textContent = "Contributor Student ID: " + data.contributorStudentId;
40+
} catch (error) {
41+
output.textContent = error.message;
42+
}
43+
});
44+
</script>
45+
</body>
46+
</html>

‎contribution.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"contributorStudentId":"79822"}

0 commit comments

Comments
 (0)