forked from anuragverma108/SwapReads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudiobook.html
341 lines (298 loc) · 11.1 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
<!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="./assets/css/MenuClick.css">
<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/[email protected]/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>
<title>Audio Books</title>
<style>
/* Header Styles */
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 25px 40px;
background-color: #e28989;
border-bottom: 1px solid #ddd;
}
.header .container {
display: flex;
justify-content: space-between;
width: 100%;
}
.logo img {
width: 500px;
}
.navbar {
flex-grow: 1;
display: flex;
justify-content: center;
}
.navbar-list {
display: flex;
list-style: none;
padding: 1;
margin: 0;
}
.navbar-item {
margin: 0 40px;
}
.navbar-link {
text-decoration: none;
font-size: 18px;
color: #333;
transition: color 0.3s;
}
.navbar-link:hover {
color: #b44343;
}
.action {
display: flex;
align-items: center;
}
.profile img {
width: 50px;
height: 50px;
border-radius: 50%;
cursor: pointer;
}
.menu {
display: none;
position: absolute;
top: 70px;
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;
}
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;
}
.play-pause-btn:hover {
background-color: #C04848; /* Darker shade on hover */
}
.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 */
}
</style>
</head>
<body>
<header class="header">
<div class="container">
<a href="index.html" onclick="lenis.scrollTo('index.html');" class="logo" style="display:flex;">
<img src="./assets/images/final.png" class="logopic" style=" width: 4rem; margin:0px 10px 1px 10px;">
</a>
<nav class="navbar">
<ul class="navbar-list">
<li class="navbar-item"><a href="index.html" class="navbar-link">Home</a></li>
<li class="navbar-item"><a href="books.html" class="navbar-link">Books</a></li>
<li class="navbar-item"><a href="../SwapReads/index.html#genre" class="navbar-link">Genres</a></li>
<li class="navbar-item"><a href="../SwapReads/assets/html/about.html" class="navbar-link">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>
<script>
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 (audio.paused) {
audio.play();
button.textContent = 'Pause';
container.classList.add('playing');
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>