-
Notifications
You must be signed in to change notification settings - Fork 0
/
2nd.html
347 lines (301 loc) · 12.3 KB
/
2nd.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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Professional Courses</title>
<style>
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
background-color: #f8f8f8;
overflow-x: hidden;
/* Disable horizontal scrolling */
}
header {
position: relative;
height: 50vh; /* Adjusted header height for better visibility on small screens */
overflow: hidden;
background: #000; /* Background color instead of image */
color: #fff;
text-align: center;
padding: 1.5em; /* Adjusted padding for better visibility on small screens */
transition: height 0.5s ease-out;
/* Added transition for smooth height change */
}
header h1 {
margin: 0;
font-size: 2em; /* Adjusted font size for better visibility on small screens */
}
header .overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: -1;
}
.fixed-header {
position: fixed;
top: 0;
left: 0;
width: 100%;
padding: 1em;
background: rgba(0, 0, 0, 0.7);
color: #fff;
text-align: center;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
/* Center the content horizontally */
opacity: 0;
transition: opacity 0.5s ease-out;
/* Added transition for smooth opacity change */
}
.logo {
width: 40px;
/* Adjust the width of the logo as needed */
margin-right: 10px;
/* Add some space between the logo and text */
}
section {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
padding: 10px; /* Adjusted padding for better spacing on small screens */
margin-top: 0;
/* Updated margin-top to 0 */
background-color: #fff;
/* Background color for the content section */
transition: margin-top 0.5s ease-out;
/* Added transition for smooth margin-top change */
}
.course {
position: relative;
width: 100%; /* Adjusted width for better responsiveness on small screens */
height: 200px;
margin: 20px;
overflow: hidden;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out, opacity 0.5s ease-in-out;
cursor: pointer;
}
.course:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
transform: scale(1.05);
}
.course img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease-in-out;
}
.course-info {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 1em;
background: rgba(0, 0, 0, 0.7);
color: #fff;
text-align: center;
opacity: 0;
transition: opacity 0.3s ease-in-out;
}
.course:hover .course-info {
opacity: 1;
}
.course h3 {
margin: 0;
}
.widgets-section {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: space-around;
padding: 5px; /* Adjusted padding for better spacing on small screens */
background-color: #f0f0f0;
z-index: 3;
/* Ensure widgets appear above other content */
}
.widget {
text-align: center;
padding: 5px;
border: 1px solid #ccc;
border-radius: 5px;
width: 80px; /* Adjusted width for better spacing on small screens */
margin: 5px;
cursor: pointer;
}
.widget img {
width: 40px; /* Adjust the width of the widget images */
height: 40px; /* Adjust the height of the widget images */
}
/* Typewriter animation */
header h2 span {
border-right: 2px solid #fff;
padding-right: 5px;
animation: typewriter 1s steps(20) infinite;
}
@keyframes typewriter {
from {
width: 0;
}
to {
width: 100%;
}
}
/* Add a media query for smaller screens (mobile devices) */
@media only screen and (max-width: 600px) {
.course {
width: 100%; /* Adjusted width for better responsiveness on small screens */
}
.widget {
width: 60px; /* Adjusted width for better spacing on small screens */
}
}
</style>
</head>
<body>
<div class="fixed-header">
<img class="logo" src="https://ansh-here.weebly.com/uploads/1/4/8/9/148906323/ansh_orig.png" alt="Ansh Logo">
<h2>Ansh Books</h2>
</div>
<header>
<video muted loop playsinline poster="poster.jpg">
<source src="https://supportmailcos.000webhostapp.com/pexels-peggy-anke-5614746%20(1080p).mp4"
type="video/mp4">
Your browser does not support the video tag.
</video>
<h2>By <span id="authorName"></span></h2>
<h2>(Just Scroll)</h2>
<div class="overlay"></div>
</header>
<section>
<div class="course" data-url="https://anshbooks.weebly.com" onclick="redirectTo(this)">
<img src="https://anshbooks.weebly.com/uploads/1/4/7/8/147853174/337215214_orig.png" alt="Course 1">
<div class="course-info">
<h3>Course 1</h3>
<!-- Additional course information can be added here -->
</div>
</div>
<div class="course" data-url="https://anshbooks.weebly.com" onclick="redirectTo(this)">
<img src="https://anshbooks.weebly.com/uploads/1/4/7/8/147853174/337215214_orig.png" alt="Course 2">
<div class="course-info">
<h3>Course 2</h3>
<!-- Additional course information can be added here -->
</div>
</div>
<div class="course" data-url="https://anshbooks.weebly.com" onclick="redirectTo(this)">
<img src="https://anshbooks.weebly.com/uploads/1/4/7/8/147853174/337215214_orig.png" alt="Course 3">
<div class="course-info">
<h3>Course 3</h3>
<!-- Additional course information can be added here -->
</div>
</div>
<!-- Add more courses as needed -->
</section>
<!-- Widgets Section -->
<div class="widgets-section">
<div class="widget" data-url="https://supportmailcos.000webhostapp.com/chos.html" onclick="redirectTo(this)">
<img src="https://ansh-here.weebly.com/uploads/1/4/8/9/148906323/a_orig.png" alt="Batches">
</div>
<div class="widget" data-url="https://example.com/widget2" onclick="redirectTo(this)">
<img src="https://ansh-here.weebly.com/uploads/1/4/8/9/148906323/b_orig.png" alt="Practice">
</div>
<div class="widget" data-url="https://example.com/widget3" onclick="redirectTo(this)">
<img src="https://ansh-here.weebly.com/uploads/1/4/8/9/148906323/d_orig.png" alt="Home">
</div>
<div class="widget" data-url="https://example.com/widget4" onclick="redirectTo(this)">
<img src="https://ansh-here.weebly.com/uploads/1/4/8/9/148906323/c_orig.png" alt="Study Stuff">
</div>
<div class="widget" data-url="https://example.com/widget5" onclick="redirectTo(this)">
<img src="https://ansh-here.weebly.com/uploads/1/4/8/9/148906323/e_orig.png" alt="Contact Us">
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
var widgetsSection = document.querySelector('.widgets-section');
var scrollPos = window.scrollY;
var header = document.querySelector('header');
var section = document.querySelector('section');
var fixedHeader = document.querySelector('.fixed-header');
var clickableElements = document.querySelectorAll('.course, .widget');
var authorName = document.getElementById('authorName');
var authorText = "Ansh Books";
var index = 0;
var hasScrolled = false; // Flag to track if the automatic scroll has occurred
// Initially hide the widgets
widgetsSection.style.bottom = '-70px';
// Add scroll event listener with debouncing
var scrollTimeout;
document.addEventListener('scroll', function () {
clearTimeout(scrollTimeout);
scrollTimeout = setTimeout(function () {
scrollPos = window.scrollY;
// Show/hide widgets based on scroll position
widgetsSection.style.bottom = scrollPos > 300 ? '0' : '-70px';
// Parallax effect for header background image
header.style.backgroundPositionY = -scrollPos * 0.1 + 'px'; // Adjust the factor for parallax
header.style.opacity = 1 - scrollPos / (header.offsetHeight / 2);
// Adjust the background image size on scroll for a smoother effect
var scale = 1 + scrollPos / 1000;
header.style.backgroundSize = `calc(100% + ${scrollPos * 0.5}px)`;
section.style.marginTop = -scrollPos / 2 + 'px';
// Show/hide fixed header based on scroll position
fixedHeader.style.opacity = scrollPos > header.offsetHeight / 2 ? '1' : '0';
// Check course visibility
checkVisibility();
}, 100); // Adjust the debounce time as needed
});
// Initial check on page load
checkVisibility();
// Add click event listener to each clickable element
clickableElements.forEach(function (clickableElement) {
clickableElement.addEventListener('click', function () {
// Get the URL from the "data-url" attribute
var url = clickableElement.getAttribute('data-url');
// Redirect to the URL
window.location.href = url;
});
});
// Typewriter effect
function typeWriter() {
if (index < authorText.length) {
authorName.innerHTML += authorText.charAt(index);
index++;
setTimeout(typeWriter, 150); // Adjust the typing speed here
} else if (!hasScrolled) {
// Typewriter effect completed, trigger automatic scroll (once)
setTimeout(function () {
window.scrollTo({
top: section.offsetTop, // Adjust this value as needed
behavior: 'smooth'
});
hasScrolled = true; // Update the flag
}, 1000); // Adjust the delay for the automatic scroll
}
}
// Trigger the typewriter effect after a short delay
setTimeout(typeWriter, 500); // Delay set to 500 milliseconds
});
// Function to check course visibility
function checkVisibility() {
var courses = document.querySelectorAll('.course');
courses.forEach(function (course) {
var rect = course.getBoundingClientRect();
if (rect.top < window.innerHeight && rect.bottom >= 0) {
course.classList.add('animated');
}
});
}
</script>
</body>
</html>