-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
750 lines (664 loc) · 38.9 KB
/
Copy pathindex.html
File metadata and controls
750 lines (664 loc) · 38.9 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
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
<!DOCTYPE html>
<html lang="ar" dir="rtl" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- SEO Meta Tags -->
<title>كارد | Kard - صانع بطاقات الإهداء وبوسترات العروض الحصرية مجاناً</title>
<meta name="description" content="منصة كارد (Kard) لإنشاء وتصميم بطاقات الإهداء وتصاميم وبوسترات العروض الترويجية الاحترافية لمتاجر سلة وزد مع رموز QR كود مجاناً وبجودة عالية.">
<meta name="keywords" content="كارد, Kard, تصميم بطاقات إهداء, تصاميم متجر, بوسترات عروض, صانع كيو ار, QR code generator, بطاقة اهداء سلة, تصميم اعلان, صانع البطاقات, بطاقات عروض زد, كيو ار كود مجاني">
<meta name="author" content="BADAH_AI">
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
<!-- Canonical Link Pointing to GitHub Pages -->
<link rel="canonical" href="https://devsaudi.github.io/kard/">
<!-- Open Graph / Social Media Meta Tags -->
<meta property="og:type" content="website">
<meta property="og:title" content="كارد | Kard - صانع بطاقات الإهداء وبوسترات العروض">
<meta property="og:description" content="صمم بطاقات إهداء مخصصة وبوسترات إعلانية لمتجرك مجاناً وبأعلى جودة مع QR Code تلقائي.">
<meta property="og:url" content="https://devsaudi.github.io/kard/">
<meta property="og:site_name" content="كارد - Kard">
<meta property="og:locale" content="ar_SA">
<!-- Browser Tab Icon (Favicon) -->
<link rel="icon" type="image/png" href="https://img.icons8.com/isometric/512/gift-card.png">
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@BADAH_AI">
<meta name="twitter:creator" content="@BADAH_AI">
<meta name="twitter:title" content="كارد | Kard - مصمم بطاقات الإهداء وبوسترات العروض">
<meta name="twitter:description" content="أداة مجانية ومفتوحة المصدر لتصميم بطاقات الإهداء وبوسترات العروض الترويجية للمتاجر الإلكترونية مع توليد الـ QR.">
<meta name="twitter:image" content="https://img.icons8.com/isometric/512/gift-card.png">
<!-- Structured Data (JSON-LD) for Search Engines -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebApplication",
"@id": "https://devsaudi.github.io/kard/#webapp",
"name": "كارد | Kard",
"url": "https://devsaudi.github.io/kard/",
"description": "تطبيق ويب احترافي لتصميم بطاقات الإهداء وبوسترات العروض التجارية مع إمكانية تضمين رمز QR مجاناً.",
"applicationCategory": "DesignApplication",
"operatingSystem": "All",
"inLanguage": "ar-SA",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "SAR"
},
"creator": {
"@type": "Person",
"name": "BADAH_AI",
"url": "https://x.com/BADAH_AI"
}
},
{
"@type": "WebSite",
"@id": "https://devsaudi.github.io/kard/#website",
"url": "https://devsaudi.github.io/kard/",
"name": "كارد | Kard",
"description": "منصة تصميم بطاقات الإهداء وبوسترات العروض الحصرية",
"inLanguage": "ar-SA"
}
]
}
</script>
<!-- Fonts & External Libraries -->
<link href="https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<style>
:root[data-theme="light"] {
--bg-main: #f4f6f9;
--surface-card: #ffffff;
--border-color: #e5e7eb;
--accent-green: #10b981;
--text-main: #111827;
--text-sub: #6b7280;
--input-bg: #f9fafb;
--card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
--btn-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.06);
--btn-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.1);
}
:root[data-theme="dark"] {
--bg-main: #0b0f17;
--surface-card: #151c28;
--border-color: #232d3f;
--accent-green: #10b981;
--text-main: #f9fafb;
--text-sub: #9ca3af;
--input-bg: #0b0f17;
--card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
--btn-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.3);
--btn-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.5);
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Readex Pro', sans-serif; transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s; }
body {
background-color: var(--bg-main);
color: var(--text-main);
min-height: 100vh;
display: flex;
flex-direction: column;
}
header {
display: flex; justify-content: space-between; align-items: center;
padding: 1.2rem 8%;
border-bottom: 1px solid var(--border-color);
background: var(--surface-card);
position: sticky; top: 0; z-index: 100;
}
.logo-container { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.logo-icon {
width: 40px; height: 40px; background: var(--accent-green);
border-radius: 12px; display: flex; align-items: center; justify-content: center;
font-weight: 700; color: #fff; font-size: 1.2rem;
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.logo-text { font-size: 1.4rem; font-weight: 700; color: var(--text-main); letter-spacing: 0; }
.header-actions { display: flex; align-items: center; gap: 0.3rem; }
.icon-btn-transparent {
background: transparent; border: none;
color: var(--text-main); width: 40px; height: 40px; border-radius: 12px;
cursor: pointer; display: flex; align-items: center; justify-content: center;
transition: all 0.2s ease; position: relative;
}
.icon-btn-transparent:hover { background: var(--input-bg); }
.icon-btn-transparent svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lang-badge {
position: absolute; bottom: 2px; right: 2px; font-size: 0.65rem; font-weight: 700;
background: var(--accent-green); color: white; padding: 1px 4px; border-radius: 6px;
}
.tabs-wrapper { display: flex; justify-content: center; margin: 2rem 0 1.5rem; }
.tabs-box { display: flex; gap: 12px; }
.tab-card {
background: var(--surface-card); border: 1px solid var(--border-color);
padding: 0.8rem 1.6rem; border-radius: 16px; cursor: pointer;
font-weight: 500; font-size: 0.9rem; color: var(--text-sub);
box-shadow: var(--btn-shadow); transition: all 0.25s ease;
display: flex; align-items: center; gap: 8px;
}
.tab-card:hover {
transform: translateY(-2px); box-shadow: var(--btn-shadow-hover);
}
.tab-card.active {
background: var(--surface-card);
border-color: var(--accent-green);
color: var(--accent-green);
font-weight: 600;
box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
}
.main-container {
max-width: 1100px; margin: 0 auto 4rem; padding: 0 1.5rem;
display: grid; grid-template-columns: 380px 1fr; gap: 2rem;
flex: 1;
}
@media (max-width: 850px) { .main-container { grid-template-columns: 1fr; } }
.panel-box {
background: var(--surface-card); border: 1px solid var(--border-color);
border-radius: 20px; padding: 1.8rem; box-shadow: var(--card-shadow);
}
.panel-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 1.4rem; color: var(--text-main); }
.field-group { margin-bottom: 1rem; }
.field-group label { display: block; font-size: 0.8rem; color: var(--text-sub); margin-bottom: 0.4rem; font-weight: 500; }
.field-group input, .field-group textarea, .field-group select {
width: 100%; background: var(--input-bg); border: 1px solid var(--border-color);
border-radius: 12px; padding: 0.75rem 0.9rem; color: var(--text-main); font-size: 0.85rem;
}
.field-group input:focus, .field-group textarea:focus, .field-group select:focus {
outline: none; border-color: var(--accent-green);
}
.btn-card-primary {
width: 100%; background: var(--surface-card);
color: var(--text-main); border: 1px solid var(--border-color);
padding: 0.9rem; border-radius: 16px;
font-size: 0.9rem; font-weight: 600; cursor: pointer;
margin-top: 0.8rem; display: flex; align-items: center; justify-content: center; gap: 8px;
box-shadow: var(--btn-shadow); transition: all 0.25s ease;
}
.btn-card-primary:hover {
transform: translateY(-2px); border-color: var(--accent-green); color: var(--accent-green); box-shadow: var(--btn-shadow-hover);
}
.btn-remove-img {
background: transparent; border: 1px dashed #ef4444; color: #ef4444;
padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.75rem; cursor: pointer;
margin-top: 0.4rem; display: none; width: 100%; text-align: center;
}
.preview-wrapper {
background: var(--surface-card); border: 1px solid var(--border-color);
border-radius: 20px; padding: 2rem; box-shadow: var(--card-shadow);
display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 450px;
}
/* GIFT CARD DESIGN */
.card-frame {
width: 100%; max-width: 400px; min-height: 250px;
background-color: #ffffff;
background-size: cover;
background-position: center;
border-radius: 18px; padding: 1.8rem; position: relative;
box-shadow: 0 15px 35px rgba(0,0,0,0.08);
display: flex; flex-direction: column; justify-content: space-between;
border: 1px solid #e5e7eb;
overflow: hidden;
transition: all 0.3s ease;
}
.card-frame.has-bg::before {
content: ''; position: absolute; top:0; left:0; right:0; bottom:0;
background: rgba(0, 0, 0, 0.45); z-index: 1;
}
.card-header, .card-body, .card-footer { position: relative; z-index: 2; }
.card-header { text-align: center; border-bottom: 1px solid rgba(0,0,0,0.06); padding-bottom: 0.8rem; }
.card-frame.has-bg .card-header { border-bottom-color: rgba(255,255,255,0.2); }
.card-store { font-size: 1.2rem; font-weight: 700; color: #0f172a; letter-spacing: 0; }
.card-frame.has-bg .card-store { color: #ffffff; }
.card-body { text-align: center; margin: 1.2rem 0; }
.card-text { font-size: 0.95rem; line-height: 1.6; color: #374151; font-weight: 400; letter-spacing: 0; }
.card-frame.has-bg .card-text { color: #ffffff; }
.card-footer { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid rgba(0,0,0,0.06); padding-top: 0.8rem; }
.card-frame.has-bg .card-footer { border-top-color: rgba(255,255,255,0.2); }
.card-parties { font-size: 0.8rem; color: #6b7280; line-height: 1.5; text-align: right; letter-spacing: 0; }
.card-parties strong { color: #111827; font-weight: 600; }
.card-frame.has-bg .card-parties { color: #e2e8f0; }
.card-frame.has-bg .card-parties strong { color: #ffffff; }
.qr-canvas-box { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: #ffffff; padding: 3px; border-radius: 6px; }
.qr-canvas-box canvas { width: 44px !important; height: 44px !important; display: block; }
#posterCanvas { max-width: 100%; height: auto; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
/* FOOTER DESIGN - CENTERED & STACKED */
footer {
background: var(--surface-card);
border-top: 1px solid var(--border-color);
padding: 2rem 1.5rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1.2rem;
margin-top: auto;
text-align: center;
}
.footer-socials {
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
.social-link {
width: 42px;
height: 42px;
border-radius: 12px;
background: var(--input-bg);
border: 1px solid var(--border-color);
display: flex;
align-items: center;
justify-content: center;
color: var(--text-main);
text-decoration: none;
transition: all 0.25s ease;
}
.social-link:hover {
border-color: var(--accent-green);
color: var(--accent-green);
transform: translateY(-3px);
box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2);
}
.social-link svg {
width: 20px;
height: 20px;
fill: currentColor;
}
.footer-rights {
font-size: 0.85rem;
color: var(--text-sub);
font-weight: 400;
}
/* SEO Content Helper - Read by Crawlers Only */
.seo-readable-section {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
</style>
</head>
<body>
<header>
<a href="https://devsaudi.github.io/kard/" class="logo-container" title="كارد Kard - تصميم بطاقات إهداء وبوسترات">
<div class="logo-icon">ك</div>
<h1 class="logo-text">كارد</h1>
</a>
<div class="header-actions">
<!-- Dark/Light Theme Icon Button -->
<button class="icon-btn-transparent" onclick="toggleTheme()" id="themeBtn" aria-label="Toggle Theme" title="الوضع الداكن/الفاتح">
<svg id="themeIcon" viewBox="0 0 24 24"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
</button>
<!-- Language Icon Button -->
<button class="icon-btn-transparent" onclick="toggleLanguage()" id="langBtn" aria-label="Toggle Language" title="تغيير اللغة">
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>
<span class="lang-badge" id="langBadge">EN</span>
</button>
</div>
</header>
<main>
<div class="tabs-wrapper">
<div class="tabs-box">
<button class="tab-card active" onclick="switchTab('gift')" id="tabGift">
<span id="txtTabGift">بطاقات الإهداء</span>
</button>
<button class="tab-card" onclick="switchTab('poster')" id="tabPoster">
<span id="txtTabPoster">بوسترات العروض</span>
</button>
</div>
</div>
<div class="main-container">
<div class="panel-box">
<!-- Gift Controls -->
<div id="giftControls">
<h2 class="panel-title" id="txtGiftTitle">تخصيص بطاقة الإهداء</h2>
<div class="field-group">
<label id="lblCardBg">خلفية البطاقة (اختياري)</label>
<input type="file" id="cardBgInput" accept="image/*" onchange="loadCardBackground(event)">
<button class="btn-remove-img" id="btnRemoveBg" onclick="removeCardBackground()">حذف الخلفية المخصصة</button>
</div>
<div class="field-group">
<label id="lblStore">اسم المتجر</label>
<input type="text" id="storeName" value="متجر الفخامة" oninput="updateCard()">
</div>
<div class="field-group">
<label id="lblStoreUrl">رابط المتجر (تحويل لـ QR Code)</label>
<input type="text" id="storeUrl" value="https://salla.sa/my-store" oninput="updateCard()">
</div>
<div class="field-group">
<label id="lblSender">اسم المرسل</label>
<input type="text" id="senderName" value="عبدالله السلمان" oninput="updateCard()">
</div>
<div class="field-group">
<label id="lblReceiver">اسم المستلم</label>
<input type="text" id="receiverName" value="فيصل الخالد" oninput="updateCard()">
</div>
<div class="field-group">
<label id="lblMsg">عبارة الإهداء</label>
<textarea id="cardMsg" rows="3" oninput="updateCard()">كل عام وأنت بألف خير، أتمنى لك أياماً مليئة بالسعادة والنجاح.</textarea>
</div>
<button class="btn-card-primary" onclick="downloadCardImage()" id="btnPrint">
<span id="txtBtnPrint">تحميل البطاقة (صورة عالية الدقة)</span>
</button>
</div>
<!-- Poster Controls -->
<div id="posterControls" style="display: none;">
<h2 class="panel-title" id="txtPosterTitle">تخصيص البوستر الإعلاني</h2>
<div class="field-group">
<label id="lblPlatform">قياس المنصة</label>
<select id="pPlatform" onchange="drawPoster()">
<option value="square">منشور مربع (1:1)</option>
<option value="story">قصة / ستوري (9:16)</option>
</select>
</div>
<div class="field-group">
<label id="lblImage">صورة المنتج أو الخلفية</label>
<input type="file" id="pImgInput" accept="image/*" onchange="loadPosterImage(event)">
<button class="btn-remove-img" id="btnRemovePosterImg" onclick="removePosterImage()">حذف صورة البوستر</button>
</div>
<div class="field-group">
<label id="lblPStore">اسم المتجر</label>
<input type="text" id="pStore" value="متجر الفخامة" oninput="drawPoster()">
</div>
<div class="field-group">
<label id="lblPProduct">اسم المنتج / العرض</label>
<input type="text" id="pProduct" value="عطر السمو الملكي" oninput="drawPoster()">
</div>
<div class="field-group">
<label id="lblPPrice">السعر</label>
<input type="text" id="pPrice" value="299 ر.س (بدلاً من 450 ر.س)" oninput="drawPoster()">
</div>
<div class="field-group">
<label id="lblPOffer">عبارة التخفيض</label>
<input type="text" id="pOffer" value="خصم حصري 35% لفترة محدودة" oninput="drawPoster()">
</div>
<div class="field-group">
<label id="lblPUrl">رابط صفحة العرض (تحويل لـ QR Code)</label>
<input type="text" id="pUrl" value="https://salla.sa/my-store/product-1" oninput="drawPoster()">
</div>
<button class="btn-card-primary" onclick="downloadPoster()" id="btnDownload">
<span id="txtBtnDownload">تحميل البوستر (صورة عالية الدقة)</span>
</button>
</div>
</div>
<div class="preview-wrapper">
<!-- Gift Preview Screen -->
<div id="giftDisplay" style="width: 100%; display: flex; justify-content: center;">
<div class="card-frame" id="cardToCapture">
<div class="card-header">
<div class="card-store" id="prevStore">متجر الفخامة</div>
</div>
<div class="card-body">
<div class="card-text" id="prevMsg">"كل عام وأنت بألف خير، أتمنى لك أياماً مليئة بالسعادة والنجاح."</div>
</div>
<div class="card-footer">
<div class="card-parties">
<div><span id="lblFrom">من:</span> <strong id="prevSender">عبدالله السلمان</strong></div>
<div><span id="lblTo">إلى:</span> <strong id="prevReceiver">فيصل الخالد</strong></div>
</div>
<div class="qr-canvas-box">
<canvas id="cardQrCanvas"></canvas>
</div>
</div>
</div>
</div>
<!-- Poster Preview Screen -->
<div id="posterDisplay" style="display: none;">
<canvas id="posterCanvas" width="500" height="500"></canvas>
</div>
</div>
</div>
<!-- Structural SEO Content Section (Boosts indexing relevancy) -->
<section class="seo-readable-section">
<h2>تصميم بطاقات الإهداء وبوسترات التخفيضات أونلاين</h2>
<p>منصة كارد مجانية لإنشاء بطاقة إهداء مخصصة ومصممة خصيصاً للتجارة الإلكترونية ومتاجر سلة وزد. تتضمن المنصة مولد QR Code تلقائي لروابط المنتجات والعروض الترويجية بجودة عالية بدقة اتش دي.</p>
</section>
</main>
<canvas id="posterQrCanvas" style="display: none;"></canvas>
<footer>
<div class="footer-socials">
<!-- WhatsApp Icon with direct number link -->
<a href="https://wa.me/966590211191" target="_blank" rel="noopener noreferrer" class="social-link" title="تواصل عبر الواتساب" aria-label="WhatsApp">
<svg viewBox="0 0 24 24"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.521.151-.172.2-.296.3-.495.099-.198.05-.372-.025-.521-.075-.148-.669-1.611-.916-2.206-.242-.579-.487-.501-.669-.51l-.57-.01c-.198 0-.52.074-.792.372s-1.04 1.016-1.04 2.479 1.065 2.876 1.213 3.074c.149.198 2.095 3.2 5.076 4.487.709.306 1.263.489 1.694.626.712.226 1.36.194 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.695.248-1.29.173-1.414-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c0-5.445 4.43-9.874 9.877-9.874 2.637 0 5.116 1.028 6.98 2.894a9.81 9.81 0 012.888 6.982c-.001 5.447-4.431 9.875-9.863 9.875m0-18.133c-4.557 0-8.267 3.71-8.267 8.258a8.23 8.23 0 001.371 4.542l.2.318-.588 2.148 2.199-.577.308.183a8.23 8.23 0 004.773 1.503h.004c4.555 0 8.262-3.71 8.264-8.259 0-2.207-.86-4.283-2.423-5.848A8.2 8.2 0 0012.051 3.65"/></svg>
</a>
<!-- X (Twitter) Icon with direct account link -->
<a href="https://x.com/BADAH_AI" target="_blank" rel="noopener noreferrer" class="social-link" title="متابعة عبر منصة X" aria-label="X Platform">
<svg viewBox="0 0 24 24"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
</a>
</div>
<div class="footer-rights" id="txtRights">
جميع الحقوق محفوظة © كارد 2026
</div>
</footer>
<script>
let currentLang = 'ar';
let uploadedImage = null;
const moonSvg = '<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>';
const sunSvg = '<circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>';
function toggleTheme() {
const currentTheme = document.documentElement.getAttribute('data-theme');
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
document.documentElement.setAttribute('data-theme', newTheme);
document.getElementById('themeIcon').innerHTML = newTheme === 'light' ? moonSvg : sunSvg;
}
function renderQR(canvasId, text, size) {
try {
let el = document.getElementById(canvasId);
if (el) {
new QRious({
element: el,
value: text || 'https://salla.sa',
size: size || 150,
level: 'H'
});
}
} catch(e) { console.error("QR Error", e); }
}
window.onload = function() {
updateCard();
};
function switchTab(tab) {
if(tab === 'gift') {
document.getElementById('tabGift').classList.add('active');
document.getElementById('tabPoster').classList.remove('active');
document.getElementById('giftControls').style.display = 'block';
document.getElementById('posterControls').style.display = 'none';
document.getElementById('giftDisplay').style.display = 'flex';
document.getElementById('posterDisplay').style.display = 'none';
} else {
document.getElementById('tabPoster').classList.add('active');
document.getElementById('tabGift').classList.remove('active');
document.getElementById('posterControls').style.display = 'block';
document.getElementById('giftControls').style.display = 'none';
document.getElementById('posterDisplay').style.display = 'block';
document.getElementById('giftDisplay').style.display = 'none';
drawPoster();
}
}
function loadCardBackground(event) {
const reader = new FileReader();
reader.onload = function() {
const card = document.getElementById('cardToCapture');
card.style.backgroundImage = `url('${reader.result}')`;
card.classList.add('has-bg');
document.getElementById('btnRemoveBg').style.display = 'block';
}
if(event.target.files[0]) reader.readAsDataURL(event.target.files[0]);
}
function removeCardBackground() {
const card = document.getElementById('cardToCapture');
card.style.backgroundImage = 'none';
card.classList.remove('has-bg');
document.getElementById('cardBgInput').value = '';
document.getElementById('btnRemoveBg').style.display = 'none';
}
function updateCard() {
const store = document.getElementById('storeName').value;
const sender = document.getElementById('senderName').value;
const receiver = document.getElementById('receiverName').value;
const msg = '"' + document.getElementById('cardMsg').value + '"';
const url = document.getElementById('storeUrl').value;
document.getElementById('prevStore').innerText = store;
document.getElementById('prevSender').innerText = sender;
document.getElementById('prevReceiver').innerText = receiver;
document.getElementById('prevMsg').innerText = msg;
renderQR('cardQrCanvas', url, 150);
}
function downloadCardImage() {
updateCard();
const target = document.getElementById('cardToCapture');
html2canvas(target, {
scale: 3,
useCORS: true
}).then(canvas => {
const link = document.createElement('a');
link.download = 'kard-gift.png';
link.href = canvas.toDataURL('image/png');
link.click();
});
}
function loadPosterImage(event) {
const reader = new FileReader();
reader.onload = function() {
uploadedImage = new Image();
uploadedImage.onload = function() { drawPoster(); }
uploadedImage.src = reader.result;
document.getElementById('btnRemovePosterImg').style.display = 'block';
}
if(event.target.files[0]) reader.readAsDataURL(event.target.files[0]);
}
function removePosterImage() {
uploadedImage = null;
document.getElementById('pImgInput').value = '';
document.getElementById('btnRemovePosterImg').style.display = 'none';
drawPoster();
}
function drawPoster() {
const canvas = document.getElementById('posterCanvas');
const ctx = canvas.getContext('2d');
const platform = document.getElementById('pPlatform').value;
const pUrl = document.getElementById('pUrl').value;
if (platform === 'story') {
canvas.width = 1080;
canvas.height = 1920;
} else {
canvas.width = 1080;
canvas.height = 1080;
}
if (uploadedImage) {
ctx.drawImage(uploadedImage, 0, 0, canvas.width, canvas.height);
ctx.fillStyle = 'rgba(15, 23, 42, 0.75)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
} else {
ctx.fillStyle = '#0f172a';
ctx.fillRect(0, 0, canvas.width, canvas.height);
}
ctx.strokeStyle = '#10b981';
ctx.lineWidth = 8;
ctx.strokeRect(30, 30, canvas.width - 60, canvas.height - 60);
ctx.fillStyle = '#10b981';
ctx.font = 'bold 40px Readex Pro';
ctx.textAlign = 'center';
ctx.fillText(document.getElementById('pStore').value, canvas.width / 2, 120);
ctx.fillStyle = '#ffffff';
ctx.fillRect(120, 160, canvas.width - 240, 75);
ctx.fillStyle = '#0f172a';
ctx.font = 'bold 32px Readex Pro';
ctx.fillText(document.getElementById('pOffer').value, canvas.width / 2, 210);
let midY = canvas.height / 2 - 20;
ctx.fillStyle = '#ffffff';
ctx.font = 'bold 48px Readex Pro';
ctx.fillText(document.getElementById('pProduct').value, canvas.width / 2, midY);
ctx.fillStyle = '#94a3b8';
ctx.font = '38px Readex Pro';
ctx.fillText(document.getElementById('pPrice').value, canvas.width / 2, midY + 80);
renderQR('posterQrCanvas', pUrl, 200);
const posterQrCanvas = document.getElementById('posterQrCanvas');
const qrSize = 140;
const qrX = (canvas.width - qrSize) / 2;
const qrY = canvas.height - 250;
ctx.fillStyle = '#ffffff';
ctx.fillRect(qrX - 10, qrY - 10, qrSize + 20, qrSize + 20);
ctx.drawImage(posterQrCanvas, qrX, qrY, qrSize, qrSize);
ctx.fillStyle = '#94a3b8';
ctx.font = '26px Readex Pro';
ctx.fillText(currentLang === 'ar' ? 'امسح الرمز للطلب المباشر' : 'Scan QR Code to Order', canvas.width / 2, canvas.height - 70);
}
function downloadPoster() {
const canvas = document.getElementById('posterCanvas');
const link = document.createElement('a');
link.download = 'kard-poster.png';
link.href = canvas.toDataURL('image/png');
link.click();
}
function toggleLanguage() {
if (currentLang === 'ar') {
currentLang = 'en';
document.documentElement.setAttribute('dir', 'ltr');
document.getElementById('langBadge').innerText = 'AR';
document.getElementById('txtTabGift').innerText = 'Gift Cards';
document.getElementById('txtTabPoster').innerText = 'Promo Posters';
document.getElementById('txtGiftTitle').innerText = 'Gift Card Customization';
document.getElementById('lblCardBg').innerText = 'Card Background Image (Optional)';
document.getElementById('btnRemoveBg').innerText = 'Remove Custom Background';
document.getElementById('lblStore').innerText = 'Store Name';
document.getElementById('lblStoreUrl').innerText = 'Store URL (Links to QR)';
document.getElementById('lblSender').innerText = 'Sender Name';
document.getElementById('lblReceiver').innerText = 'Receiver Name';
document.getElementById('lblMsg').innerText = 'Gift Message';
document.getElementById('txtBtnPrint').innerText = 'Download Card (HD Image)';
document.getElementById('txtPosterTitle').innerText = 'Poster Customization';
document.getElementById('lblPlatform').innerText = 'Platform Aspect Ratio';
document.getElementById('lblImage').innerText = 'Product / Background Image';
document.getElementById('btnRemovePosterImg').innerText = 'Remove Poster Image';
document.getElementById('lblPStore').innerText = 'Store Name';
document.getElementById('lblPProduct').innerText = 'Product Name';
document.getElementById('lblPPrice').innerText = 'Price';
document.getElementById('lblPOffer').innerText = 'Discount Tagline';
document.getElementById('lblPUrl').innerText = 'Offer Link (Converts to QR)';
document.getElementById('txtBtnDownload').innerText = 'Download Poster (HD Image)';
document.getElementById('lblFrom').innerText = 'From:';
document.getElementById('lblTo').innerText = 'To:';
document.getElementById('txtRights').innerText = 'All Rights Reserved © Kard 2026';
} else {
currentLang = 'ar';
document.documentElement.setAttribute('dir', 'rtl');
document.getElementById('langBadge').innerText = 'EN';
document.getElementById('txtTabGift').innerText = 'بطاقات الإهداء';
document.getElementById('txtTabPoster').innerText = 'بوسترات العروض';
document.getElementById('txtGiftTitle').innerText = 'تخصيص بطاقة الإهداء';
document.getElementById('lblCardBg').innerText = 'خلفية البطاقة (اختياري)';
document.getElementById('btnRemoveBg').innerText = 'حذف الخلفية المخصصة';
document.getElementById('lblStore').innerText = 'اسم المتجر';
document.getElementById('lblStoreUrl').innerText = 'رابط المتجر (تحويل لـ QR Code)';
document.getElementById('lblSender').innerText = 'اسم المرسل';
document.getElementById('lblReceiver').innerText = 'اسم المستلم';
document.getElementById('lblMsg').innerText = 'عبارة الإهداء';
document.getElementById('txtBtnPrint').innerText = 'تحميل البطاقة (صورة عالية الدقة)';
document.getElementById('txtPosterTitle').innerText = 'تخصيص البوستر الإعلاني';
document.getElementById('lblPlatform').innerText = 'قياس المنصة';
document.getElementById('lblImage').innerText = 'صورة المنتج أو الخلفية';
document.getElementById('btnRemovePosterImg').innerText = 'حذف صورة البوستر';
document.getElementById('lblPStore').innerText = 'اسم المتجر';
document.getElementById('lblPProduct').innerText = 'اسم المنتج / العرض';
document.getElementById('lblPPrice').innerText = 'السعر';
document.getElementById('lblPOffer').innerText = 'عبارة التخفيض';
document.getElementById('lblPUrl').innerText = 'رابط صفحة العرض (تحويل لـ QR Code)';
document.getElementById('txtBtnDownload').innerText = 'تحميل البوستر (صورة عالية الدقة)';
document.getElementById('lblFrom').innerText = 'من:';
document.getElementById('lblTo').innerText = 'إلى:';
document.getElementById('txtRights').innerText = 'جميع الحقوق محفوظة © كارد 2026';
}
if(document.getElementById('posterControls').style.display !== 'none') {
drawPoster();
}
}
</script>
</body>
</html>