-
Notifications
You must be signed in to change notification settings - Fork 0
/
batches-selecter-updated.html
243 lines (206 loc) · 7.91 KB
/
batches-selecter-updated.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
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ansh Books</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
background-color: #f8f8f8;
color: #333;
}
header {
background-color: #fff;
text-align: center;
padding: 1em 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
header img {
max-width: 40px;
height: auto;
margin-right: 10px;
}
header h1 {
display: inline-block;
margin: 0;
color: #333;
}
.course-filters {
text-align: center;
margin: 20px 0;
}
.course-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 20px;
}
.course-card {
border: 1px solid #ddd;
border-radius: 8px;
margin: 10px;
padding: 20px;
background-color: #fff;
width: 300px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
align-items: center;
transition: transform 0.3s ease-in-out;
}
.course-card:hover {
transform: scale(1.05);
}
.course-card img {
max-width: 100%;
height: auto;
border-radius: 4px;
margin-bottom: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease-in-out;
}
.course-card:hover img {
transform: scale(1.1);
}
.course-card h2 {
text-align: center;
color: #007BFF;
margin-bottom: 15px;
}
select {
padding: 8px;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease-in-out;
}
select:hover {
background-color: #f2f2f2;
}
button {
background-color: #007BFF;
color: white;
border: none;
padding: 10px 15px;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease-in-out;
}
button:hover {
background-color: #0056b3;
}
.no-courses-found {
text-align: center;
margin-top: 20px;
}
.no-courses-found img {
max-width: 200px;
height: auto;
}
/* Animation styles */
.click-animation {
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #ff0000; /* Initial color, you can set it to any color */
animation: clickAnimation 0.5s ease-out;
pointer-events: none; /* Avoids interference with actual clicks */
}
@keyframes clickAnimation {
to {
transform: scale(5);
opacity: 0;
}
}
</style>
</head>
<body>
<header>
<img src="https://ansh-here.weebly.com/uploads/1/4/8/9/148906323/ansh_orig.png" alt="Ansh Books Logo">
<h1>Ansh Books</h1>
</header>
<div class="course-filters">
<label for="category">Filter by Category:</label>
<select id="category">
<option value="all">All</option>
<option value="technology">Technology</option>
<option value="education">Education</option>
<option value="business">Business</option>
<!-- Add more categories as needed -->
</select>
</div>
<section class="course-list">
<!-- Courses will be dynamically added here -->
</section>
<div class="no-courses-found" style="display: none;">
<p>No courses found</p>
<img src="https://cdn-icons-png.flaticon.com/512/2748/2748558.png" alt="No courses found">
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const courses = [
{ title: "Course 1", category: "technology", imageSrc: "https://raw.githubusercontent.com/Ansh-Yadav-maths-lover/Ansh-Books/main/neev-2.O.png", link:"https://anshbooks.weebly.com" },
{ title: "Course 2", category: "business", imageSrc: "https://raw.githubusercontent.com/Ansh-Yadav-maths-lover/Ansh-Books/main/neev-2.O.png", link: "https://example.com/course2" },
{ title: "Course 3", category: "technology", imageSrc: "https://raw.githubusercontent.com/Ansh-Yadav-maths-lover/Ansh-Books/main/neev-2.O.png", link: "https://example.com/course3" },
// Add more courses with their respective categories, image paths, and links
];
const courseList = document.querySelector(".course-list");
const noCoursesFound = document.querySelector(".no-courses-found");
const categoryFilter = document.getElementById("category");
// Function to filter courses based on the selected category
function filterCourses() {
const selectedCategory = categoryFilter.value;
// Clear existing courses
courseList.innerHTML = '';
noCoursesFound.style.display = 'none';
// Filter and display courses
const filteredCourses = courses.filter(course => selectedCategory === 'all' || course.category === selectedCategory);
if (filteredCourses.length === 0) {
noCoursesFound.style.display = 'block';
} else {
filteredCourses.forEach(course => {
const courseCard = document.createElement("div");
courseCard.classList.add("course-card");
const image = document.createElement("img");
image.src = course.imageSrc;
image.alt = course.title;
const title = document.createElement("h2");
title.textContent = course.title;
// Add click event listener to each course card
courseCard.addEventListener('click', () => {
// Redirect to the specified link when a course card is clicked
window.location.href = course.link;
});
courseCard.appendChild(image);
courseCard.appendChild(title);
courseList.appendChild(courseCard);
});
}
}
// Function to handle the click animation
function handleAnimation(event) {
const clickAnimation = document.createElement("div");
clickAnimation.classList.add("click-animation");
clickAnimation.style.left = `${event.clientX}px`;
clickAnimation.style.top = `${event.clientY}px`;
document.body.appendChild(clickAnimation);
// Remove the animation element after the animation completes
clickAnimation.addEventListener("animationend", () => {
clickAnimation.remove();
});
}
// Populate the course list initially
filterCourses();
// Add event listener for category filter changes
categoryFilter.addEventListener('change', filterCourses);
// Add event listener for click animation
document.addEventListener('click', handleAnimation);
});
</script>
</body>
</html>