create-template-html-css 1.8.0 → 1.8.1
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/COMPONENTS-GALLERY.html +124 -11
- package/README.md +6 -2
- package/bin/cli.js +1 -1
- package/package.json +1 -1
package/COMPONENTS-GALLERY.html
CHANGED
|
@@ -436,6 +436,93 @@
|
|
|
436
436
|
<h2 class="color-schemes-title">🎨 Color Schemes Preview</h2>
|
|
437
437
|
<div class="schemes-grid" id="colorSchemesGrid"></div>
|
|
438
438
|
</div>
|
|
439
|
+
|
|
440
|
+
<!-- CLI Flags Section -->
|
|
441
|
+
<div class="color-schemes-section" style="margin-top: 40px;">
|
|
442
|
+
<h2 class="color-schemes-title">⚡ One-Command Creation (Non-Interactive)</h2>
|
|
443
|
+
<p style="text-align: center; color: #666; margin-bottom: 20px;">
|
|
444
|
+
Create components instantly with all flags in a single command - no prompts needed!<br>
|
|
445
|
+
<small>Install globally with npm, or use npx to run without installation</small>
|
|
446
|
+
</p>
|
|
447
|
+
|
|
448
|
+
<div style="max-width: 900px; margin: 0 auto;">
|
|
449
|
+
<!-- Available Flags -->
|
|
450
|
+
<div style="background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 20px;">
|
|
451
|
+
<h3 style="margin: 0 0 15px 0; color: #333;">📋 Available Flags:</h3>
|
|
452
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px;">
|
|
453
|
+
<div>
|
|
454
|
+
<code style="background: #e9ecef; padding: 4px 8px; border-radius: 4px; color: #495057;">-c, --component <type></code>
|
|
455
|
+
<div style="font-size: 0.9rem; color: #666; margin-top: 5px;">Component type (required)</div>
|
|
456
|
+
</div>
|
|
457
|
+
<div>
|
|
458
|
+
<code style="background: #e9ecef; padding: 4px 8px; border-radius: 4px; color: #495057;">-n, --name <name></code>
|
|
459
|
+
<div style="font-size: 0.9rem; color: #666; margin-top: 5px;">Project name (required)</div>
|
|
460
|
+
</div>
|
|
461
|
+
<div>
|
|
462
|
+
<code style="background: #e9ecef; padding: 4px 8px; border-radius: 4px; color: #495057;">--dark-mode</code>
|
|
463
|
+
<div style="font-size: 0.9rem; color: #666; margin-top: 5px;">Add dark mode support</div>
|
|
464
|
+
</div>
|
|
465
|
+
<div>
|
|
466
|
+
<code style="background: #e9ecef; padding: 4px 8px; border-radius: 4px; color: #495057;">--color-scheme <name></code>
|
|
467
|
+
<div style="font-size: 0.9rem; color: #666; margin-top: 5px;">Use preset colors</div>
|
|
468
|
+
</div>
|
|
469
|
+
<div>
|
|
470
|
+
<code style="background: #e9ecef; padding: 4px 8px; border-radius: 4px; color: #495057;">--primary-color <hex></code>
|
|
471
|
+
<div style="font-size: 0.9rem; color: #666; margin-top: 5px;">Custom primary color</div>
|
|
472
|
+
</div>
|
|
473
|
+
<div>
|
|
474
|
+
<code style="background: #e9ecef; padding: 4px 8px; border-radius: 4px; color: #495057;">--secondary-color <hex></code>
|
|
475
|
+
<div style="font-size: 0.9rem; color: #666; margin-top: 5px;">Custom secondary color</div>
|
|
476
|
+
</div>
|
|
477
|
+
</div>
|
|
478
|
+
</div>
|
|
479
|
+
|
|
480
|
+
<!-- Installation Note -->
|
|
481
|
+
<div style="background: #fff3cd; border-left: 4px solid #ffc107; padding: 15px; border-radius: 4px; margin-bottom: 20px;">
|
|
482
|
+
<strong>📦 Installation:</strong>
|
|
483
|
+
<div style="margin-top: 8px;">
|
|
484
|
+
<code style="background: #fff; padding: 6px 12px; border-radius: 4px; display: inline-block; margin-right: 10px;">npm install -g create-template-html-css</code>
|
|
485
|
+
<span style="color: #666;">or use</span>
|
|
486
|
+
<code style="background: #fff; padding: 6px 12px; border-radius: 4px; display: inline-block; margin-left: 10px;">npx create-template-html-css</code>
|
|
487
|
+
</div>
|
|
488
|
+
</div>
|
|
489
|
+
|
|
490
|
+
<!-- Example Commands -->
|
|
491
|
+
<div style="background: #fff; border: 2px solid #e9ecef; border-radius: 8px; padding: 20px;">
|
|
492
|
+
<h3 style="margin: 0 0 15px 0; color: #333;">💡 Example Commands (After Installation):</h3>
|
|
493
|
+
|
|
494
|
+
<div class="code-block" style="margin: 15px 0;">
|
|
495
|
+
create-template create -c button -n my-button
|
|
496
|
+
<button class="copy-btn" onclick="copyExample(this)">Copy</button>
|
|
497
|
+
<div style="font-size: 0.85rem; color: #666; margin-top: 5px;">Basic: Create button with default colors</div>
|
|
498
|
+
</div>
|
|
499
|
+
|
|
500
|
+
<div class="code-block" style="margin: 15px 0;">
|
|
501
|
+
create-template create -c card -n my-card --color-scheme ocean
|
|
502
|
+
<button class="copy-btn" onclick="copyExample(this)">Copy</button>
|
|
503
|
+
<div style="font-size: 0.85rem; color: #666; margin-top: 5px;">With preset: Card with ocean color scheme</div>
|
|
504
|
+
</div>
|
|
505
|
+
|
|
506
|
+
<div class="code-block" style="margin: 15px 0;">
|
|
507
|
+
create-template create -c modal -n my-modal --dark-mode
|
|
508
|
+
<button class="copy-btn" onclick="copyExample(this)">Copy</button>
|
|
509
|
+
<div style="font-size: 0.85rem; color: #666; margin-top: 5px;">With dark mode: Modal with automatic dark theme</div>
|
|
510
|
+
</div>
|
|
511
|
+
|
|
512
|
+
<div class="code-block" style="margin: 15px 0;">
|
|
513
|
+
create-template create -c hero -n my-hero --primary-color "#FF5733" --secondary-color "#3498db"
|
|
514
|
+
<button class="copy-btn" onclick="copyExample(this)">Copy</button>
|
|
515
|
+
<div style="font-size: 0.85rem; color: #666; margin-top: 5px;">Custom colors: Hero with custom gradient</div>
|
|
516
|
+
</div>
|
|
517
|
+
|
|
518
|
+
<div class="code-block" style="margin: 15px 0;">
|
|
519
|
+
create-template create -c navigation -n my-nav --dark-mode --color-scheme sunset
|
|
520
|
+
<button class="copy-btn" onclick="copyExample(this)">Copy</button>
|
|
521
|
+
<div style="font-size: 0.85rem; color: #666; margin-top: 5px;">Everything: Navigation with dark mode + sunset colors</div>
|
|
522
|
+
</div>
|
|
523
|
+
</div>
|
|
524
|
+
</div>
|
|
525
|
+
</div>
|
|
439
526
|
</div>
|
|
440
527
|
|
|
441
528
|
<footer>
|
|
@@ -535,8 +622,8 @@
|
|
|
535
622
|
<div style="margin: 4px 0;">Secondary: ${scheme.secondary}</div>
|
|
536
623
|
</div>
|
|
537
624
|
<div style="display: flex; gap: 8px; margin-top: 12px;">
|
|
538
|
-
<button class="copy-btn" onclick="copySchemeCommand('
|
|
539
|
-
Copy
|
|
625
|
+
<button class="copy-btn" onclick="copySchemeCommand('global', '${key}')" style="flex: 1; font-size: 0.85rem;">
|
|
626
|
+
Copy command
|
|
540
627
|
</button>
|
|
541
628
|
<button class="copy-btn" onclick="copySchemeCommand('local', '${key}')" style="flex: 1; font-size: 0.85rem; opacity: 0.7;">
|
|
542
629
|
Copy local
|
|
@@ -550,14 +637,22 @@
|
|
|
550
637
|
// Copy color scheme command
|
|
551
638
|
function copySchemeCommand(mode, schemeKey) {
|
|
552
639
|
let text;
|
|
553
|
-
if (mode === '
|
|
554
|
-
text = `
|
|
640
|
+
if (mode === 'global') {
|
|
641
|
+
text = `create-template create -c button -n my-button --color-scheme ${schemeKey}`;
|
|
555
642
|
} else {
|
|
556
643
|
text = `npm run create -- -c button -n my-button --color-scheme ${schemeKey}`;
|
|
557
644
|
}
|
|
558
645
|
navigator.clipboard.writeText(text);
|
|
559
646
|
event.target.textContent = "✓ Copied!";
|
|
560
|
-
setTimeout(() => (event.target.textContent =
|
|
647
|
+
setTimeout(() => (event.target.textContent = mode === 'global' ? 'Copy command' : 'Copy local'), 2000);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
// Copy example command
|
|
651
|
+
function copyExample(btn) {
|
|
652
|
+
const text = btn.parentElement.textContent.trim().split("\n")[0].trim();
|
|
653
|
+
navigator.clipboard.writeText(text);
|
|
654
|
+
btn.textContent = "✓ Copied!";
|
|
655
|
+
setTimeout(() => (btn.textContent = "Copy"), 2000);
|
|
561
656
|
}
|
|
562
657
|
|
|
563
658
|
const components = [
|
|
@@ -616,14 +711,32 @@
|
|
|
616
711
|
<span class="category-badge">${c.cat.toUpperCase()}</span>
|
|
617
712
|
<p class="description">${c.desc}</p>
|
|
618
713
|
<ul class="features-list">${c.feat.map((f) => `<li>${f}</li>`).join("")}</ul>
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
714
|
+
|
|
715
|
+
<!-- Full Command Examples -->
|
|
716
|
+
<div style="margin-top: 15px; padding: 10px; background: #f8f9fa; border-radius: 6px;">
|
|
717
|
+
<div style="font-size: 0.85rem; font-weight: 600; color: #495057; margin-bottom: 8px;">📋 One-Command Examples:</div>
|
|
718
|
+
|
|
719
|
+
<div class="code-block" style="margin: 6px 0; font-size: 0.85rem;">
|
|
720
|
+
create-template create -c ${c.id} -n my-${c.id}
|
|
721
|
+
<button class="copy-btn" onclick="copy(this)" style="font-size: 0.75rem;">Copy</button>
|
|
623
722
|
</div>
|
|
624
|
-
|
|
723
|
+
|
|
724
|
+
<div class="code-block" style="margin: 6px 0; font-size: 0.85rem;">
|
|
725
|
+
create-template create -c ${c.id} -n my-${c.id} --color-scheme ocean
|
|
726
|
+
<button class="copy-btn" onclick="copy(this)" style="font-size: 0.75rem;">Copy</button>
|
|
727
|
+
</div>
|
|
728
|
+
|
|
729
|
+
<div class="code-block" style="margin: 6px 0; font-size: 0.85rem;">
|
|
730
|
+
create-template create -c ${c.id} -n my-${c.id} --dark-mode --color-scheme sunset
|
|
731
|
+
<button class="copy-btn" onclick="copy(this)" style="font-size: 0.75rem;">Copy</button>
|
|
732
|
+
</div>
|
|
733
|
+
</div>
|
|
734
|
+
|
|
735
|
+
<!-- Local npm command -->
|
|
736
|
+
<div style="display: flex; gap: 10px; margin-top: 12px;">
|
|
737
|
+
<div class="code-block" style="flex: 1; opacity: 0.6; font-size: 0.85rem;">
|
|
625
738
|
npm run create -- -c ${c.id}
|
|
626
|
-
<button class="copy-btn" onclick="copy(this)">
|
|
739
|
+
<button class="copy-btn" onclick="copy(this)" style="font-size: 0.75rem;">Local</button>
|
|
627
740
|
</div>
|
|
628
741
|
</div>
|
|
629
742
|
</div>
|
package/README.md
CHANGED
|
@@ -113,9 +113,13 @@ New **COMPONENTS-GALLERY.html** showcase page:
|
|
|
113
113
|
|
|
114
114
|
**Open gallery:**
|
|
115
115
|
```bash
|
|
116
|
+
# After global install
|
|
117
|
+
create-template gallery
|
|
118
|
+
|
|
119
|
+
# Or run directly with npx (first install package)
|
|
120
|
+
npx create-template-html-css
|
|
121
|
+
# Then run:
|
|
116
122
|
create-template gallery
|
|
117
|
-
# or
|
|
118
|
-
npx create-template gallery
|
|
119
123
|
```
|
|
120
124
|
|
|
121
125
|
### 📚 Enhanced Documentation
|
package/bin/cli.js
CHANGED