create-template-html-css 1.3.0 → 1.4.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/CHANGELOG.md CHANGED
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.4.0] - 2025-01-18
9
+
10
+ ### Added
11
+ - **Flexbox Layout Templates**:
12
+ - `flex-layout` - Comprehensive Flexbox patterns and examples (row, column, space-between, space-around, space-evenly, center, wrap, flex-grow, alignment variations, Holy Grail layout)
13
+ - `flex-cards` - Equal-height card layouts with Flexbox (pricing cards, product cards, team cards, testimonial cards with automatic equal heights and gradient backgrounds)
14
+ - `flex-dashboard` - Complete admin dashboard using Flexbox (collapsible sidebar, top bar with search, stats cards, bar chart, activity feed, top products, quick actions)
15
+
16
+ ### Changed
17
+ - Updated template count from 16 to 19 templates
18
+ - Enhanced `generator.js` and `inserter.js` with 3 new Flexbox components
19
+ - Updated CLI choices in `bin/cli.js` with Flexbox templates
20
+ - Enhanced `list` command to show new Flexbox category
21
+ - Updated README.md with detailed Flexbox template documentation
22
+ - Added `flexbox`, `flex-layout`, and `flex-dashboard` keywords to package.json
23
+
24
+ ### Technical Details
25
+ - All Flexbox templates include full HTML, CSS, and JavaScript implementations
26
+ - Interactive sidebar collapse functionality
27
+ - Responsive design using pure Flexbox (no CSS Grid)
28
+ - Modern animations and hover effects
29
+ - Equal-height card systems without hacks
30
+ - Professional dashboard layouts with Flexbox
31
+
8
32
  ## [1.3.0] - 2025-01-18
9
33
 
10
34
  ### Added
package/README.md CHANGED
@@ -26,7 +26,7 @@ A powerful CLI library to create HTML+CSS element templates. Generate styled UI
26
26
  - 🌈 **Stunning Gradients** - Colorful and attractive designs
27
27
  - ⚡ **Animations** - Smooth and professional effects
28
28
  - 🔧 **Customizable** - Easy to edit and modify the code
29
- - 📦 **16 Templates** - Button, Card, Form, Navigation, Modal, Footer, Hero, Slider, Table, Spinner, Animated Cards, Typing Effect, Fade Gallery, Grid Layouts, Masonry Grid, Dashboard
29
+ - 📦 **19 Templates** - Button, Card, Form, Navigation, Modal, Footer, Hero, Slider, Table, Spinner, Animated Cards, Typing Effect, Fade Gallery, Grid Layouts, Masonry Grid, Dashboard, Flexbox Layouts
30
30
  - 🎯 **Two Modes** - Create new projects or insert into existing HTML pages
31
31
  - 🔒 **Secure** - Input validation and path protection
32
32
  - 📚 **Well Documented** - Comprehensive guides and examples
@@ -407,6 +407,60 @@ Complete admin dashboard template:
407
407
  - Mobile responsive
408
408
  - Professional design
409
409
 
410
+ ### 17. Flex Layout 📏
411
+
412
+ Comprehensive Flexbox patterns and examples:
413
+
414
+ **Includes:**
415
+ - Row and column layouts
416
+ - Space distribution patterns
417
+ - Alignment variations
418
+ - Flex-grow examples
419
+ - Nested flex containers
420
+ - Holy Grail layout
421
+
422
+ **Features:**
423
+ - Interactive examples
424
+ - Visual demonstrations
425
+ - Responsive design
426
+ - Modern Flexbox techniques
427
+
428
+ ### 18. Flex Cards 🃏
429
+
430
+ Equal-height card layouts with Flexbox:
431
+
432
+ **Variations:**
433
+ - Basic equal-height cards
434
+ - Pricing cards
435
+ - Product cards
436
+ - Team member cards
437
+ - Testimonial cards
438
+
439
+ **Features:**
440
+ - Automatic equal heights
441
+ - Hover animations
442
+ - Gradient backgrounds
443
+ - Fully responsive
444
+
445
+ ### 19. Flex Dashboard 🎛️
446
+
447
+ Admin dashboard built entirely with Flexbox:
448
+
449
+ **Components:**
450
+ - Collapsible sidebar
451
+ - Top search bar
452
+ - Stats cards
453
+ - Bar chart visualization
454
+ - Activity feed
455
+ - Top products list
456
+ - Quick actions
457
+
458
+ **Features:**
459
+ - Pure Flexbox layout
460
+ - Mobile responsive
461
+ - Interactive animations
462
+ - Professional design
463
+
410
464
 
