tahweel 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,792 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ar" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>تحويل | أداة تحويل PDF إلى نص</title>
7
+ <meta name="description" content="Convert PDF and image files to text using Google Drive OCR. Supports TXT, DOCX, and JSON output formats.">
8
+
9
+ <!-- Favicon -->
10
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
11
+ <link rel="icon" type="image/png" href="logo.png">
12
+ <link rel="apple-touch-icon" href="logo.png">
13
+
14
+ <!-- Google Fonts: Poppins for English, Cairo for Arabic -->
15
+ <link rel="preconnect" href="https://fonts.googleapis.com">
16
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
17
+ <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
18
+
19
+ <style>
20
+ :root {
21
+ --primary-color: #10b981;
22
+ --primary-hover: #059669;
23
+ --primary-light: #d1fae5;
24
+ --accent-blue: #3b82f6;
25
+ --accent-gold: #f59e0b;
26
+ --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #d1fae5 100%);
27
+ --text-dark: #1f2937;
28
+ --text-light: #6b7280;
29
+ --text-muted: #9ca3af;
30
+ --card-bg: rgba(255, 255, 255, 0.95);
31
+ --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
32
+ --card-shadow-hover: 0 20px 40px -10px rgba(16, 185, 129, 0.2), 0 15px 20px -10px rgba(0, 0, 0, 0.1);
33
+ }
34
+
35
+ * {
36
+ margin: 0;
37
+ padding: 0;
38
+ box-sizing: border-box;
39
+ }
40
+
41
+ html {
42
+ background: #ecfdf5; /* Fallback for overscroll */
43
+ }
44
+
45
+ body {
46
+ min-height: 100vh;
47
+ font-family: 'Cairo', sans-serif;
48
+ color: var(--text-dark);
49
+ line-height: 1.6;
50
+ overflow-x: hidden;
51
+ }
52
+
53
+ body.font-en {
54
+ font-family: 'Poppins', sans-serif;
55
+ }
56
+
57
+ /* Extended gradient background that covers overscroll */
58
+ body::before {
59
+ content: '';
60
+ position: fixed;
61
+ /* Extend beyond viewport for overscroll */
62
+ top: -50vh;
63
+ left: 0;
64
+ width: 100%;
65
+ height: 200vh;
66
+ background: linear-gradient(135deg,
67
+ #e6f7ed 0%, /* Extended top */
68
+ #f0fdf4 20%, /* Original gradient start */
69
+ #ecfdf5 50%,
70
+ #d1fae5 80%, /* Original gradient end */
71
+ #c6f6d5 100% /* Extended bottom */
72
+ );
73
+ pointer-events: none;
74
+ z-index: -2;
75
+ }
76
+
77
+ /* Background Pattern */
78
+ body::after {
79
+ content: '';
80
+ position: fixed;
81
+ top: 0;
82
+ left: 0;
83
+ width: 100%;
84
+ height: 100%;
85
+ background-image:
86
+ radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
87
+ radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
88
+ radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.04) 0%, transparent 40%);
89
+ pointer-events: none;
90
+ z-index: -1;
91
+ }
92
+
93
+ /* Language Toggle */
94
+ .lang-btn {
95
+ position: fixed;
96
+ top: 20px;
97
+ right: 20px;
98
+ background: white;
99
+ border: 1px solid #e5e7eb;
100
+ padding: 10px 20px;
101
+ border-radius: 25px;
102
+ font-family: inherit;
103
+ font-size: 0.9rem;
104
+ font-weight: 600;
105
+ color: var(--text-dark);
106
+ cursor: pointer;
107
+ box-shadow: 0 2px 10px rgba(0,0,0,0.08);
108
+ transition: all 0.3s ease;
109
+ display: flex;
110
+ align-items: center;
111
+ gap: 8px;
112
+ z-index: 1000;
113
+ }
114
+
115
+ html[dir="ltr"] .lang-btn {
116
+ right: auto;
117
+ left: 20px;
118
+ font-family: 'Cairo', sans-serif; /* Keep Arabic font for العربية button */
119
+ }
120
+
121
+ .lang-btn:hover {
122
+ background: #f9fafb;
123
+ transform: translateY(-2px);
124
+ box-shadow: 0 6px 20px rgba(0,0,0,0.12);
125
+ }
126
+
127
+ /* Container */
128
+ .container {
129
+ max-width: 1200px;
130
+ margin: 0 auto;
131
+ padding: 0 20px;
132
+ }
133
+
134
+ /* Hero Section */
135
+ .hero {
136
+ padding: 100px 0 60px;
137
+ text-align: center;
138
+ }
139
+
140
+ .logo {
141
+ width: 200px;
142
+ height: auto;
143
+ margin-bottom: 30px;
144
+ animation: float 3s ease-in-out infinite;
145
+ mix-blend-mode: multiply; /* Remove white background */
146
+ }
147
+
148
+ @keyframes float {
149
+ 0%, 100% { transform: translateY(0); }
150
+ 50% { transform: translateY(-10px); }
151
+ }
152
+
153
+ .hero h1 {
154
+ font-size: 3rem;
155
+ font-weight: 800;
156
+ color: var(--text-dark);
157
+ margin-bottom: 15px;
158
+ background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
159
+ -webkit-background-clip: text;
160
+ -webkit-text-fill-color: transparent;
161
+ background-clip: text;
162
+ }
163
+
164
+ .hero .tagline {
165
+ font-size: 1.25rem;
166
+ color: var(--text-light);
167
+ max-width: 600px;
168
+ margin: 0 auto 40px;
169
+ }
170
+
171
+ /* Buttons */
172
+ .btn-group {
173
+ display: flex;
174
+ gap: 15px;
175
+ justify-content: center;
176
+ flex-wrap: wrap;
177
+ }
178
+
179
+ .btn {
180
+ display: inline-flex;
181
+ align-items: center;
182
+ gap: 10px;
183
+ padding: 15px 30px;
184
+ border-radius: 50px;
185
+ font-family: inherit;
186
+ font-size: 1rem;
187
+ font-weight: 600;
188
+ text-decoration: none;
189
+ transition: all 0.3s ease;
190
+ cursor: pointer;
191
+ border: none;
192
+ }
193
+
194
+ .btn-primary {
195
+ background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
196
+ color: white;
197
+ box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
198
+ }
199
+
200
+ .btn-primary:hover {
201
+ transform: translateY(-3px);
202
+ box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
203
+ }
204
+
205
+ .btn-secondary {
206
+ background: white;
207
+ color: var(--text-dark);
208
+ border: 2px solid #e5e7eb;
209
+ }
210
+
211
+ .btn-secondary:hover {
212
+ border-color: var(--primary-color);
213
+ color: var(--primary-color);
214
+ transform: translateY(-3px);
215
+ }
216
+
217
+ .btn svg {
218
+ width: 20px;
219
+ height: 20px;
220
+ }
221
+
222
+ /* Section Styling */
223
+ section {
224
+ padding: 80px 0;
225
+ }
226
+
227
+ .section-title {
228
+ text-align: center;
229
+ font-size: 2rem;
230
+ font-weight: 700;
231
+ color: var(--text-dark);
232
+ margin-bottom: 15px;
233
+ }
234
+
235
+ .section-subtitle {
236
+ text-align: center;
237
+ font-size: 1.1rem;
238
+ color: var(--text-light);
239
+ margin-bottom: 50px;
240
+ max-width: 600px;
241
+ margin-left: auto;
242
+ margin-right: auto;
243
+ }
244
+
245
+ /* Video Section */
246
+ .videos-grid {
247
+ display: grid;
248
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
249
+ gap: 30px;
250
+ max-width: 900px;
251
+ margin: 0 auto;
252
+ }
253
+
254
+ .video-card {
255
+ background: var(--card-bg);
256
+ border-radius: 20px;
257
+ overflow: hidden;
258
+ box-shadow: var(--card-shadow);
259
+ transition: all 0.3s ease;
260
+ backdrop-filter: blur(10px);
261
+ border: 1px solid rgba(255,255,255,0.5);
262
+ }
263
+
264
+ .video-card:hover {
265
+ transform: translateY(-5px);
266
+ box-shadow: var(--card-shadow-hover);
267
+ }
268
+
269
+ .video-wrapper {
270
+ position: relative;
271
+ padding-bottom: 56.25%;
272
+ height: 0;
273
+ background: #000;
274
+ }
275
+
276
+ .video-wrapper iframe {
277
+ position: absolute;
278
+ top: 0;
279
+ left: 0;
280
+ width: 100%;
281
+ height: 100%;
282
+ border: none;
283
+ }
284
+
285
+ .video-card h3 {
286
+ padding: 20px;
287
+ font-size: 1.1rem;
288
+ font-weight: 600;
289
+ text-align: center;
290
+ color: var(--text-dark);
291
+ }
292
+
293
+ /* Features Section */
294
+ .features-grid {
295
+ display: grid;
296
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
297
+ gap: 25px;
298
+ }
299
+
300
+ .feature-card {
301
+ background: var(--card-bg);
302
+ padding: 30px;
303
+ border-radius: 20px;
304
+ box-shadow: var(--card-shadow);
305
+ transition: all 0.3s ease;
306
+ backdrop-filter: blur(10px);
307
+ border: 1px solid rgba(255,255,255,0.5);
308
+ text-align: center;
309
+ }
310
+
311
+ .feature-card:hover {
312
+ transform: translateY(-5px);
313
+ box-shadow: var(--card-shadow-hover);
314
+ }
315
+
316
+ .feature-icon {
317
+ width: 60px;
318
+ height: 60px;
319
+ background: var(--primary-light);
320
+ border-radius: 16px;
321
+ display: flex;
322
+ align-items: center;
323
+ justify-content: center;
324
+ margin: 0 auto 20px;
325
+ font-size: 28px;
326
+ }
327
+
328
+ .feature-card h3 {
329
+ font-size: 1.2rem;
330
+ font-weight: 700;
331
+ margin-bottom: 10px;
332
+ color: var(--text-dark);
333
+ }
334
+
335
+ .feature-card p {
336
+ font-size: 0.95rem;
337
+ color: var(--text-light);
338
+ }
339
+
340
+ /* Documentation Section */
341
+ .docs-section {
342
+ background: rgba(255,255,255,0.5);
343
+ border-radius: 30px;
344
+ padding: 50px;
345
+ max-width: 900px;
346
+ margin: 0 auto;
347
+ backdrop-filter: blur(10px);
348
+ border: 1px solid rgba(255,255,255,0.8);
349
+ }
350
+
351
+ .docs-section h2 {
352
+ margin-bottom: 30px;
353
+ }
354
+
355
+ .code-block {
356
+ background: #1f2937;
357
+ color: #f9fafb;
358
+ padding: 20px 25px;
359
+ border-radius: 12px;
360
+ font-family: 'Fira Code', 'Monaco', monospace;
361
+ font-size: 0.9rem;
362
+ overflow-x: auto;
363
+ margin: 20px 0;
364
+ direction: ltr;
365
+ text-align: left;
366
+ }
367
+
368
+ .code-block code {
369
+ color: #a5f3fc;
370
+ }
371
+
372
+ .code-block .comment {
373
+ color: #6b7280;
374
+ }
375
+
376
+ .code-block .cmd {
377
+ color: #34d399;
378
+ }
379
+
380
+ .docs-list {
381
+ list-style: none;
382
+ padding: 0;
383
+ }
384
+
385
+ .docs-list li {
386
+ padding: 12px 0;
387
+ border-bottom: 1px solid #e5e7eb;
388
+ display: flex;
389
+ align-items: flex-start;
390
+ gap: 12px;
391
+ }
392
+
393
+ .docs-list li:last-child {
394
+ border-bottom: none;
395
+ }
396
+
397
+ .docs-list .icon {
398
+ color: var(--primary-color);
399
+ font-size: 1.2rem;
400
+ margin-top: 2px;
401
+ }
402
+
403
+ .docs-list strong {
404
+ color: var(--text-dark);
405
+ }
406
+
407
+ /* Footer */
408
+ footer {
409
+ padding: 40px 0;
410
+ text-align: center;
411
+ color: var(--text-light);
412
+ font-size: 0.9rem;
413
+ }
414
+
415
+ footer a {
416
+ color: var(--primary-color);
417
+ text-decoration: none;
418
+ font-weight: 600;
419
+ transition: color 0.3s ease;
420
+ }
421
+
422
+ footer a:hover {
423
+ color: var(--primary-hover);
424
+ }
425
+
426
+ .footer-links {
427
+ display: flex;
428
+ justify-content: center;
429
+ gap: 30px;
430
+ margin-bottom: 20px;
431
+ }
432
+
433
+ .footer-links a {
434
+ display: flex;
435
+ align-items: center;
436
+ gap: 8px;
437
+ }
438
+
439
+ /* Animations */
440
+ @keyframes fadeUp {
441
+ from { opacity: 0; transform: translateY(30px); }
442
+ to { opacity: 1; transform: translateY(0); }
443
+ }
444
+
445
+ .animate-in {
446
+ animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
447
+ opacity: 0;
448
+ }
449
+
450
+ .delay-1 { animation-delay: 0.1s; }
451
+ .delay-2 { animation-delay: 0.2s; }
452
+ .delay-3 { animation-delay: 0.3s; }
453
+ .delay-4 { animation-delay: 0.4s; }
454
+
455
+ /* Responsive */
456
+ @media (max-width: 768px) {
457
+ .hero { padding: 80px 0 40px; }
458
+ .hero h1 { font-size: 2rem; }
459
+ .hero .tagline { font-size: 1rem; }
460
+ .logo { width: 150px; }
461
+ .btn { padding: 12px 24px; font-size: 0.9rem; }
462
+ section { padding: 50px 0; }
463
+ .section-title { font-size: 1.6rem; }
464
+ .docs-section { padding: 30px 20px; }
465
+ .lang-btn { padding: 8px 16px; font-size: 0.8rem; }
466
+ }
467
+ </style>
468
+ </head>
469
+ <body>
470
+ <!-- Language Toggle -->
471
+ <button class="lang-btn" onclick="toggleLanguage()" id="langBtn">
472
+ <span>🌐</span> <span id="btnText">English</span>
473
+ </button>
474
+
475
+ <!-- Hero Section -->
476
+ <section class="hero">
477
+ <div class="container">
478
+ <img src="logo.png" alt="Tahweel Logo" class="logo animate-in">
479
+ <p class="tagline animate-in delay-2" id="heroTagline">
480
+ أداة قوية لتحويل ملفات PDF والصور إلى نصوص باستخدام Google Drive OCR
481
+ </p>
482
+ <div class="btn-group animate-in delay-3">
483
+ <a href="https://github.com/ieasybooks/tahweel.rb/releases/latest" class="btn btn-primary" id="downloadBtn">
484
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
485
+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
486
+ <polyline points="7 10 12 15 17 10"></polyline>
487
+ <line x1="12" y1="15" x2="12" y2="3"></line>
488
+ </svg>
489
+ <span id="downloadText">تحميل للويندوز</span>
490
+ </a>
491
+ <a href="https://github.com/ieasybooks/tahweel.rb" class="btn btn-secondary" target="_blank">
492
+ <svg viewBox="0 0 24 24" fill="currentColor">
493
+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
494
+ </svg>
495
+ GitHub
496
+ </a>
497
+ </div>
498
+ </div>
499
+ </section>
500
+
501
+ <!-- Videos Section -->
502
+ <section id="videos">
503
+ <div class="container">
504
+ <h2 class="section-title" id="videosTitle">شاهد تحويل وهو يعمل</h2>
505
+ <p class="section-subtitle" id="videosSubtitle">
506
+ تعرف على كيفية استخدام تحويل من خلال هذه الفيديوهات التوضيحية
507
+ </p>
508
+ <div class="videos-grid">
509
+ <div class="video-card">
510
+ <div class="video-wrapper">
511
+ <!-- TODO: Add video URL --> <iframe
512
+ src=""
513
+ title="Desktop App Preview"
514
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
515
+ allowfullscreen>
516
+ </iframe>
517
+ </div>
518
+ <h3 id="video1Title">عرض تطبيق سطح المكتب</h3>
519
+ </div>
520
+ <div class="video-card">
521
+ <div class="video-wrapper">> <iframe
522
+ src="https://www.youtube.com/embed/e7s4aukDs48"
523
+ title="CLI Usage Preview"
524
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
525
+ allowfullscreen>
526
+ </iframe>
527
+ </div>
528
+ <h3 id="video2Title">استخدام سطر الأوامر</h3>
529
+ </div>
530
+ </div>
531
+ </div>
532
+ </section>
533
+
534
+ <!-- Features Section -->
535
+ <section id="features">
536
+ <div class="container">
537
+ <h2 class="section-title" id="featuresTitle">المميزات</h2>
538
+ <p class="section-subtitle" id="featuresSubtitle">
539
+ أداة قوية لتحويل المستندات بكفاءة عالية
540
+ </p>
541
+ <div class="features-grid">
542
+ <div class="feature-card">
543
+ <div class="feature-icon">📄</div>
544
+ <h3 id="feature1Title">تعدد الصيغ</h3>
545
+ <p id="feature1Desc">دعم ملفات PDF والصور (JPG و JPEG و PNG) مع دعم مخرجات بصيغ TXT و DOCX و JSON</p>
546
+ </div>
547
+ <div class="feature-card">
548
+ <div class="feature-icon">⚡</div>
549
+ <h3 id="feature2Title">معالجة متوازية</h3>
550
+ <p id="feature2Desc">معالجة متوازية للملفات والصفحات لأداء فائق السرعة</p>
551
+ </div>
552
+ <div class="feature-card">
553
+ <div class="feature-icon">🔤</div>
554
+ <h3 id="feature3Title">دعم العربية</h3>
555
+ <p id="feature3Desc">محاذاة تلقائية من اليمين لليسار عند اكتشاف النصوص العربية</p>
556
+ </div>
557
+ <div class="feature-card">
558
+ <div class="feature-icon">📊</div>
559
+ <h3 id="feature4Title">تتبع التقدم</h3>
560
+ <p id="feature4Desc">واجهة طرفية ملونة تعرض حالة كل ملف ونسبة الإنجاز</p>
561
+ </div>
562
+ <div class="feature-card">
563
+ <div class="feature-icon">📁</div>
564
+ <h3 id="feature5Title">معالجة المجلدات</h3>
565
+ <p id="feature5Desc">اكتشاف تلقائي للملفات مع الحفاظ على بنية المجلدات</p>
566
+ </div>
567
+ <div class="feature-card">
568
+ <div class="feature-icon">🔄</div>
569
+ <h3 id="feature6Title">إعادة المحاولة</h3>
570
+ <p id="feature6Desc">آلية ذكية للتعامل مع أخطاء API وحدود الاستخدام</p>
571
+ </div>
572
+ </div>
573
+ </div>
574
+ </section>
575
+
576
+ <!-- Documentation Section -->
577
+ <section id="docs">
578
+ <div class="container">
579
+ <div class="docs-section">
580
+ <h2 class="section-title" id="docsTitle">الاستخدام للمبرمجين</h2>
581
+ <p class="section-subtitle" id="docsSubtitle">
582
+ ابدأ باستخدام تحويل في دقائق معدودة
583
+ </p>
584
+
585
+ <h3 id="installTitle" style="margin-top: 30px; margin-bottom: 15px;">التثبيت</h3>
586
+ <div class="code-block">
587
+ <span class="comment"># Install via RubyGems</span><br>
588
+ <span class="cmd">gem</span> install tahweel
589
+ </div>
590
+
591
+ <h3 id="usageTitle" style="margin-top: 30px; margin-bottom: 15px;">الاستخدام</h3>
592
+ <div class="code-block">
593
+ <span class="comment"># Convert a single PDF file</span><br>
594
+ <span class="cmd">tahweel</span> document.pdf<br><br>
595
+ <span class="comment"># Convert all PDFs in a directory</span><br>
596
+ <span class="cmd">tahweel</span> ./documents/<br><br>
597
+ <span class="comment"># Specify output formats</span><br>
598
+ <span class="cmd">tahweel</span> document.pdf -f txt,docx,json<br><br>
599
+ <span class="comment"># Set output directory</span><br>
600
+ <span class="cmd">tahweel</span> ./documents/ -o ./output/
601
+ </div>
602
+
603
+ </div>
604
+ </div>
605
+ </section>
606
+
607
+ <!-- Footer -->
608
+ <footer>
609
+ <div class="container">
610
+ <div class="footer-links">
611
+ <a href="https://github.com/ieasybooks/tahweel.rb" target="_blank">
612
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
613
+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
614
+ </svg>
615
+ GitHub
616
+ </a>
617
+ <a href="https://github.com/ieasybooks/tahweel.rb/releases" target="_blank" id="releasesLink">
618
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
619
+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
620
+ <polyline points="7 10 12 15 17 10"></polyline>
621
+ <line x1="12" y1="15" x2="12" y2="3"></line>
622
+ </svg>
623
+ <span id="releasesText">الإصدارات</span>
624
+ </a>
625
+ <a href="https://ieasybooks.com" target="_blank">
626
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
627
+ <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
628
+ <polyline points="9 22 9 12 15 12 15 22"></polyline>
629
+ </svg>
630
+ iEasyBooks
631
+ </a>
632
+ <a href="privacy.html">
633
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
634
+ <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
635
+ </svg>
636
+ <span id="privacyText">الخصوصية</span>
637
+ </a>
638
+ </div>
639
+ <p id="footerText">
640
+ صُنع بـ ❤️ بواسطة <a href="https://ieasybooks.com" target="_blank">iEasyBooks</a>
641
+ </p>
642
+ </div>
643
+ </footer>
644
+
645
+ <script>
646
+ // Content Dictionary
647
+ const content = {
648
+ ar: {
649
+ btn: "English",
650
+ pageTitle: "تحويل | أداة تحويل PDF إلى نص",
651
+ heroTagline: "أداة قوية لتحويل ملفات PDF والصور إلى نصوص باستخدام Google Drive OCR",
652
+ downloadText: "تحميل للويندوز",
653
+ videosTitle: "شاهد تحويل وهو يعمل",
654
+ videosSubtitle: "تعرف على كيفية استخدام تحويل من خلال هذه الفيديوهات التوضيحية",
655
+ video1Title: "عرض تطبيق سطح المكتب",
656
+ video2Title: "استخدام سطر الأوامر",
657
+ featuresTitle: "المميزات",
658
+ featuresSubtitle: "أداة قوية لتحويل المستندات بكفاءة عالية",
659
+ feature1Title: "تعدد الصيغ",
660
+ feature1Desc: "دعم ملفات PDF والصور (JPG و JPEG و PNG) مع دعم مخرجات بصيغ TXT و DOCX و JSON",
661
+ feature2Title: "معالجة متوازية",
662
+ feature2Desc: "معالجة متوازية للملفات والصفحات لأداء فائق السرعة",
663
+ feature3Title: "دعم العربية",
664
+ feature3Desc: "محاذاة تلقائية من اليمين لليسار عند اكتشاف النصوص العربية",
665
+ feature4Title: "تتبع التقدم",
666
+ feature4Desc: "واجهة طرفية ملونة تعرض حالة كل ملف ونسبة الإنجاز",
667
+ feature5Title: "معالجة المجلدات",
668
+ feature5Desc: "اكتشاف تلقائي للملفات مع الحفاظ على بنية المجلدات",
669
+ feature6Title: "إعادة المحاولة",
670
+ feature6Desc: "آلية ذكية للتعامل مع أخطاء API وحدود الاستخدام",
671
+ docsTitle: "الاستخدام للمبرمجين",
672
+ docsSubtitle: "ابدأ باستخدام تحويل في دقائق معدودة",
673
+ installTitle: "التثبيت",
674
+ usageTitle: "الاستخدام",
675
+ releasesText: "الإصدارات",
676
+ privacyText: "الخصوصية",
677
+ footerText: "صُنع بـ ❤️ بواسطة"
678
+ },
679
+ en: {
680
+ btn: "العربية",
681
+ pageTitle: "Tahweel | PDF to Text OCR Tool",
682
+ heroTagline: "A powerful tool to convert PDF and image files to text using Google Drive OCR",
683
+ downloadText: "Download for Windows",
684
+ videosTitle: "Watch Tahweel in Action",
685
+ videosSubtitle: "Learn how to use Tahweel through these tutorial videos",
686
+ video1Title: "Desktop App Preview",
687
+ video2Title: "CLI Usage Preview",
688
+ featuresTitle: "Features",
689
+ featuresSubtitle: "A powerful tool for efficient document conversion",
690
+ feature1Title: "Multiple Formats",
691
+ feature1Desc: "Support for PDF and images (JPG, JPEG, PNG) with TXT, DOCX, JSON output",
692
+ feature2Title: "Parallel Processing",
693
+ feature2Desc: "Parallel processing of files and pages for blazing speed",
694
+ feature3Title: "Arabic Support",
695
+ feature3Desc: "Automatic right-to-left alignment when Arabic text is detected",
696
+ feature4Title: "Progress Tracking",
697
+ feature4Desc: "Colored terminal UI showing each file's status and completion percentage",
698
+ feature5Title: "Directory Processing",
699
+ feature5Desc: "Automatic file discovery with directory structure preservation",
700
+ feature6Title: "Smart Retry",
701
+ feature6Desc: "Intelligent handling of API errors and rate limits",
702
+ docsTitle: "For Developers",
703
+ docsSubtitle: "Get started with Tahweel in minutes",
704
+ installTitle: "Installation",
705
+ usageTitle: "Usage",
706
+ releasesText: "Releases",
707
+ privacyText: "Privacy",
708
+ footerText: "Made with ❤️ by"
709
+ }
710
+ };
711
+
712
+ let currentLang = 'ar';
713
+
714
+ function toggleLanguage() {
715
+ currentLang = currentLang === 'ar' ? 'en' : 'ar';
716
+ const c = content[currentLang];
717
+
718
+ // Toggle Direction and Lang Attribute
719
+ const htmlEl = document.documentElement;
720
+ htmlEl.lang = currentLang;
721
+ htmlEl.dir = currentLang === 'ar' ? 'rtl' : 'ltr';
722
+
723
+ // Toggle Font Class
724
+ document.body.classList.toggle('font-en', currentLang === 'en');
725
+
726
+ // Update page title
727
+ document.title = c.pageTitle;
728
+
729
+ // Update all text content
730
+ document.getElementById('btnText').textContent = c.btn;
731
+ document.getElementById('heroTagline').textContent = c.heroTagline;
732
+ document.getElementById('downloadText').textContent = c.downloadText;
733
+ document.getElementById('videosTitle').textContent = c.videosTitle;
734
+ document.getElementById('videosSubtitle').textContent = c.videosSubtitle;
735
+ document.getElementById('video1Title').textContent = c.video1Title;
736
+ document.getElementById('video2Title').textContent = c.video2Title;
737
+ document.getElementById('featuresTitle').textContent = c.featuresTitle;
738
+ document.getElementById('featuresSubtitle').textContent = c.featuresSubtitle;
739
+ document.getElementById('feature1Title').textContent = c.feature1Title;
740
+ document.getElementById('feature1Desc').textContent = c.feature1Desc;
741
+ document.getElementById('feature2Title').textContent = c.feature2Title;
742
+ document.getElementById('feature2Desc').textContent = c.feature2Desc;
743
+ document.getElementById('feature3Title').textContent = c.feature3Title;
744
+ document.getElementById('feature3Desc').textContent = c.feature3Desc;
745
+ document.getElementById('feature4Title').textContent = c.feature4Title;
746
+ document.getElementById('feature4Desc').textContent = c.feature4Desc;
747
+ document.getElementById('feature5Title').textContent = c.feature5Title;
748
+ document.getElementById('feature5Desc').textContent = c.feature5Desc;
749
+ document.getElementById('feature6Title').textContent = c.feature6Title;
750
+ document.getElementById('feature6Desc').textContent = c.feature6Desc;
751
+ document.getElementById('docsTitle').textContent = c.docsTitle;
752
+ document.getElementById('docsSubtitle').textContent = c.docsSubtitle;
753
+ document.getElementById('installTitle').textContent = c.installTitle;
754
+ document.getElementById('usageTitle').textContent = c.usageTitle;
755
+ document.getElementById('releasesText').textContent = c.releasesText;
756
+ document.getElementById('privacyText').textContent = c.privacyText;
757
+ document.getElementById('footerText').innerHTML = c.footerText + ' <a href="https://ieasybooks.com" target="_blank">iEasyBooks</a>';
758
+ }
759
+
760
+ // Fetch latest release EXE download URL from GitHub API
761
+ async function fetchLatestRelease() {
762
+ try {
763
+ const response = await fetch('https://api.github.com/repos/ieasybooks/tahweel.rb/releases/latest');
764
+ const release = await response.json();
765
+
766
+ // Find the .exe asset
767
+ const exeAsset = release.assets.find(asset => asset.name.endsWith('.exe'));
768
+
769
+ if (exeAsset) {
770
+ const downloadBtn = document.getElementById('downloadBtn');
771
+ downloadBtn.href = exeAsset.browser_download_url;
772
+ }
773
+ } catch (error) {
774
+ console.log('Could not fetch latest release, using fallback URL');
775
+ }
776
+ }
777
+
778
+ // Fetch release on page load
779
+ fetchLatestRelease();
780
+
781
+ // Smooth scroll for anchor links
782
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
783
+ anchor.addEventListener('click', function (e) {
784
+ e.preventDefault();
785
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
786
+ behavior: 'smooth'
787
+ });
788
+ });
789
+ });
790
+ </script>
791
+ </body>
792
+ </html>