-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
143 lines (138 loc) · 4.42 KB
/
index.html
File metadata and controls
143 lines (138 loc) · 4.42 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My GitHub Repositories</title>
<style>
html {
scroll-behavior: smooth;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: url('background.jpg') no-repeat center center fixed;
background-size: cover;
margin: 0;
padding: 0;
color: #fff;
}
.container {
max-width: 800px;
margin: 50px auto;
padding: 20px;
background-color: rgba(255, 255, 255, 0.9);
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
border-radius: 12px;
overflow-y: auto;
max-height: 80vh;
}
.container::-webkit-scrollbar {
display: none;
}
.container {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
h1 {
text-align: center;
color: #333;
font-size: 2em;
margin-bottom: 20px;
}
ul {
list-style-type: none;
padding: 0;
}
li {
margin: 15px 0;
padding: 10px;
background-color: #f9f9f9;
border-radius: 8px;
transition: transform 0.3s, box-shadow 0.3s;
opacity: 0;
transform: translateY(20px);
}
li.visible {
opacity: 1;
transform: translateY(0);
}
li:hover {
transform: translateY(-5px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
a {
text-decoration: none;
color: #007bff;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}
.repo-info {
margin-top: 5px;
font-size: 0.9em;
color: #555;
}
@media (max-width: 600px) {
.container {
margin: 20px;
padding: 15px;
}
h1 {
font-size: 1.5em;
}
.repo-info {
font-size: 0.8em;
}
}
</style>
</head>
<body>
<div class="container">
<h1>My GitHub Repositories</h1>
<ul id="repo-list">
<!-- Repositories will be dynamically added here -->
</ul>
</div>
<script>
async function fetchRepositories() {
const response = await fetch('https://api.github.com/users/itsmehecker/repos');
const repos = await response.json();
const repoList = document.getElementById('repo-list');
repos.forEach(repo => {
const listItem = document.createElement('li');
const link = document.createElement('a');
link.href = repo.html_url;
link.target = '_blank';
link.textContent = repo.name;
listItem.appendChild(link);
const repoInfo = document.createElement('div');
repoInfo.className = 'repo-info';
repoInfo.textContent = `Stars: ${repo.stargazers_count} | Forks: ${repo.forks_count} | Updated: ${new Date(repo.updated_at).toLocaleDateString()}`;
listItem.appendChild(repoInfo);
repoList.appendChild(listItem);
});
// Make all list items visible after they are added
const listItems = repoList.getElementsByTagName('li');
for (let i = 0; i < listItems.length; i++) {
listItems[i].classList.add('visible');
}
}
fetchRepositories();
window.addEventListener('scroll', () => {
const repoList = document.getElementById('repo-list');
const repos = repoList.getElementsByTagName('li');
const windowHeight = window.innerHeight;
for (let i = 0; i < repos.length; i++) {
const repo = repos[i];
const rect = repo.getBoundingClientRect();
if (rect.top >= 0 && rect.bottom <= windowHeight) {
repo.classList.add('visible');
} else {
repo.classList.remove('visible');
}
}
});
</script>
</body>
</html>