-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.html
236 lines (193 loc) · 6.88 KB
/
main.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html>
<head>
<title>Job Internship Courses</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
background-color: #C060A1;
color: white;
text-align: center;
padding: 10px;
margin-bottom: 30px;
}
#course-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.course-card {
width: 300px;
background-color: #EDE4FF;
margin: 10px;
padding: 30px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
transition: transform 0.2s;
display: flex; /* Display icon and content in a row */
flex-direction: column; /* Stack icon and content vertically */
align-items: center;
text-align: center;
}
.course-card:hover {
transform: translateY(-5px);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.course-card h2 {
font-size: 1.5rem;
margin: 0;
color: #333;
}
.course-card p {
font-size: 1rem;
color: #555;
margin: 5px 0;
}
.icon {
font-size: 2rem; /* Increase icon size */
color: #1a73e8; /* Use the same bright blue as the header for icons */
margin-bottom: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.popup {
display: none; /* Hidden by default */
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
z-index: 999; /* Ensure the popup is on top */
}
.popup-content {
background-color: #fff;
padding: 20px;
border-radius: 5px;
width: 700px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.close-popup {
position: absolute;
top: 10px;
right: 10px;
font-size: 1.5rem;
cursor: pointer;
}
.applyButton {
background-color: #C060A1; /* Purple color */
color: white;
border: none;
padding: 5px 10px;
border-radius: 5px;
cursor: pointer;
font-size: 15px; /* Text color */
}
</style>
</head>
<body>
<header>
<h1>Available Courses </h1>
</header>
<section id="course-list">
</section>
<div id="course-popup" class="popup">
<div class="popup-content"style="background-color: #f8f8f8; padding: 20px; border-radius: 10px;display: flex; flex-direction: column; align-items: center;">
<span class="close-popup" onclick="closePopup()">×</span>
<h2 style="margin-bottom: 15px;">Course Application</h2>
<div style="display: flex; align-items: center;">
<img src="https://thumbs.dreamstime.com/b/tv-show-leader-asks-contestant-questions-vector-cartoon-quiz-intellectual-game-selects-winner-181539186.jpg" alt="Course Image" style="max-width: 50%; margin-right: 10px; border-radius: 5px;">
<p style="flex: 1; font-size: 25px; color: #1a73e8;"><b>
To enroll for this course, you will need to pass a basic quiz. </b></p><br>
</div>
<a href="quiz.html" style="display: inline-block; background-color: #1a73e8; color: white; padding: 10px 20px; border-radius: 5px; text-decoration: none; margin-top: 15px;">Start Quiz</a>
</div>
</div>
<script>
const courses = [
{
title: "Introduction to Web Development",
icon: "fa-laptop-code",
instructor: "John Doe",
duration: "4 weeks",
},
{
title: "Digital Marketing Fundamentals",
icon: "fa-chart-line",
instructor: "Jane Smith",
duration: "3 weeks",
},
{
title: "Data Science Basics",
icon: "fa-chart-bar",
instructor: "Michael Johnson",
duration: "5 weeks",
},
{
title: "UX Design Fundamentals",
icon: "fa-paint-brush",
instructor: "Emily Brown",
duration: "3 weeks",
},
{
title: "Project Management Essentials",
icon: "fa-tasks",
instructor: "David Lee",
duration: "4 weeks",
},
];
// Function to create a course card
function openPopup() {
const popup = document.getElementById("course-popup");
popup.style.display = "block";
}
function closePopup() {
const popup = document.getElementById("course-popup");
popup.style.display = "none";
}
function createCourseCard(course) {
const courseCard = document.createElement("div");
courseCard.className = "course-card";
const iconElement = document.createElement("i");
iconElement.className = "icon fas " + course.icon;
const titleElement = document.createElement("h2");
titleElement.textContent = course.title;
const instructorElement = document.createElement("p");
instructorElement.textContent = "Instructor: " + course.instructor;
const durationElement = document.createElement("p");
durationElement.textContent = "Duration: " + course.duration;
const applyButton = document.createElement("button");
applyButton.textContent = "Apply Now";
applyButton.className = "applyButton";
applyButton.addEventListener("click", openPopup);
courseCard.appendChild(iconElement);
courseCard.appendChild(titleElement);
courseCard.appendChild(instructorElement);
courseCard.appendChild(durationElement);
courseCard.appendChild(applyButton);
return courseCard;
}
// Function to display courses on the webpage
function displayCourses() {
const courseList = document.getElementById("course-list");
courseList.innerHTML = ""; // Clear existing content
courses.forEach(course => {
const courseCard = createCourseCard(course);
courseList.appendChild(courseCard);
});
}
// Call the displayCourses function when the page loads
window.addEventListener("load", displayCourses);
</script>
</body>
</html>