-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
131 lines (112 loc) · 3.14 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Convention Voting App Testing Reports</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
<style>
body {
font-family: Roboto, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
}
header {
background-color: #343434;
color: #fff;
padding: 25px 0;
text-align: center;
}
h1 {
font-size: 2em;
margin-bottom: 10px;
}
main {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 40px;
}
.card-container {
display: flex;
flex-direction: column;
align-items: center;
}
.card {
display: flex;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
margin: 15px;
padding: 20px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.3s ease;
width: 350px;
box-sizing: border-box;
}
.card h4 {
margin: 0;
}
.card:hover {
background-color: #eef2f8;
transform: translateY(-3px);
}
.card i {
margin-left: auto;
color: #999;
}
</style>
</head>
<body>
<header>
<h1>GovTool Test Reports</h1>
<p>A list of Test reports of govtool</p>
</header>
<main id="main-content">
<div id="project-list" class="card-container"></div>
</main>
<script>
document.addEventListener("DOMContentLoaded", function () {
fetchAllProjects().then((projects) => renderProjectList(projects));
});
async function fetchAllProjects() {
const res = await fetch(
"./projects.txt",
{
headers: {
Accept: "text/plain",
},
}
);
const data = await res.text();
return data.split("\n").filter((e) => e != "");
}
function navigateToReport(reportName) {
window.location.href = `./${reportName}`;
}
function renderProjectList(projects) {
const projectListContainer = document.getElementById("project-list");
projectListContainer.innerHTML = "";
projects.forEach((project) => {
const projectItem = document.createElement("div");
projectItem.classList.add("card");
projectItem.onclick = function () {
navigateToReport(project);
};
const projectName = document.createElement("h4");
projectName.textContent = project;
const chevronIcon = document.createElement("i");
chevronIcon.classList.add("fas", "fa-chevron-right");
projectItem.appendChild(projectName);
projectItem.appendChild(chevronIcon);
projectListContainer.appendChild(projectItem);
});
}
</script>
</body>
</html>