-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
239 lines (228 loc) · 13.4 KB
/
Copy pathindex.html
File metadata and controls
239 lines (228 loc) · 13.4 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
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Layout Generator - TailwindCSS Container Queries</title>
<link rel="stylesheet" href="/src/style.css">
</head>
<body class="bg-slate-900 text-slate-100 min-h-screen">
<div class="flex flex-col h-screen">
<!-- Header -->
<header class="bg-slate-800 border-b border-slate-700 px-6 py-4">
<div class="flex items-center justify-between">
<div>
<h1 class="text-2xl font-bold bg-gradient-to-r from-cyan-400 to-blue-500 bg-clip-text text-transparent">
Layout Generator
</h1>
<p class="text-slate-400 text-sm mt-1">Créez des layouts responsive avec TailwindCSS & Container Queries</p>
</div>
<div class="flex gap-3">
<button id="copyBtn" class="px-4 py-2 bg-slate-700 hover:bg-slate-600 rounded-lg text-sm font-medium transition-colors flex items-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"/>
</svg>
Copier le code
</button>
<button id="resetBtn" class="px-4 py-2 bg-red-600/20 hover:bg-red-600/30 text-red-400 rounded-lg text-sm font-medium transition-colors">
Réinitialiser
</button>
</div>
</div>
</header>
<!-- Main Content -->
<div class="flex flex-1 overflow-hidden">
<!-- Sidebar - Configuration -->
<aside class="w-80 bg-slate-800 border-r border-slate-700 overflow-y-auto p-4 flex flex-col gap-4">
<!-- Layout Type -->
<section class="bg-slate-750 rounded-lg p-4">
<h2 class="text-sm font-semibold text-slate-300 mb-3 flex items-center gap-2">
<svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"/>
</svg>
Type de Layout
</h2>
<select id="layoutType" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
<option value="card-grid">Grille de cartes</option>
<option value="sidebar-content">Sidebar + Contenu</option>
<option value="holy-grail">Holy Grail Layout</option>
<option value="masonry">Masonry Grid</option>
<option value="dashboard">Dashboard</option>
<option value="article">Article avec sidebar</option>
<option value="gallery">Galerie d'images</option>
<option value="pricing">Cartes de prix</option>
</select>
</section>
<!-- Container Query Settings -->
<section class="bg-slate-750 rounded-lg p-4">
<h2 class="text-sm font-semibold text-slate-300 mb-3 flex items-center gap-2">
<svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/>
</svg>
Container Queries
</h2>
<div class="space-y-3">
<label class="flex items-center gap-2">
<input type="checkbox" id="enableCQ" checked class="w-4 h-4 rounded bg-slate-700 border-slate-600 text-cyan-500 focus:ring-cyan-500">
<span class="text-sm">Activer Container Queries</span>
</label>
<div>
<label class="text-xs text-slate-400 block mb-1">Nom du container</label>
<input type="text" id="containerName" value="card" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
</div>
</div>
</section>
<!-- Breakpoints -->
<section class="bg-slate-750 rounded-lg p-4">
<h2 class="text-sm font-semibold text-slate-300 mb-3 flex items-center gap-2">
<svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"/>
</svg>
Breakpoints Container
</h2>
<div class="space-y-2 text-xs">
<div class="flex justify-between text-slate-400">
<span>@xs</span><span>320px</span>
</div>
<div class="flex justify-between text-slate-400">
<span>@sm</span><span>384px</span>
</div>
<div class="flex justify-between text-slate-400">
<span>@md</span><span>448px</span>
</div>
<div class="flex justify-between text-slate-400">
<span>@lg</span><span>512px</span>
</div>
<div class="flex justify-between text-slate-400">
<span>@xl</span><span>576px</span>
</div>
<div class="flex justify-between text-slate-400">
<span>@2xl</span><span>672px</span>
</div>
</div>
</section>
<!-- Grid Settings -->
<section class="bg-slate-750 rounded-lg p-4">
<h2 class="text-sm font-semibold text-slate-300 mb-3 flex items-center gap-2">
<svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/>
</svg>
Paramètres de grille
</h2>
<div class="space-y-3">
<div>
<label class="text-xs text-slate-400 block mb-1">Colonnes (mobile)</label>
<input type="number" id="colsMobile" value="1" min="1" max="6" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
</div>
<div>
<label class="text-xs text-slate-400 block mb-1">Colonnes (@md)</label>
<input type="number" id="colsMd" value="2" min="1" max="6" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
</div>
<div>
<label class="text-xs text-slate-400 block mb-1">Colonnes (@lg)</label>
<input type="number" id="colsLg" value="3" min="1" max="6" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
</div>
<div>
<label class="text-xs text-slate-400 block mb-1">Gap</label>
<select id="gap" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
<option value="2">0.5rem (gap-2)</option>
<option value="4" selected>1rem (gap-4)</option>
<option value="6">1.5rem (gap-6)</option>
<option value="8">2rem (gap-8)</option>
</select>
</div>
</div>
</section>
<!-- Items Count -->
<section class="bg-slate-750 rounded-lg p-4">
<h2 class="text-sm font-semibold text-slate-300 mb-3 flex items-center gap-2">
<svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"/>
</svg>
Éléments
</h2>
<div>
<label class="text-xs text-slate-400 block mb-1">Nombre d'éléments</label>
<input type="number" id="itemCount" value="6" min="1" max="20" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
</div>
</section>
<!-- Styling -->
<section class="bg-slate-750 rounded-lg p-4">
<h2 class="text-sm font-semibold text-slate-300 mb-3 flex items-center gap-2">
<svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"/>
</svg>
Style
</h2>
<div class="space-y-3">
<div>
<label class="text-xs text-slate-400 block mb-1">Padding</label>
<select id="padding" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
<option value="2">0.5rem (p-2)</option>
<option value="4" selected>1rem (p-4)</option>
<option value="6">1.5rem (p-6)</option>
<option value="8">2rem (p-8)</option>
</select>
</div>
<div>
<label class="text-xs text-slate-400 block mb-1">Border Radius</label>
<select id="rounded" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
<option value="none">Aucun</option>
<option value="sm">Petit (rounded-sm)</option>
<option value="md">Moyen (rounded-md)</option>
<option value="lg" selected>Grand (rounded-lg)</option>
<option value="xl">Très grand (rounded-xl)</option>
<option value="2xl">2XL (rounded-2xl)</option>
</select>
</div>
<div>
<label class="text-xs text-slate-400 block mb-1">Ombre</label>
<select id="shadow" class="w-full bg-slate-700 border border-slate-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-cyan-500 focus:border-transparent">
<option value="none">Aucune</option>
<option value="sm">Petite (shadow-sm)</option>
<option value="md" selected>Moyenne (shadow-md)</option>
<option value="lg">Grande (shadow-lg)</option>
<option value="xl">Très grande (shadow-xl)</option>
</select>
</div>
</div>
</section>
</aside>
<!-- Main Area -->
<main class="flex-1 flex flex-col overflow-hidden">
<!-- Tabs -->
<div class="bg-slate-800 border-b border-slate-700 px-4">
<div class="flex gap-1">
<button id="tabPreview" class="tab-btn active px-4 py-3 text-sm font-medium border-b-2 border-cyan-500 text-cyan-400">
Prévisualisation
</button>
<button id="tabCode" class="tab-btn px-4 py-3 text-sm font-medium border-b-2 border-transparent text-slate-400 hover:text-slate-300">
Code HTML
</button>
</div>
</div>
<!-- Preview Panel -->
<div id="previewPanel" class="flex-1 p-6 overflow-auto bg-slate-850">
<div class="mb-4 flex items-center gap-4">
<span class="text-sm text-slate-400">Largeur du container:</span>
<input type="range" id="previewWidth" min="200" max="1200" value="800" class="flex-1 h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer">
<span id="widthValue" class="text-sm text-cyan-400 font-mono w-16">800px</span>
</div>
<div id="previewContainer" class="preview-container bg-slate-800 border border-slate-700 rounded-xl p-4 mx-auto transition-all duration-300" style="width: 800px;">
<!-- Preview content will be injected here -->
</div>
</div>
<!-- Code Panel -->
<div id="codePanel" class="flex-1 p-6 overflow-auto bg-slate-850 hidden">
<pre id="codeOutput" class="code-block bg-slate-800 border border-slate-700 rounded-xl p-4 overflow-auto text-sm"></pre>
</div>
</main>
</div>
</div>
<!-- Toast Notification -->
<div id="toast" class="fixed bottom-4 right-4 bg-green-600 text-white px-4 py-2 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300">
Code copié dans le presse-papier !
</div>
<script type="module" src="/src/main.js"></script>
</body>
</html>