-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
122 lines (106 loc) · 3.38 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My GitHub Repository Files</title>
<style>
/* General Styles */
body {
font-family: Arial, sans-serif;
background-image: url('./new-york-pixel.jpg'); /* Replace with background image file */
background-size: cover;
background-attachment: fixed;
color: white;
text-align: center;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
}
/* Container Styling */
.container {
max-width: 800px;
width: 100%;
background-color: rgba(125, 125, 125, 0.8);
border-radius: 10px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
/* Header Styling */
header {
padding: 20px;
text-align: center;
}
#avatar {
border-radius: 50%;
width: 150px;
height: 150px;
margin-top: 10px;
border: 3px solid #333;
}
/* File List Button Styles */
.file-list {
margin: 20px 0;
text-align: center;
}
.file-item a {
display: inline-block;
padding: 10px 20px;
margin: 5px 0;
background-color: rgba(93, 93, 93, 0.8);
color: white;
border-radius: 5px;
text-decoration: none;
transition: background-color 0.3s;
}
.file-item a:hover {
background-color: rgba(0, 86, 179, 0.8); /* Adjust hover effect contrast */
}
/* Footer Styling */
footer {
padding: 10px;
font-size: 0.9em;
color: white;
margin-top: 20px;
}
</style>
</head>
<body onload="Filelist()">
<!-- Main Content Wrapper -->
<div class="container">
<!-- Header Section -->
<header>
<h1>Welcome to My GitHub Repository</h1>
<p>Hello! Here are the files from my project repository. Feel free to explore the contents!</p>
<img id="avatar" src="./pixel-heart.jpg" alt="My Avatar"> <!-- Replace with avatar image file -->
</header>
<!-- File List Section -->
<div class="file-list" id="files">
<!-- JavaScript will dynamically add file links here -->
</div>
<!-- Footer Section -->
<footer>
<p>Ralph Wakim - 2024</p>
</footer>
</div>
<script>
function Filelist() {
var htmlString = "";
// Fetch the list of files from the GitHub API
(async () => {
const response = await fetch("https://api.github.com/repos/rlphwkm/SD330/contents/");
const data = await response.json();
// Loop through the list of files and generate clickable links
for (let file of data) {
const fname = file.name;
const fpath = "https://rlphwkm.github.io/SD330/" + fname;
htmlString += `<p class="file-item"><a href="${fpath}" target="_blank">${fname}</a></p>`;
}
document.getElementById('files').innerHTML = htmlString;
})();
}
</script>
</body>
</html>