-
Notifications
You must be signed in to change notification settings - Fork 0
/
new.html
381 lines (328 loc) · 13.1 KB
/
new.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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<!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: 100vh;
overflow: hidden;
background: url('https://www.suntiros.com/wp-content/uploads/2016/12/Shah-Rukh-Khan.jpg') center/cover no-repeat fixed;
color: #fff;
text-align: center;
padding: 3em;
transition: height 0.5s ease-out;
/* Added transition for smooth height change */
}
header h1 {
margin: 0;
font-size: 3em;
}
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: 20px;
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: 300px;
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: 10px;
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: 100px;
margin: 5px;
cursor: pointer;
}
.widget img {
width: 50px;
/* Adjust the width of the widget images */
height: 50px;
/* 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%;
}
}
</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>
<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
// Touch events for smooth scrolling of the second part
var startY, currentY, dist, isScrolling;
section.addEventListener('touchstart', function (e) {
startY = e.touches[0].clientY;
isScrolling = undefined;
});
section.addEventListener('touchmove', function (e) {
if (startY === undefined) return;
currentY = e.touches[0].clientY;
dist = currentY - startY;
if (Math.abs(dist) < 5) {
isScrolling = false;
return;
}
isScrolling = true;
if (dist > 0 && scrollPos > 0) {
// Scrolling up
window.scrollBy(0, -dist);
} else if (dist < 0 && scrollPos < section.scrollHeight - window.innerHeight) {
// Scrolling down
window.scrollBy(0, -dist);
}
});
section.addEventListener('touchend', function () {
if (isScrolling === undefined) return;
// If the user released the touch, scroll to the nearest position
var remainder = scrollPos % window.innerHeight;
if (remainder > window.innerHeight / 2) {
window.scrollTo({
top: scrollPos + window.innerHeight - remainder,
behavior: 'smooth'
});
} else {
window.scrollTo({
top: scrollPos - remainder,
behavior: 'smooth'
});
}
});
});
// 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>