-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
180 lines (158 loc) · 6.43 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="distribution" content="global">
<meta name="rating" content="general">
<meta name="robots" content="index, follow">
<meta name="revisit-after" content="monthly">
<meta http-equiv="cache-control" content="no-cache">
<title></title>
<style>
body {
font-family: Tahoma, Ubuntu, 'Trebuchet MS', Geneva, Verdana, sans-serif;
background-color: #6600FF;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
header {
background-color: #007BF;
color: white;
width: 100%;
padding: 1rem 0;
margin-bottom: 2rem;
}
h1 {
font-family: Acme, Tahoma, Ubuntu, 'Trebuchet MS', sans-serif;
margin: 0;
font-size: 2rem;
}
h2 {
font-family: Tahoma, Ubuntu, 'Trebuchet MS', sans-serif;
margin: 0;
font-size: 1.0rem;
}
ul {
list-style-type: none;
padding: 0;
margin: 0 auto;
width: 90%;
max-width: 600px;
white-space: pre-wrap;
word-wrap: break-word;
overflow-x: hidden;
}
li {
margin: 0.8rem 0;
padding: 0.5rem 0.8rem;
background: #ffffff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
a {
text-decoration: none;
color: #6600FF;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}
.buttons {
margin-top: 2rem;
display: flex;
gap: 1rem;
justify-content: center;
}
button {
padding: 15px 20px;
background-color: #ffffff;
color: #6600FF;
font-size: 15px;
font-weight: bold;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.5s ease;
}
button:hover {
background-color: #FFFFFF;
color: #0066FF;
transition: background-color 0.5s ease;
}
</style>
</head>
<body>
<header>
<h1 id="developer-name"></h1>
<h2>Live Repository Sites</h2>
</header>
<ul id="sites-list"></ul>
<div class="buttons">
<button id="github-profile" onclick="openProfile()">GitHub Profile</button>
<button id="profile-website" onclick="openWebsite()">Homepage</button>
</div>
<script>
// GitHub.io Homepage
// It shows the list of all Live Repository Sites. After hosting on https://username.github.io you can forget about it, as the list and other information will be updated automatically.
// developed by Tawhidur Rahman Dear, https://www.tawhidurrahmandear.com
// Live Preview available at https://tawhidurrahmandear.github.io
// SourceCode available at https://github.com/tawhidurrahmandear/tawhidurrahmandear.github.io
// Released under GPL-3.0 license on GitHub
const username = "tawhidurrahmandear"; // Replace with your GitHub username
fetch(`https://api.github.com/users/${username}`)
.then(response => response.json())
.then(user => {
const developerName = user.name || user.login;
document.title = developerName + " - GitHub Repositories";
document.getElementById("developer-name").textContent = developerName;
const profileButton = document.getElementById("github-profile");
const websiteButton = document.getElementById("profile-website");
profileButton.textContent = `GitHub Profile`;
profileButton.onclick = () => window.open(user.html_url, "_blank");
if (user.blog) {
websiteButton.textContent = `Homepage`;
websiteButton.onclick = () => window.open(user.blog, "_blank");
} else {
websiteButton.textContent = "No Website Linked";
websiteButton.disabled = true;
websiteButton.style.backgroundColor = "#999";
}
})
.catch(error => console.error("Error fetching user data:", error));
fetch(`https://api.github.com/users/${username}/repos`)
.then(response => response.json())
.then(repos => {
const sitesList = document.getElementById("sites-list");
repos.forEach(repo => {
// Exclude the two specific repositories: "username.github.io" and "username.github.io/username"
if (
repo.has_pages &&
repo.name.toLowerCase() !== `${username.toLowerCase()}` && // Exclude "username" repository
repo.name.toLowerCase() !== `${username.toLowerCase()}.github.io` // Exclude "username.github.io"
) {
const listItem = document.createElement("li");
const link = document.createElement("a");
link.href = `https://${username}.github.io/${repo.name}`;
link.target = "_blank";
link.textContent = repo.name;
listItem.appendChild(link);
sitesList.appendChild(listItem);
}
});
})
.catch(error => console.error("Error fetching repositories:", error));
// Step 1 : Go to https://github.com, and create a new repository or rename existing one as "username.github.io" - Your GitHub username
// Step 2 : For example, if tawhidurrahmandear is the username, the repository name will be exact tawhidurrahmandear.github.io
// Step 3 : Open index.html, go to line 116, or find by"const username". Now simply replace the username "tawhidurrahmandear" with your GitHub username
// Step 4 : Save the index.html file, and upload to the recently created/renamed repository on Github.com
// Step 5 : You don't need to do anything else, it will be LIVE automatically within 2 minutes. After that, you can forget about it, as the list and other information will be updated automatically
</script>
</body>
</html>