-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (60 loc) · 1.75 KB
/
index.html
File metadata and controls
62 lines (60 loc) · 1.75 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Projects</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin: 50px;
background-color: #f4f4f4;
}
h1 {
font-size: 3em;
margin-bottom: 20px;
color: #333;
}
ul {
list-style-type: none;
padding: 0;
}
li {
margin: 10px 0;
}
a {
text-decoration: none;
font-size: 1.5em;
color: #3498db;
transition: color 0.3s ease;
}
a:hover {
color: #2c3e50;
}
</style>
</head>
<body>
<h1>Welcome to My Projects</h1>
<ul id="projects-list">
<!-- Links will be inserted here by the script below -->
</ul>
<script>
// Project folders will be added dynamically by the server (Express.js)
fetch('/projects')
.then(response => response.json())
.then(projects => {
const list = document.getElementById('projects-list');
projects.forEach(project => {
const listItem = document.createElement('li');
const link = document.createElement('a');
link.href = `/${project}`;
link.textContent = project.replace('_', ' ').toUpperCase();
listItem.appendChild(link);
list.appendChild(listItem);
});
})
.catch(error => console.error('Error fetching project list:', error));
</script>
</body>
</html>