clou-lang 0.2.0

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.
package/src/themes.js ADDED
@@ -0,0 +1,469 @@
1
+ // Clou Language - Theme System
2
+ // Pre-built themes that transform the entire look with one word
3
+
4
+ const themes = {
5
+
6
+ neon: {
7
+ name: 'Neon',
8
+ body: {
9
+ 'background': '#0a0a0a',
10
+ 'color': '#ffffff',
11
+ 'font-family': "'Inter', 'Segoe UI', system-ui, sans-serif",
12
+ },
13
+ accent: '#00ff88',
14
+ accentHover: '#00cc6a',
15
+ card: {
16
+ 'background': 'rgba(0, 255, 136, 0.05)',
17
+ 'border': '1px solid rgba(0, 255, 136, 0.2)',
18
+ 'box-shadow': '0 0 20px rgba(0, 255, 136, 0.1)',
19
+ },
20
+ cardHover: {
21
+ 'border-color': 'rgba(0, 255, 136, 0.5)',
22
+ 'box-shadow': '0 0 40px rgba(0, 255, 136, 0.2)',
23
+ },
24
+ navbar: {
25
+ 'background': 'rgba(0, 0, 0, 0.8)',
26
+ 'border-bottom': '1px solid rgba(0, 255, 136, 0.2)',
27
+ },
28
+ input: {
29
+ 'background': 'rgba(255, 255, 255, 0.05)',
30
+ 'border': '1px solid rgba(0, 255, 136, 0.3)',
31
+ 'color': '#ffffff',
32
+ },
33
+ heading: {
34
+ 'background': 'linear-gradient(135deg, #00ff88, #00ccff)',
35
+ '-webkit-background-clip': 'text',
36
+ '-webkit-text-fill-color': 'transparent',
37
+ 'background-clip': 'text',
38
+ },
39
+ link: { 'color': '#00ff88' },
40
+ hr: { 'border-top-color': 'rgba(0, 255, 136, 0.2)' },
41
+ footer: { 'border-top-color': 'rgba(0, 255, 136, 0.2)' },
42
+ },
43
+
44
+ ocean: {
45
+ name: 'Ocean',
46
+ body: {
47
+ 'background': 'linear-gradient(180deg, #0c1b33 0%, #1a3a5c 50%, #0c1b33 100%)',
48
+ 'background-attachment': 'fixed',
49
+ 'color': '#c8dbe6',
50
+ 'font-family': "'Georgia', 'Times New Roman', serif",
51
+ },
52
+ accent: '#4fc3f7',
53
+ accentHover: '#29b6f6',
54
+ card: {
55
+ 'background': 'rgba(79, 195, 247, 0.08)',
56
+ 'border': '1px solid rgba(79, 195, 247, 0.15)',
57
+ 'backdrop-filter': 'blur(12px)',
58
+ },
59
+ cardHover: {
60
+ 'background': 'rgba(79, 195, 247, 0.12)',
61
+ 'box-shadow': '0 8px 32px rgba(79, 195, 247, 0.15)',
62
+ },
63
+ navbar: {
64
+ 'background': 'rgba(12, 27, 51, 0.9)',
65
+ 'backdrop-filter': 'blur(12px)',
66
+ },
67
+ input: {
68
+ 'background': 'rgba(79, 195, 247, 0.08)',
69
+ 'border': '1px solid rgba(79, 195, 247, 0.25)',
70
+ 'color': '#c8dbe6',
71
+ },
72
+ heading: { 'color': '#4fc3f7' },
73
+ link: { 'color': '#4fc3f7' },
74
+ hr: { 'border-top-color': 'rgba(79, 195, 247, 0.2)' },
75
+ footer: { 'border-top-color': 'rgba(79, 195, 247, 0.2)' },
76
+ },
77
+
78
+ sunset: {
79
+ name: 'Sunset',
80
+ body: {
81
+ 'background': 'linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 30%, #4a1942 60%, #1a0a2e 100%)',
82
+ 'background-attachment': 'fixed',
83
+ 'color': '#f0d9ff',
84
+ 'font-family': "'Segoe UI', system-ui, sans-serif",
85
+ },
86
+ accent: '#ff6b6b',
87
+ accentHover: '#ff5252',
88
+ card: {
89
+ 'background': 'rgba(255, 107, 107, 0.08)',
90
+ 'border': '1px solid rgba(255, 107, 107, 0.15)',
91
+ 'backdrop-filter': 'blur(8px)',
92
+ },
93
+ cardHover: {
94
+ 'background': 'rgba(255, 107, 107, 0.12)',
95
+ 'box-shadow': '0 8px 32px rgba(255, 107, 107, 0.2)',
96
+ },
97
+ navbar: {
98
+ 'background': 'rgba(26, 10, 46, 0.9)',
99
+ },
100
+ input: {
101
+ 'background': 'rgba(255, 107, 107, 0.08)',
102
+ 'border': '1px solid rgba(255, 107, 107, 0.25)',
103
+ 'color': '#f0d9ff',
104
+ },
105
+ heading: {
106
+ 'background': 'linear-gradient(135deg, #ff6b6b, #ffa726)',
107
+ '-webkit-background-clip': 'text',
108
+ '-webkit-text-fill-color': 'transparent',
109
+ 'background-clip': 'text',
110
+ },
111
+ link: { 'color': '#ff8a80' },
112
+ hr: { 'border-top-color': 'rgba(255, 107, 107, 0.2)' },
113
+ footer: { 'border-top-color': 'rgba(255, 107, 107, 0.2)' },
114
+ },
115
+
116
+ forest: {
117
+ name: 'Forest',
118
+ body: {
119
+ 'background': '#1a2e1a',
120
+ 'color': '#d4e8c8',
121
+ 'font-family': "'Palatino', 'Book Antiqua', serif",
122
+ },
123
+ accent: '#81c784',
124
+ accentHover: '#66bb6a',
125
+ card: {
126
+ 'background': 'rgba(129, 199, 132, 0.08)',
127
+ 'border': '1px solid rgba(129, 199, 132, 0.2)',
128
+ },
129
+ cardHover: {
130
+ 'background': 'rgba(129, 199, 132, 0.12)',
131
+ 'box-shadow': '0 8px 24px rgba(129, 199, 132, 0.15)',
132
+ },
133
+ navbar: {
134
+ 'background': 'rgba(20, 36, 20, 0.95)',
135
+ },
136
+ input: {
137
+ 'background': 'rgba(129, 199, 132, 0.08)',
138
+ 'border': '1px solid rgba(129, 199, 132, 0.3)',
139
+ 'color': '#d4e8c8',
140
+ },
141
+ heading: { 'color': '#a5d6a7' },
142
+ link: { 'color': '#81c784' },
143
+ hr: { 'border-top-color': 'rgba(129, 199, 132, 0.2)' },
144
+ footer: { 'border-top-color': 'rgba(129, 199, 132, 0.2)' },
145
+ },
146
+
147
+ candy: {
148
+ name: 'Candy',
149
+ body: {
150
+ 'background': 'linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ffecd2 100%)',
151
+ 'background-attachment': 'fixed',
152
+ 'color': '#4a2040',
153
+ 'font-family': "'Verdana', 'Geneva', sans-serif",
154
+ },
155
+ accent: '#e91e63',
156
+ accentHover: '#c2185b',
157
+ card: {
158
+ 'background': 'rgba(255, 255, 255, 0.6)',
159
+ 'border': '1px solid rgba(233, 30, 99, 0.15)',
160
+ 'backdrop-filter': 'blur(8px)',
161
+ 'box-shadow': '0 4px 16px rgba(233, 30, 99, 0.1)',
162
+ },
163
+ cardHover: {
164
+ 'background': 'rgba(255, 255, 255, 0.8)',
165
+ 'box-shadow': '0 8px 32px rgba(233, 30, 99, 0.2)',
166
+ },
167
+ navbar: {
168
+ 'background': 'rgba(255, 255, 255, 0.7)',
169
+ 'backdrop-filter': 'blur(12px)',
170
+ 'color': '#4a2040',
171
+ },
172
+ input: {
173
+ 'background': 'rgba(255, 255, 255, 0.6)',
174
+ 'border': '1px solid rgba(233, 30, 99, 0.25)',
175
+ 'color': '#4a2040',
176
+ },
177
+ heading: { 'color': '#c2185b' },
178
+ link: { 'color': '#e91e63' },
179
+ hr: { 'border-top-color': 'rgba(233, 30, 99, 0.2)' },
180
+ footer: { 'border-top-color': 'rgba(233, 30, 99, 0.2)' },
181
+ },
182
+
183
+ minimal: {
184
+ name: 'Minimal',
185
+ body: {
186
+ 'background': '#ffffff',
187
+ 'color': '#1a1a1a',
188
+ 'font-family': "'Helvetica Neue', 'Arial', sans-serif",
189
+ },
190
+ accent: '#1a1a1a',
191
+ accentHover: '#333333',
192
+ card: {
193
+ 'background': '#fafafa',
194
+ 'border': '1px solid #e0e0e0',
195
+ 'box-shadow': 'none',
196
+ },
197
+ cardHover: {
198
+ 'border-color': '#1a1a1a',
199
+ 'box-shadow': '0 2px 8px rgba(0,0,0,0.08)',
200
+ },
201
+ navbar: {
202
+ 'background': '#ffffff',
203
+ 'border-bottom': '1px solid #e0e0e0',
204
+ },
205
+ input: {
206
+ 'background': '#fafafa',
207
+ 'border': '1px solid #e0e0e0',
208
+ 'color': '#1a1a1a',
209
+ },
210
+ heading: { 'color': '#1a1a1a', 'font-weight': '800' },
211
+ link: { 'color': '#1a1a1a', 'border-bottom': '1px solid #1a1a1a' },
212
+ hr: { 'border-top-color': '#e0e0e0' },
213
+ footer: { 'border-top-color': '#e0e0e0' },
214
+ },
215
+
216
+ midnight: {
217
+ name: 'Midnight',
218
+ body: {
219
+ 'background': '#0f0f23',
220
+ 'color': '#e0e0e0',
221
+ 'font-family': "'Segoe UI', system-ui, sans-serif",
222
+ },
223
+ accent: '#6C63FF',
224
+ accentHover: '#5a52d5',
225
+ card: {
226
+ 'background': 'rgba(108, 99, 255, 0.06)',
227
+ 'border': '1px solid rgba(108, 99, 255, 0.15)',
228
+ },
229
+ cardHover: {
230
+ 'background': 'rgba(108, 99, 255, 0.1)',
231
+ 'box-shadow': '0 8px 32px rgba(108, 99, 255, 0.2)',
232
+ },
233
+ navbar: {
234
+ 'background': 'rgba(15, 15, 35, 0.95)',
235
+ 'backdrop-filter': 'blur(12px)',
236
+ },
237
+ input: {
238
+ 'background': 'rgba(108, 99, 255, 0.08)',
239
+ 'border': '1px solid rgba(108, 99, 255, 0.25)',
240
+ 'color': '#e0e0e0',
241
+ },
242
+ heading: { 'color': '#8b83ff' },
243
+ link: { 'color': '#8b83ff' },
244
+ hr: { 'border-top-color': 'rgba(108, 99, 255, 0.2)' },
245
+ footer: { 'border-top-color': 'rgba(108, 99, 255, 0.2)' },
246
+ },
247
+
248
+ retro: {
249
+ name: 'Retro',
250
+ body: {
251
+ 'background': '#2b1b0e',
252
+ 'color': '#f5deb3',
253
+ 'font-family': "'Courier New', 'Courier', monospace",
254
+ },
255
+ accent: '#ff8c00',
256
+ accentHover: '#e67e00',
257
+ card: {
258
+ 'background': 'rgba(255, 140, 0, 0.08)',
259
+ 'border': '2px solid rgba(255, 140, 0, 0.3)',
260
+ 'border-radius': '4px',
261
+ },
262
+ cardHover: {
263
+ 'background': 'rgba(255, 140, 0, 0.12)',
264
+ 'box-shadow': '0 0 20px rgba(255, 140, 0, 0.2)',
265
+ },
266
+ navbar: {
267
+ 'background': '#1a1008',
268
+ 'border-bottom': '2px solid rgba(255, 140, 0, 0.3)',
269
+ },
270
+ input: {
271
+ 'background': 'rgba(255, 140, 0, 0.08)',
272
+ 'border': '2px solid rgba(255, 140, 0, 0.3)',
273
+ 'color': '#f5deb3',
274
+ 'border-radius': '4px',
275
+ },
276
+ heading: { 'color': '#ff8c00' },
277
+ link: { 'color': '#ffab40' },
278
+ hr: { 'border-top-color': 'rgba(255, 140, 0, 0.3)' },
279
+ footer: { 'border-top-color': 'rgba(255, 140, 0, 0.3)' },
280
+ },
281
+
282
+ glass: {
283
+ name: 'Glass',
284
+ body: {
285
+ 'background': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
286
+ 'background-attachment': 'fixed',
287
+ 'color': '#ffffff',
288
+ 'font-family': "'Segoe UI', system-ui, sans-serif",
289
+ },
290
+ accent: '#ffffff',
291
+ accentHover: '#e0e0e0',
292
+ buttonText: '#764ba2',
293
+ card: {
294
+ 'background': 'rgba(255, 255, 255, 0.15)',
295
+ 'border': '1px solid rgba(255, 255, 255, 0.25)',
296
+ 'backdrop-filter': 'blur(16px)',
297
+ 'box-shadow': '0 8px 32px rgba(0, 0, 0, 0.15)',
298
+ },
299
+ cardHover: {
300
+ 'background': 'rgba(255, 255, 255, 0.22)',
301
+ 'box-shadow': '0 12px 40px rgba(0, 0, 0, 0.2)',
302
+ },
303
+ navbar: {
304
+ 'background': 'rgba(255, 255, 255, 0.1)',
305
+ 'backdrop-filter': 'blur(16px)',
306
+ 'border-bottom': '1px solid rgba(255, 255, 255, 0.15)',
307
+ },
308
+ input: {
309
+ 'background': 'rgba(255, 255, 255, 0.15)',
310
+ 'border': '1px solid rgba(255, 255, 255, 0.25)',
311
+ 'color': '#ffffff',
312
+ 'backdrop-filter': 'blur(8px)',
313
+ },
314
+ heading: { 'color': '#ffffff', 'text-shadow': '0 2px 10px rgba(0,0,0,0.2)' },
315
+ link: { 'color': '#ffffff', 'opacity': '0.9' },
316
+ hr: { 'border-top-color': 'rgba(255, 255, 255, 0.2)' },
317
+ footer: { 'border-top-color': 'rgba(255, 255, 255, 0.2)' },
318
+ },
319
+
320
+ aurora: {
321
+ name: 'Aurora',
322
+ body: {
323
+ 'background': 'linear-gradient(135deg, #0c0c1d 0%, #1a0a2e 25%, #0d1b2a 50%, #0c0c1d 100%)',
324
+ 'background-attachment': 'fixed',
325
+ 'color': '#e0e8ff',
326
+ 'font-family': "'Segoe UI', system-ui, sans-serif",
327
+ },
328
+ accent: '#00e5ff',
329
+ accentHover: '#00b8d4',
330
+ card: {
331
+ 'background': 'linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(156, 39, 176, 0.05))',
332
+ 'border': '1px solid rgba(0, 229, 255, 0.15)',
333
+ 'backdrop-filter': 'blur(8px)',
334
+ },
335
+ cardHover: {
336
+ 'border-color': 'rgba(0, 229, 255, 0.35)',
337
+ 'box-shadow': '0 0 30px rgba(0, 229, 255, 0.15), 0 0 60px rgba(156, 39, 176, 0.1)',
338
+ },
339
+ navbar: {
340
+ 'background': 'rgba(12, 12, 29, 0.9)',
341
+ 'backdrop-filter': 'blur(16px)',
342
+ },
343
+ input: {
344
+ 'background': 'rgba(0, 229, 255, 0.06)',
345
+ 'border': '1px solid rgba(0, 229, 255, 0.2)',
346
+ 'color': '#e0e8ff',
347
+ },
348
+ heading: {
349
+ 'background': 'linear-gradient(135deg, #00e5ff, #d500f9, #00e5ff)',
350
+ 'background-size': '200% auto',
351
+ '-webkit-background-clip': 'text',
352
+ '-webkit-text-fill-color': 'transparent',
353
+ 'background-clip': 'text',
354
+ },
355
+ link: { 'color': '#00e5ff' },
356
+ hr: { 'border-top-color': 'rgba(0, 229, 255, 0.15)' },
357
+ footer: { 'border-top-color': 'rgba(0, 229, 255, 0.15)' },
358
+ },
359
+ };
360
+
361
+ function getTheme(name) {
362
+ const key = name.toLowerCase().trim();
363
+ return themes[key] || null;
364
+ }
365
+
366
+ function getThemeNames() {
367
+ return Object.keys(themes);
368
+ }
369
+
370
+ // Generate CSS for a theme
371
+ function generateThemeCSS(theme) {
372
+ let css = '';
373
+
374
+ // Body styles
375
+ css += ' body {\n';
376
+ for (const [prop, val] of Object.entries(theme.body)) {
377
+ css += ` ${prop}: ${val};\n`;
378
+ }
379
+ css += ' }\n';
380
+
381
+ // Button styles
382
+ css += ` button, .clou-button {\n`;
383
+ css += ` background-color: ${theme.accent};\n`;
384
+ if (theme.buttonText) {
385
+ css += ` color: ${theme.buttonText};\n`;
386
+ }
387
+ css += ` }\n`;
388
+ css += ` button:hover, .clou-button:hover {\n`;
389
+ css += ` background-color: ${theme.accentHover};\n`;
390
+ css += ` }\n`;
391
+
392
+ // Card styles
393
+ if (theme.card) {
394
+ css += ' .clou-card {\n';
395
+ for (const [prop, val] of Object.entries(theme.card)) {
396
+ css += ` ${prop}: ${val};\n`;
397
+ }
398
+ css += ' }\n';
399
+ }
400
+ if (theme.cardHover) {
401
+ css += ' .clou-card:hover {\n';
402
+ for (const [prop, val] of Object.entries(theme.cardHover)) {
403
+ css += ` ${prop}: ${val};\n`;
404
+ }
405
+ css += ' }\n';
406
+ }
407
+
408
+ // Navbar styles
409
+ if (theme.navbar) {
410
+ css += ' .clou-navbar {\n';
411
+ for (const [prop, val] of Object.entries(theme.navbar)) {
412
+ css += ` ${prop}: ${val};\n`;
413
+ }
414
+ css += ' }\n';
415
+ }
416
+
417
+ // Input styles
418
+ if (theme.input) {
419
+ css += ' input, textarea, .clou-input {\n';
420
+ for (const [prop, val] of Object.entries(theme.input)) {
421
+ css += ` ${prop}: ${val};\n`;
422
+ }
423
+ css += ' }\n';
424
+ css += ` input:focus, textarea:focus {\n`;
425
+ css += ` border-color: ${theme.accent};\n`;
426
+ css += ` box-shadow: 0 0 0 3px ${theme.accent}33;\n`;
427
+ css += ` }\n`;
428
+ }
429
+
430
+ // Heading styles
431
+ if (theme.heading) {
432
+ css += ' h1, h2 {\n';
433
+ for (const [prop, val] of Object.entries(theme.heading)) {
434
+ css += ` ${prop}: ${val};\n`;
435
+ }
436
+ css += ' }\n';
437
+ }
438
+
439
+ // Link styles
440
+ if (theme.link) {
441
+ css += ' a {\n';
442
+ for (const [prop, val] of Object.entries(theme.link)) {
443
+ css += ` ${prop}: ${val};\n`;
444
+ }
445
+ css += ' }\n';
446
+ }
447
+
448
+ // HR styles
449
+ if (theme.hr) {
450
+ css += ' hr {\n';
451
+ for (const [prop, val] of Object.entries(theme.hr)) {
452
+ css += ` ${prop}: ${val};\n`;
453
+ }
454
+ css += ' }\n';
455
+ }
456
+
457
+ // Footer styles
458
+ if (theme.footer) {
459
+ css += ' .clou-footer {\n';
460
+ for (const [prop, val] of Object.entries(theme.footer)) {
461
+ css += ` ${prop}: ${val};\n`;
462
+ }
463
+ css += ' }\n';
464
+ }
465
+
466
+ return css;
467
+ }
468
+
469
+ module.exports = { getTheme, getThemeNames, generateThemeCSS, themes };