forked from MFM-347/Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
165 lines (142 loc) · 5.3 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Code By MFM</title>
<link rel="stylesheet" href="./public/base.css" />
<link rel="stylesheet" href="https://unpkg.com/bootstrap/dist/css/bootstrap.min.css" />
<style>
body {
background-color: #eef2f7;
}
h1 {
color: #333;
}
.navbar {
background-color: #343a40;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.navbar-nav .nav-link {
color: #ffffff;
font-weight: 500;
}
.navbar-nav .nav-link:hover {
color: #ffc107;
text-decoration: underline;
}
.navbar-brand {
font-size: 1.5rem;
color: #ffc107;
}
.navbar-toggler {
background-color: #ffc107;
}
.navbar-toggler-icon {
background-image: url("data:image/svg+xml;...");
}
.bgc {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
margin: 0;
padding: 1.25rem 0.75rem;
}
.card {
background: #ffffff;
width: 95%;
border: none;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
border-radius: 12px;
transition: all 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}
.card-title {
font-weight: 600;
color: #333;
}
.card-text {
font-weight: 300;
color: #666;
}
.btn-outline-primary {
margin-top: 10px;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg">
<div class="container">
<a class="navbar-brand" href="#">Code By MFM</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Projects</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<h1 class="text-center display-5 fw-semibold my-3">Code By MFM</h1>
<div class="bgc row" id="projects-container"></div>
<script>
fetch("./public/projects.json")
.then((response) => {
if (!response.ok) {
throw new Error("Network response was not ok");
}
return response.json();
})
.then((data) => {
const projectsContainer = document.getElementById("projects-container");
data.forEach((project) => {
const colDiv = document.createElement("div");
colDiv.className = "col-md-4 mb-4";
const cardDiv = document.createElement("div");
cardDiv.className = "card p-3 h-100";
const cardBody = document.createElement("div");
cardBody.className = "card-body";
const cardTitle = document.createElement("h5");
cardTitle.className = "card-title";
cardTitle.textContent = project.title;
const cardText = document.createElement("p");
cardText.className = "card-text";
cardText.textContent = project.description;
const cardLink = document.createElement("a");
cardLink.className = "btn btn-outline-primary";
cardLink.href = project.link;
cardLink.textContent = "Visit";
cardBody.appendChild(cardTitle);
cardBody.appendChild(cardText);
cardBody.appendChild(cardLink);
cardDiv.appendChild(cardBody);
colDiv.appendChild(cardDiv);
projectsContainer.appendChild(colDiv);
});
})
.catch((error) => {
console.error("Error loading the project details:", error);
const errorMessage = document.createElement("p");
errorMessage.textContent = "Failed to load project details. Please try again later.";
document.getElementById("projects-container").appendChild(errorMessage);
});
</script>
<script src="https://unpkg.com/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>