-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
145 lines (125 loc) · 4.06 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loading...</title>
<style>
/* Dark theme styles */
body {
font-family: Arial, sans-serif;
background-color: #121212;
color: #ffffff;
margin: 20px;
}
h1 {
color: #ffcc00;
}
.repo {
border: 1px solid #444;
background-color: #1e1e1e;
padding: 15px;
margin-bottom: 15px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}
.repo h2 {
margin: 0;
color: #ffcc00;
}
.repo p {
color: #aaa;
}
.contributors {
margin-top: 10px;
}
.contributor {
display: inline-block;
margin-right: 10px;
}
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
border: 2px solid #444;
}
.repo_title {
color: #ffffff;
}
.contributor a {
color: #ffcc00;
text-decoration: none;
font-size: 14px;
}
.contributor a:hover {
text-decoration: underline;
}
#loading {
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: #ffcc00;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.spinner {
border: 4px solid #444;
border-top: 4px solid #ffcc00;
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 1s linear infinite;
margin-left: 10px;
}
</style>
</head>
<body>
<h1 id="page-title">Loading...</h1>
<div id="repositories"></div>
<script>
var title = `SET_TITLE`;
var repos = SET_REPO_JSON;
document.title = title;
document.getElementById("page-title").innerText = title;
const reposContainer = document.getElementById("repositories");
const loadingIndicator = document.getElementById("loading");
for (const repo of repos) {
const repoDiv = document.createElement("div");
repoDiv.className = "repo";
repoDiv.innerHTML = `
<div style="display: flex; align-items: center; gap: 8px;">
<h2 style="margin: 0;">
<a class="repo_title" href="${repo.owner_url}" target="_blank" style="text-decoration: none; color: inherit;">${repo.owner}</a>
</h2>
<span>/</span>
<h2 style="margin: 0;">
<a class="repo_title" href="${repo.html_url}" target="_blank" style="text-decoration: none; color: inherit;">${repo.name}</a>
</h2>
</div>
<p>${repo.description || "No description"}</p>
`;
const contributorsDiv = document.createElement("div");
contributorsDiv.className = "contributors";
contributorsDiv.innerHTML = "<strong>Contributors:</strong>";
for (const contributor of repo.contributorsList || []) {
const contributorDiv = document.createElement("div");
contributorDiv.className = "contributor";
contributorDiv.innerHTML = `
<img src="${contributor.avatar_url}" alt="${contributor.login}" class="avatar">
<a href="${contributor.html_url}" target="_blank">${contributor.login}</a>
`;
contributorsDiv.appendChild(contributorDiv);
}
repoDiv.appendChild(contributorsDiv);
reposContainer.appendChild(repoDiv);
}
</script>
</body>
</html>