Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
828 lines (728 loc) · 32 KB
/
Copy pathindex.html
File metadata and controls
828 lines (728 loc) · 32 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
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
<!DOCTYPE html>
<html lang="fr" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="Simi UI - Construit sur SimilarCSS, un framework basé sur Bootstrap et Tailwind avec un accent centré sur les composants pour une stylisation meilleure, rapide et fluide">
<meta name="keywords" content="UI, composants, CSS, Bootstrap, Tailwind, framework">
<title>Simi UI - Bibliothèque de Composants</title>
<!-- Styles -->
<link rel="stylesheet" href="similar.css">
<link rel="stylesheet" href="styles/simi-original/simi-components.css">
<link rel="stylesheet" href="styles/simi-custom/simi-custom-components.css">
<link rel="stylesheet" href="styles/themes.css">
<link rel="stylesheet" href="styles/modern-utilities.css">
<link rel="stylesheet" href="components/full-components.css">
<link rel="stylesheet" href="components/less-components.css">
<link rel="stylesheet" href="icons/simi-icons.css">
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="logo/Simi UI2.svg">
<style>
/* Variables globales pour les thèmes */
:root {
--sidebar-width: 280px;
--header-height: 70px;
--primary-color: #0d6efd;
--bg-primary: #ffffff;
--bg-secondary: #f8f9fa;
--text-primary: #212529;
--text-secondary: #6c757d;
--border-color: #dee2e6;
--shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] {
--primary-color: #4d9fff;
--bg-primary: #1a1a1a;
--bg-secondary: #2d2d2d;
--text-primary: #ffffff;
--text-secondary: #b0b0b0;
--border-color: #404040;
--shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg-secondary);
color: var(--text-primary);
transition: background-color 0.3s, color 0.3s;
}
/* Header */
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--header-height);
background-color: var(--bg-primary);
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
padding: 0 2rem;
z-index: 1000;
box-shadow: var(--shadow);
}
.header-logo {
display: flex;
align-items: center;
gap: 1rem;
font-size: 1.5rem;
font-weight: bold;
color: var(--primary-color);
text-decoration: none;
}
.header-logo img {
height: 40px;
width: auto;
}
.header-search {
flex: 1;
max-width: 600px;
margin: 0 2rem;
}
.search-input {
width: 100%;
padding: 0.75rem 1rem;
border: 1px solid var(--border-color);
border-radius: 8px;
background-color: var(--bg-secondary);
color: var(--text-primary);
font-size: 0.95rem;
transition: all 0.3s;
}
.search-input:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}
.header-actions {
display: flex;
gap: 1rem;
align-items: center;
}
.hamburger-btn {
display: none;
flex-direction: column;
gap: 4px;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
}
.hamburger-btn span {
width: 24px;
height: 3px;
background-color: var(--text-primary);
transition: all 0.3s;
border-radius: 2px;
}
.hamburger-btn.active span:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.active span:nth-child(2) {
opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
transform: rotate(-45deg) translate(7px, -6px);
}
.theme-picker-container {
position: relative;
}
.theme-picker-dropdown {
position: absolute;
top: 100%;
right: 0;
margin-top: 0.5rem;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 1rem;
box-shadow: var(--shadow);
display: none;
min-width: 250px;
z-index: 1001;
}
.theme-picker-dropdown.active {
display: block;
}
.theme-option {
padding: 0.75rem;
margin-bottom: 0.5rem;
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.75rem;
transition: all 0.2s;
}
.theme-option:hover {
background: var(--bg-secondary);
}
.theme-color-preview {
width: 30px;
height: 30px;
border-radius: 50%;
border: 2px solid var(--border-color);
}
.custom-color-picker {
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--border-color);
}
.color-input-wrapper {
display: flex;
gap: 0.5rem;
align-items: center;
}
.color-input-wrapper input[type="color"] {
width: 50px;
height: 40px;
border: none;
border-radius: 6px;
cursor: pointer;
}
.color-input-wrapper button {
padding: 0.5rem 1rem;
background: var(--primary-color);
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 0.9rem;
}
.theme-selector {
padding: 0.5rem 1rem;
border: 1px solid var(--border-color);
border-radius: 6px;
background-color: var(--bg-secondary);
color: var(--text-primary);
cursor: pointer;
font-size: 0.9rem;
}
/* Sidebar */
.sidebar {
position: fixed;
top: var(--header-height);
left: 0;
width: var(--sidebar-width);
height: calc(100vh - var(--header-height));
background-color: var(--bg-primary);
border-right: 1px solid var(--border-color);
overflow-y: auto;
padding: 1.5rem;
z-index: 900;
}
.sidebar-section {
margin-bottom: 2rem;
}
.sidebar-title {
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-secondary);
margin-bottom: 0.75rem;
}
.sidebar-menu {
list-style: none;
}
.sidebar-menu li {
margin-bottom: 0.25rem;
}
.sidebar-link {
display: block;
padding: 0.5rem 0.75rem;
color: var(--text-primary);
text-decoration: none;
border-radius: 6px;
transition: all 0.2s;
font-size: 0.95rem;
}
.sidebar-link:hover {
background-color: var(--bg-secondary);
color: var(--primary-color);
}
.sidebar-link.active {
background-color: var(--primary-color);
color: white;
}
/* Main Content */
.main-content {
margin-left: var(--sidebar-width);
margin-top: var(--header-height);
padding: 2rem;
min-height: calc(100vh - var(--header-height));
}
.content-container {
max-width: 1400px;
margin: 0 auto;
}
.page-title {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 1rem;
color: var(--text-primary);
}
.page-description {
font-size: 1.1rem;
color: var(--text-secondary);
margin-bottom: 3rem;
line-height: 1.6;
}
/* Cards Grid */
.components-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1.5rem;
margin-bottom: 3rem;
}
.component-card {
background-color: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 1.5rem;
transition: all 0.3s;
cursor: pointer;
text-decoration: none;
display: block;
}
.component-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
border-color: var(--primary-color);
}
.component-card-title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--text-primary);
}
.component-card-description {
font-size: 0.9rem;
color: var(--text-secondary);
line-height: 1.5;
}
.component-card-badge {
display: inline-block;
padding: 0.25rem 0.75rem;
background-color: var(--primary-color);
color: white;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
margin-top: 1rem;
}
/* Search Results */
.search-results {
display: none;
position: absolute;
top: 100%;
left: 0;
right: 0;
background-color: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 8px;
margin-top: 0.5rem;
max-height: 400px;
overflow-y: auto;
box-shadow: var(--shadow);
z-index: 1001;
}
.search-results.active {
display: block;
}
.search-result-item {
padding: 1rem;
border-bottom: 1px solid var(--border-color);
cursor: pointer;
transition: background-color 0.2s;
}
.search-result-item:hover {
background-color: var(--bg-secondary);
}
.search-result-item:last-child {
border-bottom: none;
}
.search-result-title {
font-weight: 600;
color: var(--text-primary);
margin-bottom: 0.25rem;
}
.search-result-description {
font-size: 0.85rem;
color: var(--text-secondary);
}
/* Responsive */
@media (max-width: 768px) {
.sidebar {
transform: translateX(-100%);
transition: transform 0.3s;
z-index: 999;
}
.sidebar.active {
transform: translateX(0);
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}
.main-content {
margin-left: 0;
}
.header-search {
display: none;
}
.hamburger-btn {
display: flex;
}
}
</style>
</head>
<body>
<!-- Header -->
<header class="header">
<button class="hamburger-btn" id="hamburgerBtn">
<span></span>
<span></span>
<span></span>
</button>
<a href="index.html" class="header-logo">
<img src="logo/Simi UI2.svg" alt="Simi UI Logo">
<span>Simi UI</span>
</a>
<div class="header-search" style="position: relative;">
<input type="text" class="search-input" id="globalSearch"
placeholder="Rechercher des composants, classes CSS...">
<div class="search-results" id="searchResults"></div>
</div>
<div class="header-actions">
<div class="theme-picker-container">
<button class="theme-selector" id="themeToggle">🎨 Thèmes</button>
<div class="theme-picker-dropdown" id="themePicker">
<div class="theme-option" data-theme="light">
<div class="theme-color-preview"
style="background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);"></div>
<span>Clair</span>
</div>
<div class="theme-option" data-theme="dark">
<div class="theme-color-preview"
style="background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);"></div>
<span>Sombre</span>
</div>
<div class="theme-option" data-theme="blue">
<div class="theme-color-preview"
style="background: linear-gradient(135deg, #0066cc 0%, #0080ff 100%);"></div>
<span>Bleu</span>
</div>
<div class="theme-option" data-theme="purple">
<div class="theme-color-preview"
style="background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);"></div>
<span>Violet</span>
</div>
<div class="theme-option" data-theme="green">
<div class="theme-color-preview"
style="background: linear-gradient(135deg, #059669 0%, #10b981 100%);"></div>
<span>Vert</span>
</div>
<div class="theme-option" data-theme="orange">
<div class="theme-color-preview"
style="background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);"></div>
<span>Orange</span>
</div>
<div class="theme-option" data-theme="pink">
<div class="theme-color-preview"
style="background: linear-gradient(135deg, #db2777 0%, #ec4899 100%);"></div>
<span>Rose</span>
</div>
<div class="theme-option" data-theme="teal">
<div class="theme-color-preview"
style="background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);"></div>
<span>Turquoise</span>
</div>
<div class="custom-color-picker">
<label style="font-size: 0.9rem; margin-bottom: 0.5rem; display: block;">Couleur
personnalisée</label>
<div class="color-input-wrapper">
<input type="color" id="customColorPicker" value="#0d6efd">
<button onclick="applyCustomTheme()">Appliquer</button>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Sidebar -->
<aside class="sidebar" id="sidebar">
<nav>
<div class="sidebar-section">
<h3 class="sidebar-title">Démarrage</h3>
<ul class="sidebar-menu">
<li><a href="index.html" class="sidebar-link active">
Accueil</a></li>
<li><a href="pages/getting-started.html" class="sidebar-link">Installation</a></li>
<li><a href="pages/documentation.html" class="sidebar-link">Documentation</a></li>
</ul>
</div>
<div class="sidebar-section">
<h3 class="sidebar-title">Composants</h3>
<ul class="sidebar-menu">
<li><a href="pages/components/buttons.html" class="sidebar-link">Boutons</a></li>
<li><a href="pages/components/cards.html" class="sidebar-link">Cartes</a></li>
<li><a href="pages/components/forms.html" class="sidebar-link">Formulaires</a></li>
<li><a href="pages/components/modals.html" class="sidebar-link">Modales</a></li>
<li><a href="pages/components/navigation.html" class="sidebar-link"><i class="si si-menu"></i>
Navigation</a></li>
<li><a href="pages/components/alerts.html" class="sidebar-link">Alertes</a></li>
<li><a href="pages/components/badges.html" class="sidebar-link">Badges</a></li>
<li><a href="pages/components/tooltips.html" class="sidebar-link">Tooltips</a></li>
<li><a href="pages/components/dropdowns.html" class="sidebar-link">Dropdowns</a></li>
<li><a href="pages/components/tables.html" class="sidebar-link">Tableaux</a></li>
</ul>
</div>
<div class="sidebar-section">
<h3 class="sidebar-title">Layout</h3>
<ul class="sidebar-menu">
<li><a href="pages/layout/grid.html" class="sidebar-link">Grille</a></li>
<li><a href="pages/layout/flexbox.html" class="sidebar-link">Flexbox</a></li>
<li><a href="pages/layout/containers.html" class="sidebar-link">Conteneurs</a></li>
</ul>
</div>
<div class="sidebar-section">
<h3 class="sidebar-title">Utilitaires</h3>
<ul class="sidebar-menu">
<li><a href="pages/utilities/colors.html" class="sidebar-link">Couleurs</a></li>
<li><a href="pages/utilities/spacing.html" class="sidebar-link">Espacement</a></li>
<li><a href="pages/utilities/typography.html" class="sidebar-link">Typographie</a></li>
<li><a href="pages/utilities/filters.html" class="sidebar-link">Filtres CSS</a></li>
<li><a href="pages/utilities/shadows.html" class="sidebar-link">Ombres</a></li>
</ul>
</div>
<div class="sidebar-section">
<h3 class="sidebar-title">Composants Spéciaux</h3>
<ul class="sidebar-menu">
<li><a href="pages/special/s-components.html" class="sidebar-link">Composants -s-</a></li>
<li><a href="pages/components-demo.html" class="sidebar-link"><i class="si si-star"></i> Full &
Less</a></li>
</ul>
</div>
<div class="sidebar-section">
<h3 class="sidebar-title">Support</h3>
<ul class="sidebar-menu">
<li><a href="pages/report-bug.html" class="sidebar-link"><i class="si si-warning"></i> Signaler un
Bug</a></li>
</ul>
</div>
</nav>
</aside>
<!-- Main Content -->
<main class="main-content">
<div class="content-container">
<h1 class="page-title">Bienvenue sur Simi UI</h1>
<p class="page-description">
<strong>Simi UI</strong> est construit sur <strong>SimilarCSS</strong>, un framework puissant basé sur
Bootstrap 5.3.7 et Tailwind CSS 3.4.17,
avec un accent centré sur les composants pour une stylisation meilleure, rapide et fluide.
Créé par <strong>Orssi</strong>, explorez notre collection de composants réutilisables, personnalisables
et accessibles.
</p>
<h2 style="font-size: 1.75rem; margin-bottom: 1.5rem; color: var(--text-primary);">Catégories de Composants
</h2>
<div class="components-grid">
<a href="pages/components/buttons.html" class="component-card">
<h3 class="component-card-title">Boutons</h3>
<p class="component-card-description">
Collection complète de boutons avec différents styles, tailles et états.
</p>
<span class="component-card-badge">15+ variantes</span>
</a>
<a href="pages/components/cards.html" class="component-card">
<h3 class="component-card-title">Cartes</h3>
<p class="component-card-description">
Cartes flexibles pour afficher du contenu de manière organisée et attrayante.
</p>
<span class="component-card-badge">20+ styles</span>
</a>
<a href="pages/components/forms.html" class="component-card">
<h3 class="component-card-title">Formulaires</h3>
<p class="component-card-description">
Éléments de formulaire complets avec validation et styles personnalisés.
</p>
<span class="component-card-badge">30+ éléments</span>
</a>
<a href="pages/components/modals.html" class="component-card">
<h3 class="component-card-title">Modales</h3>
<p class="component-card-description">
Fenêtres modales élégantes pour dialogues et contenus superposés.
</p>
<span class="component-card-badge">10+ variantes</span>
</a>
<a href="pages/layout/grid.html" class="component-card">
<h3 class="component-card-title">Système de Grille</h3>
<p class="component-card-description">
Système de grille responsive puissant pour layouts complexes.
</p>
<span class="component-card-badge">12 colonnes</span>
</a>
<a href="pages/utilities/colors.html" class="component-card">
<h3 class="component-card-title">Couleurs</h3>
<p class="component-card-description">
Palette de couleurs complète avec aperçus et codes hexadécimaux.
</p>
<span class="component-card-badge">100+ couleurs</span>
</a>
<a href="pages/utilities/filters.html" class="component-card">
<h3 class="component-card-title">Filtres CSS</h3>
<p class="component-card-description">
Filtres CSS avec aperçus visuels et exemples d'utilisation.
</p>
<span class="component-card-badge">15+ filtres</span>
</a>
<a href="pages/special/s-components.html" class="component-card">
<h3 class="component-card-title">Composants -s-</h3>
<p class="component-card-description">
Composants spéciaux avec préfixe -s- pour fonctionnalités avancées.
</p>
<span class="component-card-badge">Spécial</span>
</a>
<a href="pages/documentation.html" class="component-card">
<h3 class="component-card-title"><i class="si si-file"></i> Documentation</h3>
<p class="component-card-description">
Guide complet d'utilisation avec exemples de code et bonnes pratiques.
</p>
<span class="component-card-badge">Guide</span>
</a>
<a href="pages/components-demo.html" class="component-card">
<h3 class="component-card-title"><i class="si si-star"></i> Full & Less Components</h3>
<p class="component-card-description">
Composants Stateful et Stateless inspirés de Flutter pour plus de flexibilité.
</p>
<span class="component-card-badge">Nouveau</span>
</a>
<a href="pages/report-bug.html" class="component-card">
<h3 class="component-card-title"><i class="si si-warning"></i> Signaler un Bug</h3>
<p class="component-card-description">
Aidez-nous à améliorer Simi UI en signalant les problèmes rencontrés.
</p>
<span class="component-card-badge" style="background: #dc3545;">Support</span>
</a>
</div>
</div>
</main>
<!-- Scripts -->
<script src="js/similar.bundle.js"></script>
<script>
// Initialisation du système de recherche
document.addEventListener('DOMContentLoaded', function () {
const searchInput = document.getElementById('globalSearch');
const searchResults = document.getElementById('searchResults');
const themeToggle = document.getElementById('themeToggle');
const themePicker = document.getElementById('themePicker');
const hamburgerBtn = document.getElementById('hamburgerBtn');
const sidebar = document.getElementById('sidebar');
// Données de recherche
const searchData = [
{ title: 'Boutons', description: 'Composants de boutons', url: 'pages/components/buttons.html', category: 'Composants' },
{ title: 'Cartes', description: 'Composants de cartes', url: 'pages/components/cards.html', category: 'Composants' },
{ title: 'Formulaires', description: 'Éléments de formulaire', url: 'pages/components/forms.html', category: 'Composants' },
{ title: 'Modales', description: 'Fenêtres modales', url: 'pages/components/modals.html', category: 'Composants' },
{ title: 'Navigation', description: 'Menus de navigation', url: 'pages/components/navigation.html', category: 'Composants' },
{ title: 'Alertes', description: 'Messages d\'alerte', url: 'pages/components/alerts.html', category: 'Composants' },
{ title: 'Grille', description: 'Système de grille', url: 'pages/layout/grid.html', category: 'Layout' },
{ title: 'Couleurs', description: 'Palette de couleurs', url: 'pages/utilities/colors.html', category: 'Utilitaires' },
{ title: 'Filtres CSS', description: 'Filtres et effets', url: 'pages/utilities/filters.html', category: 'Utilitaires' },
{ title: 'Composants -s-', description: 'Composants spéciaux', url: 'pages/special/s-components.html', category: 'Spécial' },
{ title: 'btn', description: 'Classe pour boutons', url: 'pages/components/buttons.html', category: 'Classe CSS' },
{ title: 'card', description: 'Classe pour cartes', url: 'pages/components/cards.html', category: 'Classe CSS' },
{ title: 'container', description: 'Classe conteneur', url: 'pages/layout/containers.html', category: 'Classe CSS' },
{ title: 'grid', description: 'Classes de grille', url: 'pages/layout/grid.html', category: 'Classe CSS' },
{ title: 'flex', description: 'Classes flexbox', url: 'pages/layout/flexbox.html', category: 'Classe CSS' }
];
// Recherche
searchInput.addEventListener('input', function (e) {
const query = e.target.value.toLowerCase().trim();
if (query.length < 2) {
searchResults.classList.remove('active');
return;
}
const results = searchData.filter(item =>
item.title.toLowerCase().includes(query) ||
item.description.toLowerCase().includes(query) ||
item.category.toLowerCase().includes(query)
);
if (results.length > 0) {
searchResults.innerHTML = results.map(item => `
<div class="search-result-item" onclick="window.location.href='${item.url}'">
<div class="search-result-title">${item.title}</div>
<div class="search-result-description">${item.category} - ${item.description}</div>
</div>
`).join('');
searchResults.classList.add('active');
} else {
searchResults.innerHTML = '<div class="search-result-item"><div class="search-result-title">Aucun résultat</div></div>';
searchResults.classList.add('active');
}
});
// Fermer les résultats en cliquant ailleurs
document.addEventListener('click', function (e) {
if (!searchInput.contains(e.target) && !searchResults.contains(e.target)) {
searchResults.classList.remove('active');
}
});
// Gestion des thèmes
const savedTheme = localStorage.getItem('simiui-theme') || 'light';
document.documentElement.setAttribute('data-theme', savedTheme);
// Toggle theme picker
themeToggle.addEventListener('click', function (e) {
e.stopPropagation();
themePicker.classList.toggle('active');
});
// Fermer le picker en cliquant ailleurs
document.addEventListener('click', function (e) {
if (!themePicker.contains(e.target) && e.target !== themeToggle) {
themePicker.classList.remove('active');
}
});
// Sélection de thème
document.querySelectorAll('.theme-option').forEach(option => {
option.addEventListener('click', function () {
const theme = this.getAttribute('data-theme');
document.documentElement.setAttribute('data-theme', theme);
localStorage.setItem('simiui-theme', theme);
themePicker.classList.remove('active');
});
});
// Menu hamburger
hamburgerBtn.addEventListener('click', function () {
this.classList.toggle('active');
sidebar.classList.toggle('active');
});
// Fermer sidebar en cliquant sur un lien (mobile)
document.querySelectorAll('.sidebar-link').forEach(link => {
link.addEventListener('click', function () {
if (window.innerWidth <= 768) {
sidebar.classList.remove('active');
hamburgerBtn.classList.remove('active');
}
});
});
});
// Fonction pour appliquer un thème personnalisé
function applyCustomTheme() {
const color = document.getElementById('customColorPicker').value;
document.documentElement.style.setProperty('--custom-primary-color', color);
document.documentElement.setAttribute('data-theme', 'custom');
localStorage.setItem('simiui-theme', 'custom');
localStorage.setItem('simiui-custom-color', color);
document.getElementById('themePicker').classList.remove('active');
SimiUI.showToast('Thème personnalisé appliqué!', 'success', 2000);
}
// Restaurer la couleur personnalisée si elle existe
const savedCustomColor = localStorage.getItem('simiui-custom-color');
if (savedCustomColor) {
document.documentElement.style.setProperty('--custom-primary-color', savedCustomColor);
document.getElementById('customColorPicker').value = savedCustomColor;
}
</script>
</body>
</html>