forked from anuragverma108/SwapReads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
audiobook.html
843 lines (779 loc) · 23 KB
/
audiobook.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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="./assets/favicon_package_v0.16/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./assets/favicon_package_v0.16/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="./assets/favicon_package_v0.16/favicon-16x16.png"
/>
<link
rel="manifest"
href="./assets/favicon_package_v0.16/site.webmanifest"
/>
<link
rel="mask-icon"
href="./assets/favicon_package_v0.16/safari-pinned-tab.svg"
color="#5bbad5"
/>
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
integrity="sha512-Fo3rlrZj/k7ujTnHg4CGR2D7kSs0v4LLanw2qksYuRlEzO+tcaEPQogQ0KaoGN26/zrn20ImR1DfuLWnOo7aBA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Philosopher:wght@400;700&family=Poppins:wght@400;500;600&display=swap"
rel="stylesheet"
/>
<link rel="preload" as="image" href="./assets/images/hero-banner.png" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<script src="https://cdn.jsdelivr.net/gh/studio-freight/lenis@1.0.27/bundled/lenis.min.js"></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script src="https://cdn.lordicon.com/lordicon.js"></script>
<title>Audio Books</title>
<style>
/* Header Styles */
.header {
background-color: #f3a5a5;
padding: 0 40px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/* Flex container for header */
.container {
display: flex;
justify-content: space-between; /* Align logo on left and nav links on right */
align-items: center;
width: 100%;
}
/* Logo Styling */
.logo img {
width: 150px; /* Adjust width as per your logo size */
height: auto;
}
/* Navbar Styling */
.navbar {
flex-grow: 1;
text-align: right; /* Align links to the right */
}
/* Navbar list */
.navbar-list {
display: flex;
justify-content: flex-end;
list-style: none;
padding: 0;
margin: 0;
gap: 2rem;
}
/* Navbar items */
.navbar-item {
margin-left: 32px; /* Space between links */
}
/* Navbar links */
.navbar-link {
text-decoration: none;
font-size: 18px;
color: #333;
transition: color 0.3s ease;
}
.navbar-link:hover {
color: #b44343;
}
/* Responsive Design for Mobile */
/* @media (max-width: 768px) {
.container {
flex-direction: column;
align-items: center;
}
.navbar-list {
flex-direction: column;
margin-top: 20px;
}
.navbar-item {
margin: 10px 0;
}
} */
.action {
display: flex;
align-items: center;
}
.profile img {
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
}
.menu {
display: none;
position: absolute;
top: 60px;
right: 20px;
background-color: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
padding: 10px;
border-radius: 5px;
}
.profile:hover + .menu,
.menu:hover {
display: block;
}
.menu h3 {
margin: 0;
font-size: 16px;
text-align: center;
}
.menu ul {
list-style: none;
padding: 0;
margin: 10px 0 0 0;
text-align: center;
}
.menu ul li {
margin-bottom: 10px;
}
.menu ul li a {
text-decoration: none;
color: #333;
font-size: 14px;
transition: color 0.3s;
}
.menu ul li a:hover {
color: #b44343;
}
/* Responsive adjustments */
@media (max-width: 660px) {
.container {
flex-direction: column;
}
.header {
padding: 0 10px 20px 10px;
}
}
@media (max-width: 500px) {
.header {
padding: 0 10px 20px 10px;
}
.navbar-list {
gap: 1em;
padding: 0 2rem;
justify-content: center;
}
.navbar-item {
margin-left: 10px;
}
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
height: 100vh;
}
section {
background-color: #f6cac2;
padding: 20px;
}
h1 {
color: #b44343;
text-align: center;
font-size: 30px;
}
p {
text-align: center;
color: #333;
font-size: 20px;
}
.spotlight-container {
display: flex;
justify-content: center;
flex-wrap: wrap;
margin: 20px;
}
.spotlight-card {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
margin: 10px;
text-align: center;
width: 275px;
position: relative;
transition: transform 0.3s ease;
}
.spotlight-card img {
border-radius: 15px 15px 0 0;
width: 100%;
height: 250px; /* Fixed height for book image */
object-fit: cover;
}
.spotlight-card h3,
.spotlight-card p {
margin: 10px 0;
}
.play-pause-btn {
background-color: #e84a4b; /* Button color */
color: white;
border: none;
border-radius: 5px;
padding: 10px;
cursor: pointer;
margin-bottom: 10px;
transition: background-color 0.3s ease, transform 0.3s ease;
}
.play-pause-btn:hover {
background-color: #c04848; /* Darker shade on hover */
transform: scale(1.1);
}
.audio-slider {
width: 90%;
margin: 10px auto;
display: block;
}
.time-info {
font-size: 12px;
color: #666;
margin-top: -10px;
margin-bottom: 10px;
}
.spotlight-card.playing {
transform: scale(1.1); /* Zoom effect when playing */
}
.spotlight-card:hover {
transform: translateY(-20px); /* Hover lift effect */
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}
.spotlight-card .content {
transition: transform 0.3s ease;
}
.spotlight-card:hover .content {
transform: translateY(
20px
); /* Ensure content moves up within the card */
}
.spotlight-card .imgBx img {
border-radius: 15px 15px 0 0;
width: 100%;
height: 250px;
object-fit: cover;
transition: opacity 0.3s ease;
}
.spotlight-card:hover .imgBx img {
opacity: 0.9;
}
.spotlight-card:hover h3,
.spotlight-card:hover p {
color: #ff6347;
}
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
body {
line-height: 1.5;
font-family: "Poppins", sans-serif;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.row {
display: flex;
flex-direction: row;
}
ul {
list-style: none;
}
.footer {
background-color: palevioletred;
padding: 70px 100px;
margin:0 auto;
}
.footer-col {
width: 25%;
padding: 0 15px;
}
.footer-col .social-links {
display: flex;
flex-direction: column;
}
.footer-col h4 {
font-size: 18px;
color: #ffffff;
text-transform: capitalize;
margin-bottom: 35px;
font-weight: 500;
position: relative;
}
.footer-col h4::before {
content: "";
position: absolute;
left: 0;
bottom: -10px;
background-color: #e91e63;
height: 2px;
box-sizing: border-box;
width: 50px;
}
.footer-col ul li:not(:last-child) {
margin-bottom: 10px;
}
.footer-col ul li a {
font-size: 16px;
text-transform: capitalize;
color: #ffffff;
text-decoration: none;
font-weight: 300;
color: white;
display: block;
transition: all 0.3s ease;
}
.footer-col ul li a:hover {
color: black;
padding-left: 8px;
}
.footer-col .social-links a {
display: inline-block;
height: 40px;
width: 40px;
background-color: rgba(255, 255, 255, 0.2);
margin: 0 10px 10px 0;
text-align: center;
line-height: 40px;
border-radius: 50%;
color: #ffffff;
transition: all 0.5s ease;
}
.footer-col .social-links a:hover {
color: #24262b;
background-color: #ffffff;
}
@media (max-width: 900px) {
.row{
flex-wrap: wrap;
}
.footer{
padding:70px 20px;
}
}
/*responsive*/
@media (max-width: 767px) {
.footer-col {
width: 50%;
margin-bottom: 30px;
}
.footer-col .social-links{
display:flex;
flex-direction: row;
}
}
@media (max-width: 574px) {
.footer-col {
width: 100%;
}
}
/* newsletter */
.newsletter {
background-color: #ffd1d1;
padding: 30px;
max-width: 400px;
margin: auto;
border-radius: 8px;
text-align: center;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.newsletter h1 {
color: #c62828;
font-size: 20px;
margin-bottom: 10px;
}
.newsletter p {
color: #8c8c8c;
font-size: 16px;
margin-bottom: 20px;
}
.input-group {
position: relative;
margin-bottom: 15px;
}
.input-group i {
position: absolute;
top: 50%;
left: 10px;
transform: translateY(-50%);
color: #c62828;
}
.input-group input {
width: 100%;
padding: 12px 40px;
border: 2px solid #c62828;
border-radius: 5px;
font-size: 14px;
color: #333;
background-color: #ffecec;
transition: border-color 0.3s ease;
}
.input-group input:focus {
border-color: #ff6f6f;
outline: none;
}
.subscribe {
width: 100%;
background-color: #b71c1c;
color: white;
border: none;
padding: 12px;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.subscribe:hover {
background-color: #ff6f6f;
}
subscribe:active {
transform: scale(0.98);
}
subscribe:focus {
outline: none;
}
.newsletter:hover {
background: linear-gradient(hwb(357 68% 7%), #d26d6d);
}
.success-message {
margin-top: 20px;
font-size: 18px;
color: #388e3c;
display: none;
}
@media (max-width: 500px) {
.newsletter {
padding: 20px;
}
}
</style>
</head>
<body>
<header class="header">
<div class="container">
<!-- Left Side: Logo -->
<a href="index.html" class="logo">
<img src="./assets/images/final.png" class="logopic" alt="Logo" />
</a>
<!-- Right Side: Navigation Links -->
<nav class="navbar">
<ul class="navbar-list">
<li class="navbar-item">
<a href="index.html" class="navbar-link"> <lord-icon
src="https://cdn.lordicon.com/qeltvbrs.json"
trigger="hover"
colors="primary:#e88c30,secondary:#a30f17"
style="width:25px;height:25px">
</lord-icon>Home</a>
</li>
<li class="navbar-item">
<a href="books.html" class="navbar-link"> <lord-icon
src="https://cdn.lordicon.com/bhmovrlt.json"
trigger="hover"
state="morph-open"
colors="primary:#a30f17,secondary:#e88c30"
style="width:25px;height:25px">
</lord-icon>Books</a>
</li>
<li class="navbar-item">
<a href="../SwapReads/index.html#genre" class="navbar-link"
><script src="https://cdn.lordicon.com/lordicon.js"></script>
<lord-icon
src="https://cdn.lordicon.com/lcvlsnre.json"
trigger="hover"
colors="primary:#a30f17,secondary:#e88c30"
style="width:25px;height:25px">
</lord-icon>Genres</a>
</li>
<li class="navbar-item">
<a href="../SwapReads/assets/html/about.html" class="navbar-link"
> <lord-icon
src="https://cdn.lordicon.com/fozsorqm.json"
trigger="hover"
stroke="bold"
state="hover-up"
colors="primary:#a30f17,secondary:#e88c30"
style="width:30px;height:30px"></lord-icon>About</a
>
</li>
</ul>
</nav>
</div>
</header>
<section>
<h1>Audiobook Haven: Listen Anytime, Anywhere"</h1>
<p>Expand Your Mind with Every Listen</p>
<div class="spotlight-container">
<div class="spotlight-card">
<img src="audio/the-magic-shop-17 (1).jpg" alt="Book Cover 1" />
<h3>The Magic Shop</h3>
<p>H.G. Wells</p>
<audio
id="audio1"
src="audio/The Magic Shop by H. G. Wells Audiobook - FULL [ ezmp3.cc ] (1).mp3"
></audio>
<input
type="range"
class="audio-slider"
id="slider1"
min="0"
value="0"
step="1"
/>
<div class="time-info">
<span id="currentTime1">0:00</span> /
<span id="duration1">0:00</span>
</div>
<button
class="play-pause-btn"
onclick="toggleAudio('audio1', 'slider1', 'currentTime1', 'duration1', this)"
>
Play
</button>
</div>
<div class="spotlight-card">
<img src="audio/landlady.jpg" alt="Book Cover 2" />
<h3>The Landlady</h3>
<p>Roald Dahl</p>
<audio
id="audio2"
src="audio/The Landlady - Roald Dahl [ ezmp3.cc ].mp3"
></audio>
<input
type="range"
class="audio-slider"
id="slider2"
min="0"
value="0"
step="1"
/>
<div class="time-info">
<span id="currentTime2">0:00</span> /
<span id="duration2">0:00</span>
</div>
<button
class="play-pause-btn"
onclick="toggleAudio('audio2', 'slider2', 'currentTime2', 'duration2', this)"
>
Play
</button>
</div>
<div class="spotlight-card">
<img src="audio/lotery ticket.jpeg" alt="Book Cover 3" />
<h3>The Lottery Ticket</h3>
<p>Anton Chekhov</p>
<audio
id="audio3"
src="audio/The Lottery Ticket by Anton Chekhov Audiobook [ ezmp3.cc ].mp3"
></audio>
<input
type="range"
class="audio-slider"
id="slider3"
min="0"
value="0"
step="1"
/>
<div class="time-info">
<span id="currentTime3">0:00</span> /
<span id="duration3">0:00</span>
</div>
<button
class="play-pause-btn"
onclick="toggleAudio('audio3', 'slider3', 'currentTime3', 'duration3', this)"
>
Play
</button>
</div>
<div class="spotlight-card">
<img src="audio/bernier bobs her hair.jpg" alt="Book Cover 4" />
<h3>Bernice Bobs Her Hair</h3>
<p>F. Scott Fitzgerald</p>
<audio
id="audio4"
src="audio/Bernice Bobs Her Hair by F. Scott Fitzgerald _ Audiobooks Youtube Free _ Short Stories Youtube [ ezmp3.cc ].mp3"
></audio>
<input
type="range"
class="audio-slider"
id="slider4"
min="0"
value="0"
step="1"
/>
<div class="time-info">
<span id="currentTime4">0:00</span> /
<span id="duration4">0:00</span>
</div>
<button
class="play-pause-btn"
onclick="toggleAudio('audio4', 'slider4', 'currentTime4', 'duration4', this)"
>
Play
</button>
</div>
</div>
</section>
<footer class="footer">
<div class="container">
<div class="row">
<div class="footer-col">
<h4>company</h4>
<ul>
<li><a href="#">about us</a></li>
<li><a href="#">Home</a></li>
<li><a href="../SwapReads/#benefits">Benefits</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="footer-col">
<h4>get help</h4>
<ul>
<li><a href="#">FAQ</a></li>
<li><a href="#">Rate us</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">login</a></li>
<li><a href="#">Sign-up</a></li>
</ul>
</div>
<div class="footer-col">
<h4>Explore</h4>
<ul>
<li><a href="#">Genre</a></li>
<li><a href="#">Diverse literature adventure</a></li>
<li><a href="#">Horror</a></li>
<li><a href="#">Romance</a></li>
</ul>
</div>
<div class="footer-col">
<h4>follow us</h4>
<div class="social-links">
<a href="#"><i class="fab fa-facebook-f"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-linkedin-in"></i></a>
</div>
</div>
<div class="newsletter">
<h1>Subscribe to Our Newsletter</h1>
<p>Stay updated with our latest news and offers</p>
<form id="newsform" onsubmit="return showSuccessMessage();">
<div class="input-group">
<i class="fas fa-user"></i>
<input
type="text"
id="name"
placeholder="Your Name"
required=""
pattern="[a-zA-Z ]+"
oninvalid="this.setCustomValidity('Numbers and Symbols are not allowed')"
oninput="this.setCustomValidity('')"
/>
</div>
<div class="input-group">
<i class="fas fa-envelope"></i>
<input
type="email"
id="email"
placeholder="Your Email Address"
required=""
/>
</div>
<button type="submit" class="subscribe" id="subs">
Subscribe
</button>
</form>
<div
id="successmessage"
class="success-message"
style="display: none"
>
Thank you for subscribing!
</div>
</div>
</div>
</div>
</footer>
<script>
let currentAudio = null; // Keep track of the currently playing audio
function toggleAudio(audioId, sliderId, currentTimeId, durationId, button) {
const audio = document.getElementById(audioId);
const slider = document.getElementById(sliderId);
const currentTimeDisplay = document.getElementById(currentTimeId);
const durationDisplay = document.getElementById(durationId);
const container = button.closest(".spotlight-card");
// If there's an audio currently playing and it's not the same as the selected one, pause it
if (currentAudio && currentAudio !== audio) {
currentAudio.pause();
currentAudio.closest(".spotlight-card").classList.remove("playing");
document.querySelector(".play-pause-btn[onclick*='" + currentAudio.id + "']").textContent = "Play";
}
// Toggle play/pause for the selected audio
if (audio.paused) {
audio.play();
button.textContent = "Pause";
container.classList.add("playing");
currentAudio = audio; // Set the currently playing audio
updateSlider(slider, audio, currentTimeDisplay, durationDisplay);
} else {
audio.pause();
button.textContent = "Play";
container.classList.remove("playing");
}
}
function updateSlider(slider, audio, currentTimeDisplay, durationDisplay) {
audio.addEventListener("timeupdate", function () {
slider.max = audio.duration;
slider.value = audio.currentTime;
// Update current time and duration
currentTimeDisplay.textContent = formatTime(audio.currentTime);
durationDisplay.textContent = formatTime(audio.duration);
});
slider.addEventListener("input", function () {
audio.currentTime = slider.value;
});
}
function formatTime(seconds) {
const minutes = Math.floor(seconds / 60);
const secs = Math.floor(seconds % 60);
return minutes + ":" + (secs < 10 ? "0" : "") + secs;
}
</script>
</body>
</html>