-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread.html
More file actions
683 lines (601 loc) · 42.3 KB
/
read.html
File metadata and controls
683 lines (601 loc) · 42.3 KB
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
<!DOCTYPE html>
<html lang="or">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- =================================================================
PROFESSIONAL SEO & META TAGS
================================================================= -->
<title>ଓଡ଼ିଆ ପାଠାଗାର | Odia Bhasa App</title>
<meta name="description" content="ଓଡ଼ିଆ ଭାଷା ଆପ୍ ର ଏହି ପାଠାଗାରରେ ଆପଣ ନିଜ ମନପସନ୍ଦର ଓଡ଼ିଆ ବହି, ଗଳ୍ପ, ଏବଂ କବିତା ମାଗଣାରେ ପଢ଼ିପାରିବେ ।">
<meta name="keywords" content="Odia Library, Odia Books, Odia Stories, Madhu Barnabodha, Fakir Mohan Senapati, Read Odia Books Online, Odia Bhasa App, ଓଡ଼ିଆ ବହି">
<meta name="author" content="Sandeep Biswal G">
<meta name="robots" content="index, follow">
<!-- Dynamic Theme Color for Chrome/Mobile Browser Header -->
<meta name="theme-color" id="theme-color-meta" content="#FFD800">
<!-- Open Graph (Facebook/WhatsApp/LinkedIn) -->
<meta property="og:title" content="ଓଡ଼ିଆ ପାଠାଗାର | Odia Bhasa App">
<meta property="og:description" content="ମାଗଣାରେ ପଢ଼ନ୍ତୁ ଓଡ଼ିଆ ବହି: ସ୍କୁଲ ପ୍ରାର୍ଥନାରୁ ଆରମ୍ଭ କରି ପ୍ରସିଦ୍ଧ ଗଳ୍ପ ଏବଂ କବିତା। ଆମର ଏହି ବିଶାଳ ସଂଗ୍ରହ ମାଧ୍ୟମରେ ଓଡ଼ିଶାର ସମୃଦ୍ଧ ସାହିତ୍ୟ ଓ ପରମ୍ପରା ସହ ଯୋଡ଼ି ହୁଅନ୍ତୁ।">
<meta property="og:image" content="https://imsbg.github.io/odiabhasa/images/app.png">
<meta property="og:url" content="https://imsbg.github.io/odiabhasa/">
<meta property="og:type" content="website">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="ଓଡ଼ିଆ ପାଠାଗାର | Odia Bhasa App">
<meta name="twitter:description" content="ମାଗଣାରେ ପଢ଼ନ୍ତୁ ଓଡ଼ିଆ ବହି: ସ୍କୁଲ ପ୍ରାର୍ଥନାରୁ ଆରମ୍ଭ କରି ପ୍ରସିଦ୍ଧ ଗଳ୍ପ ଏବଂ କବିତା। ଆମର ଏହି ବିଶାଳ ସଂଗ୍ରହ ମାଧ୍ୟମରେ ଓଡ଼ିଶାର ସମୃଦ୍ଧ ସାହିତ୍ୟ ଓ ପରମ୍ପରା ସହ ଯୋଡ଼ି ହୁଅନ୍ତୁ।">
<meta name="twitter:image" content="https://imsbg.github.io/odiabhasa/images/app.png">
<!-- Schema.org JSON-LD for Google Rich Results (Web & App Linkage) -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "CollectionPage",
"@id": "https://imsbg.github.io/odiabhasa/read",
"url": "https://imsbg.github.io/odiabhasa/read",
"name": "ଓଡ଼ିଆ ପାଠାଗାର | Odia Bhasa App - Read Books Online",
"description": "Read free Odia books online: School prayers, famous stories, and classic poems. Dive into the rich heritage of Odisha with our massive collection.",
"inLanguage": "or",
"author": {
"@type": "Person",
"name": "Sandeep Biswal G"
},
"publisher": {
"@type": "Organization",
"name": "Odia Bhasa App",
"logo": {
"@type": "ImageObject",
"url": "https://imsbg.github.io/odiabhasa/images/app.png"
}
}
},
{
"@type": "SoftwareApplication",
"@id": "https://play.google.com/store/apps/details?id=in.sandeep.odiabhasa",
"name": "Odia Bhasa App",
"operatingSystem": "ANDROID",
"applicationCategory": "EducationalApplication",
"url": "https://play.google.com/store/apps/details?id=in.sandeep.odiabhasa",
"author": {
"@type": "Person",
"name": "Sandeep Biswal G"
},
"description": "A Free Odia Language learning app to read Odia books, school prayers, famous stories, and classic poems.",
"image": "https://imsbg.github.io/odiabhasa/images/app.png",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "INR"
}
}
]
}
</script>
<!-- Fonts -->
<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=Noto+Sans+Oriya:wght@400;700;900&display=swap" rel="stylesheet">
<style>
/* =================================================================
VARIABLES & THEMES (COMIC POP / NEO-BRUTALISM)
================================================================= */
:root {
/* Light Theme */
--primary-yellow: #FFD800;
--bg-color: #FDF9EE;
--white: #FFFFFF;
--black: #000000;
--purple: #7C3AED;
--text-dark: #1A1A1A;
/* Structural */
--border-thick: 3px solid var(--black);
--shadow-comic: 4px 4px 0px var(--black);
--shadow-comic-lg: 6px 6px 0px var(--black);
--radius-sm: 12px;
--radius-md: 16px;
--radius-pill: 50px;
/* User Prefs */
--font-base: 18px;
--sepia-l: 90%;
}
/* Dark Theme */
body.theme-dark {
--bg-color: #121212;
--white: #1e1e1e;
--black: #ffffff;
--text-dark: #f1f1f1;
--primary-yellow: #B29700;
--purple: #9d6aff;
}
/* Sepia Theme (ଆଖି ସୁରକ୍ଷା) - Dynamic Lightness */
body.theme-sepia {
--bg-color: hsl(40, 45%, var(--sepia-l));
--white: hsl(40, 45%, calc(var(--sepia-l) + 5%));
--black: #4A3B2C;
--text-dark: #4A3B2C;
--primary-yellow: #E5C300;
--purple: #6A32C9;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
font-family: 'Noto Sans Oriya', sans-serif; background-color: var(--bg-color);
color: var(--text-dark); user-select: none; overflow-x: hidden;
transition: background-color 0.3s, color 0.3s;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; outline: none; }
.hidden { display: none !important; }
.icon { width: 28px; height: 28px; fill: currentColor; }
/* =================================================================
LAYOUT CONTAINERS
================================================================= */
.app-container { width: 100%; background-color: var(--bg-color); min-height: 100vh; position: relative; }
.desktop-content-wrapper { max-width: 1200px; margin: 0 auto; }
/* =================================================================
LIBRARY VIEW
================================================================= */
.header-main {
background-color: var(--primary-yellow); padding: 15px 20px;
display: flex; align-items: center; justify-content: space-between;
position: sticky; top: 0; z-index: 100; border-bottom: var(--border-thick);
transition: background-color 0.3s;
}
.header-title { display: flex; align-items: center; gap: 15px; font-size: 22px; font-weight: 900; color: var(--black); }
.header-btn { background: none; border: none; color: var(--black); display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.header-btn:active { transform: scale(0.9); }
.header-actions { display: flex; gap: 15px; align-items: center; }
.search-container { padding: 20px; background: var(--bg-color); max-width: 800px; margin: 0 auto; }
.search-box { position: relative; width: 100%; }
.search-input {
width: 100%; padding: 14px 20px 14px 50px; border: var(--border-thick);
border-radius: var(--radius-pill); font-size: 16px; font-weight: 700;
background: var(--white); color: var(--text-dark); box-shadow: var(--shadow-comic); transition: 0.1s;
}
.search-input:focus { outline: none; transform: translate(-2px, -2px); box-shadow: var(--shadow-comic-lg); }
.search-icon-abs { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; color: var(--text-dark); opacity: 0.7; }
.book-grid { padding: 0 20px 40px 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (min-width: 600px) { .book-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .book-grid { grid-template-columns: repeat(4, 1fr); gap: 30px; } }
.book-card {
background: var(--white); border: var(--border-thick); border-radius: var(--radius-md);
box-shadow: var(--shadow-comic); overflow: hidden; display: flex; flex-direction: column;
cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.book-card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0px var(--black); }
.card-cover { width: 100%; aspect-ratio: 2/3; background: #eee; border-bottom: var(--border-thick); object-fit: cover; }
.card-info { padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.card-title { font-size: 16px; font-weight: 900; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-author { font-size: 12px; font-weight: 700; color: #E91E63; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
/* =================================================================
MODALS (Action, Settings, Search)
================================================================= */
.modal-overlay {
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); z-index: 2000;
display: flex; align-items: center; justify-content: center; padding: 20px;
opacity: 0; pointer-events: none; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.comic-modal {
background: var(--bg-color); width: 100%; max-width: 350px; border: var(--border-thick);
border-radius: var(--radius-md); box-shadow: var(--shadow-comic-lg); padding: 25px;
text-align: center; transform: scale(0.8); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
max-height: 85vh; display: flex; flex-direction: column; overflow-y: auto;
}
.modal-overlay.active .comic-modal { transform: scale(1); }
.comic-modal h3 { font-size: 18px; margin-bottom: 20px; font-weight: 900; color: var(--text-dark); line-height: 1.4; }
.modal-btn {
width: 100%; padding: 12px; margin-bottom: 12px; border: var(--border-thick);
border-radius: var(--radius-pill); font-size: 16px; font-weight: 900;
background: var(--white); color: var(--text-dark); box-shadow: 3px 3px 0px var(--black); transition: 0.1s;
}
.modal-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0px var(--black); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-yellow { background: var(--primary-yellow); color: #000; }
.btn-close { margin-top: 10px; background: #bbb; color: #000; border-color: #000;}
/* Settings CSS */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.settings-label { text-align: left; font-weight: 900; margin: 10px 0 5px 0; font-size: 14px; color: var(--text-dark); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-weight: 700; text-align: left;}
.sepia-slider-container { padding: 10px; border: 2px dashed var(--black); border-radius: 8px; margin-bottom: 15px; background: var(--white); }
input[type="range"] { width: 100%; accent-color: var(--purple); cursor: pointer; }
.search-results-box { flex: 1; overflow-y: auto; text-align: left; margin: 15px 0; border: 2px solid #ccc; border-radius: 8px; padding: 10px; background: var(--white); }
.search-item { padding: 10px; border-bottom: 1px dashed #ccc; cursor: pointer; font-size: 14px; }
.search-item:last-child { border-bottom: none; }
.search-item strong { color: var(--purple); }
/* Custom Checkbox */
input[type="checkbox"] {
appearance: none; width: 40px; height: 20px; background: var(--white);
border: 2px solid var(--black); border-radius: 20px; position: relative; cursor: pointer; outline: none;
}
input[type="checkbox"]::before {
content: ''; position: absolute; width: 12px; height: 12px; background: var(--black);
border-radius: 50%; top: 2px; left: 3px; transition: 0.2s;
}
input[type="checkbox"]:checked { background: var(--purple); border-color: var(--black); }
input[type="checkbox"]:checked::before { left: 21px; background: #fff; border: 1px solid var(--black);}
/* =================================================================
READER VIEW
================================================================= */
.reader-view { background: var(--bg-color); min-height: 100vh; position: relative; }
.reader-header {
display: flex; align-items: flex-start; justify-content: space-between;
padding: 15px 20px; background: var(--bg-color); z-index: 100;
border-bottom: var(--border-thick); position: sticky; top: 0;
transition: background-color 0.3s;
}
.rh-left { display: flex; gap: 15px; }
.rh-titles { display: flex; flex-direction: column; }
.rh-main-title { font-size: 20px; font-weight: 900; line-height: 1.2; }
.rh-sub-title { font-size: 12px; font-weight: 700; color: #777; margin-top: 4px; }
.rh-actions { display: flex; gap: 15px; }
.reader-content {
max-width: 800px; margin: 0 auto; padding: 40px 25px 120px 25px; min-height: 80vh;
}
/* Reading Text Formatting */
.content-p {
font-size: var(--font-base); line-height: 1.9; font-weight: 500; margin-bottom: 25px;
color: var(--text-dark); word-wrap: break-word; transition: font-size 0.3s;
}
strong, b { font-weight: 900; }
em, i { font-style: italic; }
.book-page-header {
font-size: calc(var(--font-base) + 6px); font-weight: 900;
margin-top: 35px; margin-bottom: 15px; color: var(--text-dark); line-height: 1.4;
}
/* First Page Centering */
.first-page-center {
display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.first-page-center .content-p, .first-page-center .book-page-header { text-align: center; }
.text-purple { color: var(--purple); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(124, 58, 237, 0.4); text-underline-offset: 4px; }
.reading-active { background-color: rgba(124, 58, 237, 0.2); border-left: 4px solid var(--purple); padding-left: 10px; border-radius: 4px;}
/* Bottom Controls */
.reader-bottom {
position: fixed; bottom: 0; left: 0; width: 100%; display: flex;
justify-content: space-between; align-items: flex-end; padding: 20px;
pointer-events: none; z-index: 500;
}
.page-counter { font-size: 18px; font-weight: 900; color: var(--text-dark); background: var(--bg-color); padding: 5px 10px; border: var(--border-thick); border-radius: 10px;}
.fab-audio {
width: 65px; height: 65px; background: var(--purple); color: #fff;
border: var(--border-thick); border-radius: 50%; box-shadow: var(--shadow-comic);
display: flex; align-items: center; justify-content: center; pointer-events: auto;
transition: 0.2s; cursor: pointer;
}
.fab-audio:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0px var(--black); }
.fab-audio svg { width: 30px; height: 30px; fill: currentColor; }
.nav-arrows-container {
position: fixed; bottom: 85px; left: 50%; transform: translateX(-50%);
width: 100%; max-width: 600px; display: flex; justify-content: space-between; padding: 0 20px;
z-index: 400; pointer-events: none;
}
.nav-btn {
width: 50px; height: 50px; background: var(--white); color: var(--text-dark);
border: var(--border-thick); border-radius: 50%; box-shadow: var(--shadow-comic);
display: flex; align-items: center; justify-content: center;
pointer-events: auto; transition: opacity 0.4s ease, transform 0.1s; opacity: 1;
}
.nav-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0px var(--black); }
.nav-btn.faded { opacity: 0; pointer-events: none; }
.loader { text-align: center; padding: 60px 20px; font-weight: 900; color: var(--purple); font-size: 18px; }
</style>
</head>
<body>
<div class="app-container" id="app-root">
<!-- ==================== LIBRARY VIEW ==================== -->
<div id="library-view">
<header class="header-main">
<div class="header-title">
<button class="header-btn" onclick="goHome()">
<svg class="icon" viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>
</button>
ଓଡ଼ିଆ ପାଠାଗାର
</div>
<div class="header-actions">
<!-- Refresh Icon -->
<button class="header-btn" onclick="location.reload()" title="ରିଫ୍ରେସ୍ କରନ୍ତୁ">
<svg class="icon" viewBox="0 0 24 24"><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></svg>
</button>
<!-- Download App Icon -->
<button class="header-btn" onclick="window.open('https://play.google.com/store/apps/details?id=in.sandeep.odiabhasa', '_blank')" title="ଆପ୍ ଡାଉନଲୋଡ୍ କରନ୍ତୁ">
<svg class="icon" viewBox="0 0 24 24"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"/></svg>
</button>
</div>
</header>
<div class="search-container">
<div class="search-box">
<svg class="search-icon-abs" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>
<input type="text" id="lib-search-input" class="search-input" placeholder="ବହି ଖୋଜନ୍ତୁ...">
</div>
</div>
<div class="desktop-content-wrapper">
<div id="loader" class="loader">ଲୋଡ୍ ହେଉଛି...</div>
<div id="book-grid" class="book-grid"></div>
</div>
</div>
<!-- ==================== READER VIEW ==================== -->
<div id="reader-view" class="reader-view hidden">
<header class="reader-header">
<div class="rh-left">
<button class="header-btn" onclick="exitReader()">
<svg class="icon" viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>
</button>
<div class="rh-titles">
<div id="rh-main-title" class="rh-main-title">...</div>
<div id="rh-sub-title" class="rh-sub-title">...</div>
</div>
</div>
<div class="rh-actions">
<button class="header-btn" onclick="openSearchModal()"><svg class="icon" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg></button>
<button class="header-btn" onclick="openSettingsModal()"><svg class="icon" viewBox="0 0 24 24"><path d="M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"/></svg></button>
</div>
</header>
<div id="page-content" class="reader-content"></div>
<div class="nav-arrows-container" id="nav-arrows-ui">
<button class="nav-btn" onclick="changePage(-1)" id="btn-prev">
<svg class="icon" viewBox="0 0 24 24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>
</button>
<button class="nav-btn" onclick="changePage(1)" id="btn-next">
<svg class="icon" viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>
</button>
</div>
<div class="reader-bottom">
<div class="page-counter" id="page-indicator">୧ / ୧</div>
<button class="fab-audio" id="btn-play-audio" onclick="toggleAudio()">
<svg viewBox="0 0 24 24" id="audio-icon"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>
</button>
</div>
</div>
<!-- ==================== BOOK ACTION MODAL (MOBILE ONLY) ==================== -->
<div id="book-action-modal" class="modal-overlay">
<div class="comic-modal">
<h3>ଗୋଟେ ଉତ୍ତମ ଅନୁଭୂତି ପାଇଁ ଏହି ବହିଟି ଓଡ଼ିଆ ଭାଷା ଆପ୍ ରେ ପଢନ୍ତୁ</h3>
<button class="modal-btn btn-purple" onclick="triggerReadOnline()">ଅନ୍ଲାଇନ୍ରେ ପଢ଼ନ୍ତୁ</button>
<button class="modal-btn btn-yellow" onclick="triggerReadInApp()">ଆପ୍ରେ ପଢ଼ନ୍ତୁ</button>
<button class="modal-btn" onclick="triggerShare()">ସେୟାର କରନ୍ତୁ</button>
<button class="modal-btn btn-close" onclick="closeActionModal()">ବନ୍ଦ କରନ୍ତୁ</button>
</div>
</div>
<!-- ==================== SETTINGS MODAL ==================== -->
<div id="settings-modal" class="modal-overlay">
<div class="comic-modal">
<h3>ସେଟିଂସ୍</h3>
<div class="settings-label">ଅକ୍ଷର ଆକାର </div>
<div class="settings-grid">
<button class="modal-btn" onclick="adjFont(-2)">ଅ- ଛୋଟ</button>
<button class="modal-btn" onclick="adjFont(2)">ଅ+ ବଡ</button>
</div>
<div class="settings-label">ରଙ୍ଗ</div>
<button class="modal-btn" onclick="setTheme('light')" style="background:#fff; color:#000;">ଆଲୋକିତ</button>
<button class="modal-btn" onclick="setTheme('dark')" style="background:#222; color:#fff;">ଅନ୍ଧାରିଆ</button>
<button class="modal-btn" onclick="setTheme('sepia')" style="background:#F4ECD8; color:#5B4636;">ଆଖି ସୁରକ୍ଷା</button>
<div id="sepia-slider-wrapper" class="sepia-slider-container hidden">
<div class="settings-label" style="text-align:center;">ଆଖି ସୁରକ୍ଷା ରଙ୍ଗ</div>
<input type="range" min="70" max="95" id="sepia-intensity" oninput="updateSepia(this.value)">
</div>
<div class="settings-label" style="margin-top:15px;">ଅନ୍ୟାନ୍ୟ</div>
<div class="toggle-row">
<span>ତୀର ଦେଖାନ୍ତୁ </span>
<input type="checkbox" id="pref-arrows" onchange="updateToggles()">
</div>
<div class="toggle-row">
<span>ଅଡିଓ ବଟନ୍</span>
<input type="checkbox" id="pref-audio" onchange="updateToggles()">
</div>
<button class="modal-btn btn-close" onclick="closeSettingsModal()">ବନ୍ଦ କରନ୍ତୁ</button>
</div>
</div>
<!-- ==================== SEARCH IN BOOK MODAL ==================== -->
<div id="search-modal" class="modal-overlay">
<div class="comic-modal">
<h3>ବହି ଭିତରେ ଖୋଜନ୍ତୁ</h3>
<div class="search-box">
<input type="text" id="in-book-search" class="search-input" placeholder="ଶବ୍ଦ ଲେଖନ୍ତୁ..." style="padding-left:20px;">
</div>
<div class="search-results-box" id="search-results"></div>
<button class="modal-btn btn-close" onclick="closeSearchModal()">ବନ୍ଦ କରନ୍ତୁ</button>
</div>
</div>
</div>
<script>
const API = { ALL_BOOKS: 'https://sbgb.pages.dev/ବହି/ସବୁ.json', BOOK_BASE: 'https://sbgb.pages.dev/ବହି/ଖାତା/', DEEP_LINK_BASE: 'https://odiabhasa.pages.dev/open?Bahi=' };
document.addEventListener('contextmenu', e => e.preventDefault());
document.onkeydown = e => { if(e.keyCode == 123 || (e.ctrlKey && "IUS".includes(String.fromCharCode(e.keyCode)))) return false; };
document.addEventListener('copy', e => { e.preventDefault(); e.clipboardData.setData('text/plain', "ଓଡ଼ିଆ ଭାଷା ଆପ୍ ଡାଉନଲୋଡ୍ କରନ୍ତୁ : https://play.google.com/store/apps/details?id=in.sandeep.odiabhasa"); });
let allBooksData = []; let currentBook = null; let selectedBookId = null; let selectedBookTitle = null; let currentPage = 0;
let prefs = { fontSize: 18, theme: 'light', showArrows: true, showAudio: true, sepiaLightness: 90 };
let navTimeout; let synth = window.speechSynthesis; let audioChunks = []; let currentChunkIndex = 0; let isPlaying = false;
let touchstartX = 0; let touchendX = 0;
const ui = {
libView: document.getElementById('library-view'), readView: document.getElementById('reader-view'),
grid: document.getElementById('book-grid'), loader: document.getElementById('loader'), libSearch: document.getElementById('lib-search-input'),
modalAction: document.getElementById('book-action-modal'), modalSettings: document.getElementById('settings-modal'), modalSearch: document.getElementById('search-modal'),
rhMainTitle: document.getElementById('rh-main-title'), rhSubTitle: document.getElementById('rh-sub-title'), pageContent: document.getElementById('page-content'),
pageInd: document.getElementById('page-indicator'), btnPrev: document.getElementById('btn-prev'), btnNext: document.getElementById('btn-next'),
navArrowsUI: document.getElementById('nav-arrows-ui'), btnAudio: document.getElementById('btn-play-audio'), audioIcon: document.getElementById('audio-icon'),
inBookInput: document.getElementById('in-book-search'), searchResults: document.getElementById('search-results'),
sepiaWrapper: document.getElementById('sepia-slider-wrapper'), sepiaSlider: document.getElementById('sepia-intensity'),
themeMeta: document.getElementById('theme-color-meta')
};
window.onload = () => {
loadPrefs();
const params = new URLSearchParams(window.location.search);
const directBook = params.get('book');
if (directBook) loadReader(directBook); else fetchLibrary();
setupNavAutoHider(); setupSwipe();
ui.libSearch.addEventListener('input', (e) => renderGrid(allBooksData.filter(b => b.destination.toLowerCase().includes(e.target.value.toLowerCase()))));
ui.inBookInput.addEventListener('keyup', doInBookSearch);
};
function goHome() { window.location.href = 'https://imsbg.github.io/odiabhasa/'; }
const isMobileDevice = () => window.innerWidth <= 768 || /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
// --- PREFERENCES & DYNAMIC THEME ---
function loadPrefs() {
try { const stored = localStorage.getItem('odiaPrefs'); if(stored) prefs = { ...prefs, ...JSON.parse(stored) }; } catch(e){}
applyPrefs();
document.getElementById('pref-arrows').checked = prefs.showArrows;
document.getElementById('pref-audio').checked = prefs.showAudio;
ui.sepiaSlider.value = prefs.sepiaLightness;
}
function savePrefs() { localStorage.setItem('odiaPrefs', JSON.stringify(prefs)); applyPrefs(); }
function applyPrefs() {
document.body.className = '';
if(prefs.theme !== 'light') document.body.classList.add(`theme-${prefs.theme}`);
document.documentElement.style.setProperty('--font-base', `${prefs.fontSize}px`);
document.documentElement.style.setProperty('--sepia-l', `${prefs.sepiaLightness}%`);
ui.navArrowsUI.style.display = prefs.showArrows ? 'flex' : 'none';
ui.btnAudio.style.display = prefs.showAudio ? 'flex' : 'none';
ui.sepiaWrapper.style.display = prefs.theme === 'sepia' ? 'block' : 'none';
// SEO / Meta Theme Color Update
if(prefs.theme === 'dark') ui.themeMeta.content = '#121212';
else if(prefs.theme === 'sepia') ui.themeMeta.content = `hsl(40, 45%, ${prefs.sepiaLightness}%)`;
else ui.themeMeta.content = '#FFD800';
}
function adjFont(diff) { prefs.fontSize = Math.max(14, Math.min(32, prefs.fontSize + diff)); savePrefs(); }
function setTheme(t) { prefs.theme = t; savePrefs(); }
function updateSepia(val) { prefs.sepiaLightness = val; savePrefs(); }
function updateToggles() { prefs.showArrows = document.getElementById('pref-arrows').checked; prefs.showAudio = document.getElementById('pref-audio').checked; savePrefs(); }
// --- SEO UPDATER ---
function updateSEO(title, desc, url) {
document.title = `${title} | ଓଡ଼ିଆ ପାଠାଗାର`;
document.querySelector('meta[name="description"]').content = desc;
document.querySelector('meta[property="og:title"]').content = title;
document.querySelector('meta[property="og:description"]').content = desc;
if(url) window.history.pushState({path: url}, '', url);
}
// --- MODALS ---
function openSettingsModal() { ui.modalSettings.classList.add('active'); }
function closeSettingsModal() { ui.modalSettings.classList.remove('active'); }
function openSearchModal() { ui.modalSearch.classList.add('active'); ui.searchResults.innerHTML=''; ui.inBookInput.value=''; }
function closeSearchModal() { ui.modalSearch.classList.remove('active'); }
function closeActionModal() { ui.modalAction.classList.remove('active'); }
// --- LIBRARY ---
async function fetchLibrary() {
try {
const res = await fetch(API.ALL_BOOKS); allBooksData = await res.json();
ui.loader.classList.add('hidden'); renderGrid(allBooksData);
updateSEO("ଓଡ଼ିଆ ପାଠାଗାର | Odia Bhasa App", "ଆମର ବିଶାଳ ପାଠାଗାରରୁ ମାଗଣାରେ ଓଡ଼ିଆ ବହି ପଢ଼ନ୍ତୁ।", window.location.pathname);
} catch(e) { ui.loader.innerText = "ତ୍ରୁଟି ହେଲା। ଦୟାକରି ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ।"; }
}
function renderGrid(books) {
ui.grid.innerHTML = '';
books.forEach(book => {
const id = book.destination.split('/').pop().replace('.json', '');
const card = document.createElement('div'); card.className = 'book-card';
card.onclick = () => handleBookClick(id, id.replace(/-/g, ' '));
card.innerHTML = `<img class="card-cover" src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" alt="Cover"><div class="card-info"><div class="card-title">...</div><div class="card-author">...</div></div>`;
ui.grid.appendChild(card);
fetch(book.destination).then(r => r.json()).then(d => {
card.querySelector('.card-title').textContent = d.title || 'ଅଜଣା';
card.querySelector('.card-author').textContent = d.author || 'Odia Bhasa App';
if(d.coverpage) card.querySelector('.card-cover').src = d.coverpage;
}).catch(() => card.style.display='none');
});
}
function handleBookClick(id, title) {
selectedBookId = id; selectedBookTitle = title;
if (isMobileDevice()) ui.modalAction.classList.add('active'); else triggerReadOnline();
}
function triggerReadOnline() { closeActionModal(); loadReader(selectedBookId); }
function triggerReadInApp() { window.location.href = API.DEEP_LINK_BASE + selectedBookId; }
async function triggerShare() {
const url = API.DEEP_LINK_BASE + selectedBookId;
if(navigator.share) try { await navigator.share({ title: selectedBookTitle, url: url }); } catch(e) {}
else alert("Share Link: " + url);
}
// --- READER LOGIC ---
async function loadReader(id) {
ui.libView.classList.add('hidden'); ui.readView.classList.remove('hidden');
ui.pageContent.innerHTML = '<div class="loader">ବହି ଲୋଡ୍ ହେଉଛି...</div>';
try {
const res = await fetch(`${API.BOOK_BASE}${id}.json`); currentBook = await res.json();
ui.rhMainTitle.textContent = currentBook.title; ui.rhSubTitle.textContent = currentBook.author || "Odia Bhasa App";
updateSEO(currentBook.title, `ପଢନ୍ତୁ ${currentBook.title} - ${currentBook.author || 'ଓଡ଼ିଆ ପାଠାଗାର'} ଙ୍କ ଦ୍ବାରା ଲିଖିତ।`, `?book=${id}`);
renderPage(0);
} catch(e) { ui.pageContent.innerHTML = '<div class="loader">ତ୍ରୁଟି ହେଲା। ଦୟାକରି ଫେରିଯାଆନ୍ତୁ।</div>'; }
}
function renderPage(idx) {
stopAudio(); currentPage = idx; const page = currentBook.pages[idx]; let html = '';
const isIndexPage = (idx === 1 || currentBook.title.includes('ସୂଚୀ'));
const isFirstPage = (idx === 0);
if(page && page.content) {
page.content.forEach((item, i) => {
if(item.type === 'header') {
let innerText = item.text.replace(/\n/g, '<br>');
let headerClass = idx > 1 ? 'book-page-header' : 'content-p'; // Header styling after page 2
html += `<div class="${headerClass} ${isIndexPage ? 'text-purple' : ''}" onclick="${isIndexPage ? `findChapterAndGo('${innerText.replace(/<[^>]*>?/gm, '').trim()}')` : ''}">${innerText}</div>`;
} else if(item.type === 'paragraph') {
let innerText = '';
if(item.spans) {
innerText = item.spans.map(s => {
let txt = s.text.replace(/\n/g, '<br>');
if(s.style === 'bold') txt = `<strong>${txt}</strong>`;
if(s.style === 'italic') txt = `<em>${txt}</em>`;
return txt;
}).join('');
}
if(isIndexPage && innerText.length > 2) {
let coreText = innerText.replace(/<br>/g, ' ').replace(/^[୦-୯0-9.\s]+/, '').trim().split(' ')[0];
html += `<div class="content-p text-purple" onclick="findChapterAndGo('${coreText}')">${innerText}</div>`;
} else {
html += `<div class="content-p" id="chunk-${i}">${innerText}</div>`;
}
}
});
}
ui.pageContent.innerHTML = html;
if(isFirstPage) ui.pageContent.classList.add('first-page-center'); else ui.pageContent.classList.remove('first-page-center');
window.scrollTo(0,0);
const odiaNum = n => n.toString().replace(/\d/g, d => "୦୧୨୩୪୫୬୭୮୯"[d]);
ui.pageInd.textContent = `${odiaNum(idx+1)} / ${odiaNum(currentBook.pages.length)}`;
ui.btnPrev.style.visibility = idx === 0 ? 'hidden' : 'visible';
ui.btnNext.style.visibility = idx === currentBook.pages.length - 1 ? 'hidden' : 'visible';
resetNavTimer();
}
function changePage(dir) { if(!currentBook) return; const next = currentPage + dir; if(next >= 0 && next < currentBook.pages.length) renderPage(next); }
function exitReader() { stopAudio(); ui.readView.classList.add('hidden'); ui.libView.classList.remove('hidden'); updateSEO("ଓଡ଼ିଆ ପାଠାଗାର | Odia Bhasa App", "ଆମର ବିଶାଳ ପାଠାଗାରରୁ ମାଗଣାରେ ଓଡ଼ିଆ ବହି ପଢ଼ନ୍ତୁ।", window.location.pathname); }
function findChapterAndGo(q) {
if(!q || q.length < 2) return;
for(let i = 2; i < currentBook.pages.length; i++) if(JSON.stringify(currentBook.pages[i]).includes(q)) { renderPage(i); return; }
}
function doInBookSearch() {
const q = ui.inBookInput.value.trim().toLowerCase(); if(q.length < 2) { ui.searchResults.innerHTML = ''; return; }
let html = ''; const odiaNum = n => n.toString().replace(/\d/g, d => "୦୧୨୩୪୫୬୭୮୯"[d]);
currentBook.pages.forEach((p, idx) => { if(JSON.stringify(p).toLowerCase().includes(q)) html += `<div class="search-item" onclick="closeSearchModal(); renderPage(${idx});"><strong>ପୃଷ୍ଠା ${odiaNum(idx+1)}:</strong> ମିଳିଲା...</div>`; });
ui.searchResults.innerHTML = html || '<div class="search-item">କିଛି ମିଳିଲା ନାହିଁ</div>';
}
// --- SWIPE ---
function setupSwipe() {
ui.pageContent.addEventListener('touchstart', e => { touchstartX = e.changedTouches[0].screenX; }, {passive: true});
ui.pageContent.addEventListener('touchend', e => { touchendX = e.changedTouches[0].screenX; handleGesture(); }, {passive: true});
}
function handleGesture() { const th = 50; if (touchendX < touchstartX - th) changePage(1); if (touchendX > touchstartX + th) changePage(-1); }
function setupNavAutoHider() { ['mousemove', 'touchstart', 'click', 'scroll'].forEach(evt => document.addEventListener(evt, resetNavTimer, {passive: true})); }
function resetNavTimer() {
if(ui.readView.classList.contains('hidden') || !prefs.showArrows) return;
ui.btnPrev.classList.remove('faded'); ui.btnNext.classList.remove('faded');
clearTimeout(navTimeout); navTimeout = setTimeout(() => { ui.btnPrev.classList.add('faded'); ui.btnNext.classList.add('faded'); }, 3000);
}
// --- AUDIO ---
function toggleAudio() { isPlaying ? stopAudio() : startAudio(); }
function startAudio() {
audioChunks = []; currentChunkIndex = 0;
ui.pageContent.querySelectorAll('.content-p, .book-page-header').forEach((el, i) => { const txt = el.innerText.trim(); if(txt.length > 0) audioChunks.push({ text: txt, id: el.id || `auto-id-${i}` }); el.id = el.id || `auto-id-${i}`; });
if(audioChunks.length > 0) playChunk(0);
}
function playChunk(idx) {
if(idx >= audioChunks.length) { stopAudio(); return; } currentChunkIndex = idx;
document.querySelectorAll('.reading-active').forEach(e => e.classList.remove('reading-active'));
const activeEl = document.getElementById(audioChunks[idx].id);
if(activeEl) { activeEl.classList.add('reading-active'); activeEl.scrollIntoView({ behavior: 'smooth', block: 'center' }); }
synth.cancel(); const utt = new SpeechSynthesisUtterance(audioChunks[idx].text);
const voices = synth.getVoices(); let voice = voices.find(v => v.lang.includes('or') || v.name.toLowerCase().includes('odia'));
if(!voice) voice = voices.find(v => v.lang.includes('hi')); if(voice) utt.voice = voice; utt.rate = 0.9;
utt.onstart = () => { isPlaying = true; ui.audioIcon.innerHTML = `<path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>`; };
utt.onend = () => { if(isPlaying) playChunk(currentChunkIndex + 1); }; utt.onerror = () => stopAudio();
synth.speak(utt);
}
function stopAudio() { synth.cancel(); isPlaying = false; document.querySelectorAll('.reading-active').forEach(e => e.classList.remove('reading-active')); ui.audioIcon.innerHTML = `<path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/>`; }
</script>
</body>
</html>