411
465
  ## 💡 Examples
412
466
 
package/bin/cli.js CHANGED
@@ -37,7 +37,10 @@ program
37
37
  { name: 'Fade Gallery (Image Gallery)', value: 'fade-gallery' },
38
38
  { name: 'Grid Layout (CSS Grid)', value: 'grid-layout' },
39
39
  { name: 'Masonry Grid (Pinterest-style)', value: 'masonry-grid' },
40
- { name: 'Dashboard Grid (Admin Panel)', value: 'dashboard-grid' }
40
+ { name: 'Dashboard Grid (Admin Panel)', value: 'dashboard-grid' },
41
+ { name: 'Flex Layout (Flexbox Patterns)', value: 'flex-layout' },
42
+ { name: 'Flex Cards (Flexbox Cards)', value: 'flex-cards' },
43
+ { name: 'Flex Dashboard (Flexbox Admin)', value: 'flex-dashboard' }
41
44
  ]
42
45
  },
43
46
  {
@@ -151,7 +154,7 @@ program
151
154
  .command('list')
152
155
  .description('List all available templates')
153
156
  .action(() => {
154
- console.log(chalk.blue('\n📦 Available templates (16):\n'));
157
+ console.log(chalk.blue('\n📦 Available templates (19):\n'));
155
158
  console.log(chalk.yellow('Basic Components:'));
156
159
  console.log(' • Button - Styled button component');
157
160
  console.log(' • Card - Card component with image and content');
@@ -167,10 +170,14 @@ program
167
170
  console.log(' • Animated Card - 6 interactive card animations');
168
171
  console.log(' • Typing Effect - Text typing animations');
169
172
  console.log(' • Fade Gallery - Image gallery with fade effects');
170
- console.log(chalk.yellow('\nGrid Layouts:'));
173
+ console.log(chalk.yellow('\nGrid Layouts (CSS Grid):'));
171
174
  console.log(' • Grid Layout - CSS Grid examples');
172
175
  console.log(' • Masonry Grid - Pinterest-style layout');
173
176
  console.log(' • Dashboard Grid - Complete admin dashboard');
177
+ console.log(chalk.yellow('\nFlexbox Layouts:'));
178
+ console.log(' • Flex Layout - Flexbox patterns and examples');
179
+ console.log(' • Flex Cards - Equal-height card layouts');
180
+ console.log(' • Flex Dashboard - Admin dashboard with Flexbox');
174
181
  console.log('');
175
182
  });
176
183
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-template-html-css",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "CLI tool to generate HTML and CSS templates for common UI elements",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -35,7 +35,10 @@
35
35
  "typing-effect",
36
36
  "gallery",
37
37
  "responsive",
38
- "modern-ui"
38
+ "modern-ui",
39
+ "flexbox",
40
+ "flex-layout",
41
+ "flex-dashboard"
39
42
  ],
40
43
  "author": "Ben Shabbat <benshabbat@example.com> (https://github.com/benshabbat)",
41
44
  "license": "MIT",
package/src/generator.js CHANGED
@@ -2,7 +2,7 @@ const fs = require('fs').promises;
2
2
  const path = require('path');
3
3
 
4
4
  // Security: Validate component name against whitelist
5
- const VALID_COMPONENTS = ['button', 'card', 'form', 'navigation', 'modal', 'footer', 'hero', 'slider', 'table', 'spinner', 'animated-card', 'typing-effect', 'fade-gallery', 'grid-layout', 'masonry-grid', 'dashboard-grid'];
5
+ const VALID_COMPONENTS = ['button', 'card', 'form', 'navigation', 'modal', 'footer', 'hero', 'slider', 'table', 'spinner', 'animated-card', 'typing-effect', 'fade-gallery', 'grid-layout', 'masonry-grid', 'dashboard-grid', 'flex-layout', 'flex-cards', 'flex-dashboard'];
6
6
 
7
7
  // Security: Sanitize filename to prevent path traversal
8
8
  function sanitizeFilename(filename) {
package/src/inserter.js CHANGED
@@ -2,7 +2,7 @@ const fs = require('fs').promises;
2
2
  const path = require('path');
3
3
 
4
4
  // Security: Validate component name against whitelist
5
- const VALID_COMPONENTS = ['button', 'card', 'form', 'navigation', 'modal', 'footer', 'hero', 'slider', 'table', 'spinner', 'animated-card', 'typing-effect', 'fade-gallery', 'grid-layout', 'masonry-grid', 'dashboard-grid'];
5
+ const VALID_COMPONENTS = ['button', 'card', 'form', 'navigation', 'modal', 'footer', 'hero', 'slider', 'table', 'spinner', 'animated-card', 'typing-effect', 'fade-gallery', 'grid-layout', 'masonry-grid', 'dashboard-grid', 'flex-layout', 'flex-cards', 'flex-dashboard'];
6
6
 
7
7
  async function insertComponent(options) {
8
8
  const { component, targetFile, styleMode, scriptMode } = options;
@@ -0,0 +1,276 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>{{name}} - Flex Cards Component</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <header class="hero">
12
+ <h1>Flex Cards Gallery</h1>
13
+ <p>Equal height cards with Flexbox magic</p>
14
+ </header>
15
+
16
+ <!-- Equal Height Cards -->
17
+ <section class="section">
18
+ <h2 class="section-title">Equal Height Cards</h2>
19
+ <div class="card-container">
20
+ <div class="card">
21
+ <div class="card-icon">🚀</div>
22
+ <h3>Launch Fast</h3>
23
+ <p>Get your project up and running in minutes with our streamlined setup process.</p>
24
+ <button class="card-btn">Get Started</button>
25
+ </div>
26
+
27
+ <div class="card">
28
+ <div class="card-icon">⚡</div>
29
+ <h3>Lightning Speed</h3>
30
+ <p>Optimized for performance with modern techniques.</p>
31
+ <button class="card-btn">Learn More</button>
32
+ </div>
33
+
34
+ <div class="card">
35
+ <div class="card-icon">🎨</div>
36
+ <h3>Beautiful Design</h3>
37
+ <p>Stunning interfaces that work perfectly on all devices. Responsive and accessible design patterns that your users will love. Premium quality guaranteed.</p>
38
+ <button class="card-btn">View Demo</button>
39
+ </div>
40
+
41
+ <div class="card">
42
+ <div class="card-icon">🔒</div>
43
+ <h3>Secure</h3>
44
+ <p>Enterprise-level security built-in from day one.</p>
45
+ <button class="card-btn">Security Info</button>
46
+ </div>
47
+ </div>
48
+ </section>
49
+
50
+ <!-- Pricing Cards -->
51
+ <section class="section">
52
+ <h2 class="section-title">Pricing Plans</h2>
53
+ <div class="pricing-container">
54
+ <div class="pricing-card">
55
+ <div class="pricing-badge">Basic</div>
56
+ <div class="pricing-icon">📦</div>
57
+ <div class="pricing-amount">
58
+ <span class="currency">$</span>
59
+ <span class="price">9</span>
60
+ <span class="period">/month</span>
61
+ </div>
62
+ <ul class="pricing-features">
63
+ <li>✓ 10 Projects</li>
64
+ <li>✓ 5GB Storage</li>
65
+ <li>✓ Email Support</li>
66
+ <li>✓ Basic Analytics</li>
67
+ </ul>
68
+ <button class="pricing-btn">Choose Plan</button>
69
+ </div>
70
+
71
+ <div class="pricing-card featured">
72
+ <div class="pricing-badge popular">Popular</div>
73
+ <div class="pricing-icon">⭐</div>
74
+ <div class="pricing-amount">
75
+ <span class="currency">$</span>
76
+ <span class="price">29</span>
77
+ <span class="period">/month</span>
78
+ </div>
79
+ <ul class="pricing-features">
80
+ <li>✓ Unlimited Projects</li>
81
+ <li>✓ 50GB Storage</li>
82
+ <li>✓ Priority Support</li>
83
+ <li>✓ Advanced Analytics</li>
84
+ <li>✓ Custom Domain</li>
85
+ <li>✓ Team Collaboration</li>
86
+ </ul>
87
+ <button class="pricing-btn featured-btn">Choose Plan</button>
88
+ </div>
89
+
90
+ <div class="pricing-card">
91
+ <div class="pricing-badge">Enterprise</div>
92
+ <div class="pricing-icon">🏢</div>
93
+ <div class="pricing-amount">
94
+ <span class="currency">$</span>
95
+ <span class="price">99</span>
96
+ <span class="period">/month</span>
97
+ </div>
98
+ <ul class="pricing-features">
99
+ <li>✓ Unlimited Everything</li>
100
+ <li>✓ 500GB Storage</li>
101
+ <li>✓ 24/7 Phone Support</li>
102
+ <li>✓ White Label</li>
103
+ <li>✓ API Access</li>
104
+ </ul>
105
+ <button class="pricing-btn">Contact Sales</button>
106
+ </div>
107
+ </div>
108
+ </section>
109
+
110
+ <!-- Product Cards -->
111
+ <section class="section dark-section">
112
+ <h2 class="section-title">Featured Products</h2>
113
+ <div class="product-container">
114
+ <div class="product-card">
115
+ <div class="product-image gradient-1">
116
+ <span class="product-badge">New</span>
117
+ </div>
118
+ <div class="product-info">
119
+ <h3>Premium Headphones</h3>
120
+ <div class="product-rating">
121
+ ⭐⭐⭐⭐⭐ <span>(128)</span>
122
+ </div>
123
+ <p>High-quality wireless headphones with noise cancellation</p>
124
+ <div class="product-footer">
125
+ <span class="product-price">$299</span>
126
+ <button class="product-btn">Add to Cart</button>
127
+ </div>
128
+ </div>
129
+ </div>
130
+
131
+ <div class="product-card">
132
+ <div class="product-image gradient-2">
133
+ <span class="product-badge sale">Sale</span>
134
+ </div>
135
+ <div class="product-info">
136
+ <h3>Smart Watch Pro</h3>
137
+ <div class="product-rating">
138
+ ⭐⭐⭐⭐☆ <span>(94)</span>
139
+ </div>
140
+ <p>Advanced fitness tracking and health monitoring</p>
141
+ <div class="product-footer">
142
+ <span class="product-price">
143
+ <del>$399</del> $299
144
+ </span>
145
+ <button class="product-btn">Add to Cart</button>
146
+ </div>
147
+ </div>
148
+ </div>
149
+
150
+ <div class="product-card">
151
+ <div class="product-image gradient-3">
152
+ <span class="product-badge">Hot</span>
153
+ </div>
154
+ <div class="product-info">
155
+ <h3>Wireless Earbuds</h3>
156
+ <div class="product-rating">
157
+ ⭐⭐⭐⭐⭐ <span>(256)</span>
158
+ </div>
159
+ <p>Crystal clear sound in a compact design</p>
160
+ <div class="product-footer">
161
+ <span class="product-price">$149</span>
162
+ <button class="product-btn">Add to Cart</button>
163
+ </div>
164
+ </div>
165
+ </div>
166
+ </div>
167
+ </section>
168
+
169
+ <!-- Team Cards -->
170
+ <section class="section">
171
+ <h2 class="section-title">Meet Our Team</h2>
172
+ <div class="team-container">
173
+ <div class="team-card">
174
+ <div class="team-avatar gradient-4">
175
+ <span class="avatar-text">JD</span>
176
+ </div>
177
+ <h3>John Doe</h3>
178
+ <p class="team-role">CEO & Founder</p>
179
+ <p class="team-bio">Visionary leader with 15 years of experience in tech innovation</p>
180
+ <div class="team-social">
181
+ <a href="#" class="social-link">💼</a>
182
+ <a href="#" class="social-link">🐦</a>
183
+ <a href="#" class="social-link">📧</a>
184
+ </div>
185
+ </div>
186
+
187
+ <div class="team-card">
188
+ <div class="team-avatar gradient-5">
189
+ <span class="avatar-text">JS</span>
190
+ </div>
191
+ <h3>Jane Smith</h3>
192
+ <p class="team-role">CTO</p>
193
+ <p class="team-bio">Tech expert specializing in scalable architectures</p>
194
+ <div class="team-social">
195
+ <a href="#" class="social-link">💼</a>
196
+ <a href="#" class="social-link">🐦</a>
197
+ <a href="#" class="social-link">📧</a>
198
+ </div>
199
+ </div>
200
+
201
+ <div class="team-card">
202
+ <div class="team-avatar gradient-6">
203
+ <span class="avatar-text">MB</span>
204
+ </div>
205
+ <h3>Mike Brown</h3>
206
+ <p class="team-role">Lead Designer</p>
207
+ <p class="team-bio">Award-winning designer with a passion for user experience</p>
208
+ <div class="team-social">
209
+ <a href="#" class="social-link">💼</a>
210
+ <a href="#" class="social-link">🐦</a>
211
+ <a href="#" class="social-link">📧</a>
212
+ </div>
213
+ </div>
214
+
215
+ <div class="team-card">
216
+ <div class="team-avatar gradient-7">
217
+ <span class="avatar-text">SE</span>
218
+ </div>
219
+ <h3>Sarah Evans</h3>
220
+ <p class="team-role">Marketing Director</p>
221
+ <p class="team-bio">Strategic thinker driving growth and brand awareness</p>
222
+ <div class="team-social">
223
+ <a href="#" class="social-link">💼</a>
224
+ <a href="#" class="social-link">🐦</a>
225
+ <a href="#" class="social-link">📧</a>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ </section>
230
+
231
+ <!-- Testimonial Cards -->
232
+ <section class="section">
233
+ <h2 class="section-title">What Our Clients Say</h2>
234
+ <div class="testimonial-container">
235
+ <div class="testimonial-card">
236
+ <div class="quote-icon">"</div>
237
+ <p class="testimonial-text">This product completely transformed how we work. The team is incredibly responsive and the features are exactly what we needed.</p>
238
+ <div class="testimonial-author">
239
+ <div class="author-avatar gradient-8">AC</div>
240
+ <div class="author-info">
241
+ <h4>Alice Cooper</h4>
242
+ <p>CEO, TechCorp</p>
243
+ </div>
244
+ </div>
245
+ </div>
246
+
247
+ <div class="testimonial-card">
248
+ <div class="quote-icon">"</div>
249
+ <p class="testimonial-text">Outstanding quality and support. We've seen a 300% increase in productivity since implementation.</p>
250
+ <div class="testimonial-author">
251
+ <div class="author-avatar gradient-9">BD</div>
252
+ <div class="author-info">
253
+ <h4>Bob Davis</h4>
254
+ <p>CTO, StartupXYZ</p>
255
+ </div>
256
+ </div>
257
+ </div>
258
+
259
+ <div class="testimonial-card">
260
+ <div class="quote-icon">"</div>
261
+ <p class="testimonial-text">Simply the best solution on the market. Easy to use, powerful features, and excellent value for money.</p>
262
+ <div class="testimonial-author">
263
+ <div class="author-avatar gradient-10">CE</div>
264
+ <div class="author-info">
265
+ <h4>Carol Edwards</h4>
266
+ <p>Director, MegaCorp</p>
267
+ </div>
268
+ </div>
269
+ </div>
270
+ </div>
271
+ </section>
272
+ </div>
273
+
274
+ <script src="script.js"></script>
275
+ </body>
276
+ </html>
@@ -0,0 +1,122 @@
1
+ // Flex Cards Component JavaScript
2
+ console.log('Flex Cards Component initialized');
3
+
4
+ document.addEventListener('DOMContentLoaded', () => {
5
+ // Add animation on scroll
6
+ const observerOptions = {
7
+ root: null,
8
+ rootMargin: '0px',
9
+ threshold: 0.1
10
+ };
11
+
12
+ const observer = new IntersectionObserver((entries) => {
13
+ entries.forEach((entry, index) => {
14
+ if (entry.isIntersecting) {
15
+ setTimeout(() => {
16
+ entry.target.style.animation = 'fadeInUp 0.6s ease forwards';
17
+ }, index * 100);
18
+ observer.unobserve(entry.target);
19
+ }
20
+ });
21
+ }, observerOptions);
22
+
23
+ // Observe all cards
24
+ const cards = document.querySelectorAll('.card, .pricing-card, .product-card, .team-card, .testimonial-card');
25
+ cards.forEach(card => {
26
+ card.style.opacity = '0';
27
+ observer.observe(card);
28
+ });
29
+
30
+ // Card button interactions
31
+ const cardButtons = document.querySelectorAll('.card-btn, .pricing-btn, .product-btn');
32
+ cardButtons.forEach(btn => {
33
+ btn.addEventListener('click', function(e) {
34
+ e.stopPropagation();
35
+
36
+ // Create ripple effect
37
+ const ripple = document.createElement('span');
38
+ ripple.classList.add('ripple');
39
+ this.appendChild(ripple);
40
+
41
+ setTimeout(() => ripple.remove(), 600);
42
+
43
+ console.log('Button clicked:', this.textContent);
44
+ });
45
+ });
46
+
47
+ // Social link interactions
48
+ const socialLinks = document.querySelectorAll('.social-link');
49
+ socialLinks.forEach(link => {
50
+ link.addEventListener('click', function(e) {
51
+ e.preventDefault();
52
+ console.log('Social link clicked');
53
+ });
54
+ });
55
+
56
+ // Product card interactions
57
+ const productCards = document.querySelectorAll('.product-card');
58
+ productCards.forEach(card => {
59
+ card.addEventListener('click', function() {
60
+ const productName = this.querySelector('h3').textContent;
61
+ console.log('Product clicked:', productName);
62
+ });
63
+ });
64
+
65
+ // Pricing card selection
66
+ const pricingCards = document.querySelectorAll('.pricing-card');
67
+ pricingCards.forEach(card => {
68
+ card.addEventListener('click', function() {
69
+ // Remove selected class from all cards
70
+ pricingCards.forEach(c => c.classList.remove('selected'));
71
+
72
+ // Add selected class to clicked card
73
+ this.classList.add('selected');
74
+
75
+ const plan = this.querySelector('.pricing-badge').textContent;
76
+ console.log('Pricing plan selected:', plan);
77
+ });
78
+ });
79
+
80
+ console.log('Total cards loaded:', cards.length);
81
+ });
82
+
83
+ // Add animations and ripple effect styles
84
+ const style = document.createElement('style');
85
+ style.textContent = `
86
+ @keyframes fadeInUp {
87
+ from {
88
+ opacity: 0;
89
+ transform: translateY(30px);
90
+ }
91
+ to {
92
+ opacity: 1;
93
+ transform: translateY(0);
94
+ }
95
+ }
96
+
97
+ @keyframes ripple {
98
+ from {
99
+ width: 0;
100
+ height: 0;
101
+ opacity: 0.5;
102
+ }
103
+ to {
104
+ width: 100px;
105
+ height: 100px;
106
+ opacity: 0;
107
+ }
108
+ }
109
+
110
+ .ripple {
111
+ position: absolute;
112
+ border-radius: 50%;
113
+ background: rgba(255, 255, 255, 0.6);
114
+ animation: ripple 0.6s ease-out;
115
+ pointer-events: none;
116
+ }
117
+
118
+ .pricing-card.selected {
119
+ border: 3px solid #667eea;
120
+ }
121
+ `;
122
+ document.head.appendChild(style);