create-template-html-css 1.2.2 → 1.3.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 ADDED
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.3.0] - 2025-01-18
9
+
10
+ ### Added
11
+ - **Animation Templates**:
12
+ - `spinner` - 5 loading spinner variations (circle, dots, pulse, bars, gradient)
13
+ - `animated-card` - 6 animated card types with flip, glow, slide, scale, tilt, and gradient effects
14
+ - `typing-effect` - Multiple text typing animations with rotating text and code typing
15
+ - `fade-gallery` - Image gallery with fade-in animations, masonry layout, and parallax effects
16
+
17
+ - **Grid Layout Templates**:
18
+ - `grid-layout` - 4 CSS Grid examples (basic, feature, auto-fit, complex)
19
+ - `masonry-grid` - Pinterest-style layout with filtering and category tags
20
+ - `dashboard-grid` - Complete admin dashboard with sidebar, widgets, and charts
21
+
22
+ ### Changed
23
+ - Updated `generator.js` and `inserter.js` with new template components
24
+ - Enhanced README.md with detailed descriptions of all 16 templates
25
+ - Updated feature list from 9 to 16 templates
26
+
27
+ ### Technical Details
28
+ - All new templates include full HTML, CSS, and JavaScript implementations
29
+ - Responsive design support across all new components
30
+ - Modern animations using CSS keyframes and transforms
31
+ - Interactive features with vanilla JavaScript
32
+ - Security validation maintained for all new components
33
+
34
+ ## [1.2.2] - Previous Version
35
+
36
+ ### Initial Release
37
+ - Button, Card, Form, Navigation, Modal, Footer, Hero, Slider, Table templates
38
+ - CLI tool with create, insert, and list commands
39
+ - Security features: input validation, filename sanitization, path traversal protection
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
- - 📦 **9 Templates** - Button, Card, Form, Navigation, Modal, Footer, Hero, Slider, Table
29
+ - 📦 **16 Templates** - Button, Card, Form, Navigation, Modal, Footer, Hero, Slider, Table, Spinner, Animated Cards, Typing Effect, Fade Gallery, Grid Layouts, Masonry Grid, Dashboard
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
@@ -298,6 +298,116 @@ Professional data table with advanced features:
298
298
  - Page navigation
299
299
  - Color-coded status indicators
300
300
 
301
+ ### 10. Spinner 🔄
302
+
303
+ Animated loading spinners for various use cases:
304
+
305
+ **Variations:**
306
+ - Circle Spinner - Classic rotating circle
307
+ - Bouncing Dots - Three animated dots
308
+ - Pulse Loader - Pulsing effect
309
+ - Bar Loader - Dancing vertical bars
310
+ - Gradient Ring - Colorful rotating ring
311
+
312
+ **Features:**
313
+ - Pure CSS animations
314
+ - Smooth performance
315
+ - Multiple styles
316
+ - Easy customization
317
+
318
+ ### 11. Animated Card ✨
319
+
320
+ Interactive card components with stunning animations:
321
+
322
+ **Variations:**
323
+ - Flip Card - 3D flip effect
324
+ - Glow Card - Animated glowing border
325
+ - Slide Card - Content slide animation
326
+ - Scale Card - Zoom with shadow
327
+ - Tilt Card - 3D tilt on hover
328
+ - Gradient Card - Animated background
329
+
330
+ **Features:**
331
+ - Advanced hover effects
332
+ - 3D transformations
333
+ - Interactive JavaScript
334
+ - Modern design patterns
335
+
336
+ ### 12. Typing Effect ⌨️
337
+
338
+ Text animation components with typing effects:
339
+
340
+ **Variations:**
341
+ - Simple typing animation
342
+ - Multi-line typing
343
+ - Rotating text display
344
+ - Code typing effect
345
+
346
+ **Features:**
347
+ - Customizable speed
348
+ - Blinking cursor
349
+ - Multiple phrases
350
+ - Pause/restart controls
351
+
352
+ ### 13. Fade Gallery 🖼️
353
+
354
+ Animated image gallery with scroll effects:
355
+
356
+ **Features:**
357
+ - Fade-in animations
358
+ - Hover overlays
359
+ - Horizontal scroll
360
+ - Parallax effect
361
+ - Intersection observer
362
+ - Responsive masonry layout
363
+
364
+ ### 14. Grid Layout 📐
365
+
366
+ Comprehensive CSS Grid layouts:
367
+
368
+ **Includes:**
369
+ - Basic responsive grid
370
+ - Feature grid with hero item
371
+ - Auto-fit flexible grid
372
+ - Complex dashboard layout
373
+
374
+ **Features:**
375
+ - Modern CSS Grid
376
+ - Multiple grid patterns
377
+ - Animated items
378
+ - Fully responsive
379
+
380
+ ### 15. Masonry Grid 🧱
381
+
382
+ Pinterest-style masonry layout:
383
+
384
+ **Features:**
385
+ - Column-based layout
386
+ - Category filtering
387
+ - Variable item heights
388
+ - Staggered animations
389
+ - Interactive likes
390
+ - 12 sample items
391
+
392
+ ### 16. Dashboard Grid 📊
393
+
394
+ Complete admin dashboard template:
395
+
396
+ **Components:**
397
+ - Sidebar navigation
398
+ - Statistics cards
399
+ - Revenue chart
400
+ - Activity feed
401
+ - Product list
402
+ - Quick actions
403
+
404
+ **Features:**
405
+ - Full grid layout
406
+ - Real-time animations
407
+ - Mobile responsive
408
+ - Professional design
409
+
410
+
301
411
  ## 💡 Examples
302
412
 
303
413
  ### Example 1: Create a Button Component
package/bin/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const { program } = require('commander');
4
4
  const inquirer = require('inquirer').default || require('inquirer');
@@ -30,7 +30,14 @@ program
30
30
  { name: 'Footer', value: 'footer' },
31
31
  { name: 'Hero Section', value: 'hero' },
32
32
  { name: 'Slider', value: 'slider' },
33
- { name: 'Table', value: 'table' }
33
+ { name: 'Table', value: 'table' },
34
+ { name: 'Spinner (Loading Animations)', value: 'spinner' },
35
+ { name: 'Animated Card (Interactive Cards)', value: 'animated-card' },
36
+ { name: 'Typing Effect (Text Animations)', value: 'typing-effect' },
37
+ { name: 'Fade Gallery (Image Gallery)', value: 'fade-gallery' },
38
+ { name: 'Grid Layout (CSS Grid)', value: 'grid-layout' },
39
+ { name: 'Masonry Grid (Pinterest-style)', value: 'masonry-grid' },
40
+ { name: 'Dashboard Grid (Admin Panel)', value: 'dashboard-grid' }
34
41
  ]
35
42
  },
36
43
  {
@@ -144,7 +151,8 @@ program
144
151
  .command('list')
145
152
  .description('List all available templates')
146
153
  .action(() => {
147
- console.log(chalk.blue('\nAvailable templates:\n'));
154
+ console.log(chalk.blue('\n📦 Available templates (16):\n'));
155
+ console.log(chalk.yellow('Basic Components:'));
148
156
  console.log(' • Button - Styled button component');
149
157
  console.log(' • Card - Card component with image and content');
150
158
  console.log(' • Form - Form with input fields');
@@ -154,6 +162,15 @@ program
154
162
  console.log(' • Hero - Hero section with CTA');
155
163
  console.log(' • Slider - Image carousel with navigation');
156
164
  console.log(' • Table - Data table with search and filtering');
165
+ console.log(chalk.yellow('\nAnimation Templates:'));
166
+ console.log(' • Spinner - 5 loading spinner variations');
167
+ console.log(' • Animated Card - 6 interactive card animations');
168
+ console.log(' • Typing Effect - Text typing animations');
169
+ console.log(' • Fade Gallery - Image gallery with fade effects');
170
+ console.log(chalk.yellow('\nGrid Layouts:'));
171
+ console.log(' • Grid Layout - CSS Grid examples');
172
+ console.log(' • Masonry Grid - Pinterest-style layout');
173
+ console.log(' • Dashboard Grid - Complete admin dashboard');
157
174
  console.log('');
158
175
  });
159
176
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-template-html-css",
3
- "version": "1.2.2",
3
+ "version": "1.3.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": {
@@ -18,19 +18,24 @@
18
18
  "template",
19
19
  "html",
20
20
  "css",
21
+ "javascript",
21
22
  "generator",
22
23
  "ui-components",
23
24
  "html-template",
24
25
  "css-template",
25
26
  "component-generator",
26
27
  "ui-generator",
27
- "button",
28
- "card",
29
- "form",
30
- "navigation",
31
- "modal",
32
- "footer",
33
- "hero"
28
+ "animations",
29
+ "css-animations",
30
+ "css-grid",
31
+ "masonry",
32
+ "dashboard",
33
+ "spinner",
34
+ "loading",
35
+ "typing-effect",
36
+ "gallery",
37
+ "responsive",
38
+ "modern-ui"
34
39
  ],
35
40
  "author": "Ben Shabbat <benshabbat@example.com> (https://github.com/benshabbat)",
36
41
  "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'];
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'];
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'];
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'];
6
6
 
7
7
  async function insertComponent(options) {
8
8
  const { component, targetFile, styleMode, scriptMode } = options;
@@ -0,0 +1,85 @@
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}} - Animated Cards Component</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <h1>Animated Cards Gallery</h1>
12
+
13
+ <div class="cards-grid">
14
+ <!-- Flip Card -->
15
+ <div class="card flip-card">
16
+ <div class="card-inner">
17
+ <div class="card-front">
18
+ <div class="icon">🎨</div>
19
+ <h3>Flip Card</h3>
20
+ <p>Hover to flip</p>
21
+ </div>
22
+ <div class="card-back">
23
+ <h3>Amazing!</h3>
24
+ <p>This card flips with a smooth 3D animation effect</p>
25
+ <button class="btn">Learn More</button>
26
+ </div>
27
+ </div>
28
+ </div>
29
+
30
+ <!-- Glow Card -->
31
+ <div class="card glow-card">
32
+ <div class="card-content">
33
+ <div class="icon">✨</div>
34
+ <h3>Glow Effect</h3>
35
+ <p>Beautiful glowing border animation on hover</p>
36
+ <button class="btn">Explore</button>
37
+ </div>
38
+ </div>
39
+
40
+ <!-- Slide Card -->
41
+ <div class="card slide-card">
42
+ <div class="card-content">
43
+ <div class="icon">🚀</div>
44
+ <h3>Slide Up</h3>
45
+ <p>Content slides up with gradient overlay</p>
46
+ <button class="btn">Discover</button>
47
+ </div>
48
+ <div class="slide-overlay"></div>
49
+ </div>
50
+
51
+ <!-- Scale Card -->
52
+ <div class="card scale-card">
53
+ <div class="card-content">
54
+ <div class="icon">💎</div>
55
+ <h3>Scale Effect</h3>
56
+ <p>Smooth scaling with shadow depth</p>
57
+ <button class="btn">View More</button>
58
+ </div>
59
+ </div>
60
+
61
+ <!-- Tilt Card -->
62
+ <div class="card tilt-card">
63
+ <div class="card-content">
64
+ <div class="icon">🎯</div>
65
+ <h3>3D Tilt</h3>
66
+ <p>Interactive perspective transformation</p>
67
+ <button class="btn">Try It</button>
68
+ </div>
69
+ </div>
70
+
71
+ <!-- Gradient Card -->
72
+ <div class="card gradient-card">
73
+ <div class="card-content">
74
+ <div class="icon">🌈</div>
75
+ <h3>Gradient Shift</h3>
76
+ <p>Animated gradient background transition</p>
77
+ <button class="btn">See More</button>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
82
+
83
+ <script src="script.js"></script>
84
+ </body>
85
+ </html>
@@ -0,0 +1,37 @@
1
+ // Animated Cards Component JavaScript
2
+ console.log('Animated Cards Component initialized');
3
+
4
+ // Add 3D tilt effect on mouse move for tilt card
5
+ document.addEventListener('DOMContentLoaded', () => {
6
+ const tiltCard = document.querySelector('.tilt-card');
7
+
8
+ if (tiltCard) {
9
+ tiltCard.addEventListener('mousemove', (e) => {
10
+ const rect = tiltCard.getBoundingClientRect();
11
+ const x = e.clientX - rect.left;
12
+ const y = e.clientY - rect.top;
13
+
14
+ const centerX = rect.width / 2;
15
+ const centerY = rect.height / 2;
16
+
17
+ const rotateX = (y - centerY) / 10;
18
+ const rotateY = (centerX - x) / 10;
19
+
20
+ tiltCard.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
21
+ });
22
+
23
+ tiltCard.addEventListener('mouseleave', () => {
24
+ tiltCard.style.transform = 'perspective(1000px) rotateX(0) rotateY(0)';
25
+ });
26
+ }
27
+
28
+ // Add click handlers to all buttons
29
+ const buttons = document.querySelectorAll('.btn');
30
+ buttons.forEach(btn => {
31
+ btn.addEventListener('click', (e) => {
32
+ e.stopPropagation();
33
+ console.log('Button clicked:', btn.textContent);
34
+ // Add your custom action here
35
+ });
36
+ });
37
+ });
@@ -0,0 +1,254 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ body {
8
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
9
+ background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
10
+ min-height: 100vh;
11
+ padding: 40px 20px;
12
+ }
13
+
14
+ .container {
15
+ max-width: 1200px;
16
+ margin: 0 auto;
17
+ }
18
+
19
+ h1 {
20
+ text-align: center;
21
+ margin-bottom: 60px;
22
+ color: #fff;
23
+ font-size: 3rem;
24
+ font-weight: 700;
25
+ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
26
+ }
27
+
28
+ .cards-grid {
29
+ display: grid;
30
+ grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
31
+ gap: 40px;
32
+ padding: 20px;
33
+ }
34
+
35
+ /* Base Card Styles */
36
+ .card {
37
+ background: white;
38
+ border-radius: 20px;
39
+ overflow: hidden;
40
+ cursor: pointer;
41
+ position: relative;
42
+ height: 350px;
43
+ }
44
+
45
+ .card-content {
46
+ padding: 40px 30px;
47
+ text-align: center;
48
+ height: 100%;
49
+ display: flex;
50
+ flex-direction: column;
51
+ justify-content: center;
52
+ }
53
+
54
+ .icon {
55
+ font-size: 4rem;
56
+ margin-bottom: 20px;
57
+ }
58
+
59
+ .card h3 {
60
+ font-size: 1.8rem;
61
+ color: #333;
62
+ margin-bottom: 15px;
63
+ }
64
+
65
+ .card p {
66
+ color: #666;
67
+ font-size: 1.1rem;
68
+ margin-bottom: 20px;
69
+ line-height: 1.6;
70
+ }
71
+
72
+ .btn {
73
+ padding: 12px 30px;
74
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
75
+ color: white;
76
+ border: none;
77
+ border-radius: 25px;
78
+ font-size: 1rem;
79
+ font-weight: 600;
80
+ cursor: pointer;
81
+ transition: transform 0.3s ease;
82
+ margin-top: auto;
83
+ }
84
+
85
+ .btn:hover {
86
+ transform: scale(1.05);
87
+ }
88
+
89
+ /* Flip Card Animation */
90
+ .flip-card {
91
+ perspective: 1000px;
92
+ }
93
+
94
+ .flip-card .card-inner {
95
+ position: relative;
96
+ width: 100%;
97
+ height: 100%;
98
+ transition: transform 0.8s;
99
+ transform-style: preserve-3d;
100
+ }
101
+
102
+ .flip-card:hover .card-inner {
103
+ transform: rotateY(180deg);
104
+ }
105
+
106
+ .card-front, .card-back {
107
+ position: absolute;
108
+ width: 100%;
109
+ height: 100%;
110
+ backface-visibility: hidden;
111
+ display: flex;
112
+ flex-direction: column;
113
+ justify-content: center;
114
+ align-items: center;
115
+ padding: 30px;
116
+ }
117
+
118
+ .card-front {
119
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
120
+ color: white;
121
+ }
122
+
123
+ .card-back {
124
+ background: white;
125
+ transform: rotateY(180deg);
126
+ }
127
+
128
+ /* Glow Card Animation */
129
+ .glow-card {
130
+ position: relative;
131
+ transition: transform 0.3s ease;
132
+ }
133
+
134
+ .glow-card::before {
135
+ content: '';
136
+ position: absolute;
137
+ inset: -4px;
138
+ background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
139
+ border-radius: 20px;
140
+ opacity: 0;
141
+ transition: opacity 0.5s ease;
142
+ z-index: -1;
143
+ animation: glowRotate 3s linear infinite;
144
+ }
145
+
146
+ .glow-card:hover::before {
147
+ opacity: 1;
148
+ }
149
+
150
+ .glow-card:hover {
151
+ transform: translateY(-10px);
152
+ }
153
+
154
+ @keyframes glowRotate {
155
+ 0% {
156
+ filter: hue-rotate(0deg);
157
+ }
158
+ 100% {
159
+ filter: hue-rotate(360deg);
160
+ }
161
+ }
162
+
163
+ /* Slide Card Animation */
164
+ .slide-card {
165
+ position: relative;
166
+ overflow: hidden;
167
+ }
168
+
169
+ .slide-overlay {
170
+ position: absolute;
171
+ bottom: -100%;
172
+ left: 0;
173
+ width: 100%;
174
+ height: 100%;
175
+ background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
176
+ transition: bottom 0.5s ease;
177
+ display: flex;
178
+ align-items: center;
179
+ justify-content: center;
180
+ }
181
+
182
+ .slide-card:hover .slide-overlay {
183
+ bottom: 0;
184
+ }
185
+
186
+ .slide-card:hover .card-content {
187
+ transform: translateY(-20px);
188
+ transition: transform 0.5s ease;
189
+ }
190
+
191
+ /* Scale Card Animation */
192
+ .scale-card {
193
+ transition: transform 0.4s ease, box-shadow 0.4s ease;
194
+ }
195
+
196
+ .scale-card:hover {
197
+ transform: scale(1.08);
198
+ box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
199
+ }
200
+
201
+ .scale-card .card-content {
202
+ transition: all 0.3s ease;
203
+ }
204
+
205
+ .scale-card:hover .card-content {
206
+ transform: scale(0.95);
207
+ }
208
+
209
+ /* Tilt Card Animation */
210
+ .tilt-card {
211
+ transition: transform 0.5s ease;
212
+ }
213
+
214
+ .tilt-card:hover {
215
+ transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
216
+ box-shadow: -10px 20px 50px rgba(0, 0, 0, 0.3);
217
+ }
218
+
219
+ /* Gradient Card Animation */
220
+ .gradient-card {
221
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
222
+ background-size: 200% 200%;
223
+ transition: background-position 0.5s ease, transform 0.3s ease;
224
+ color: white;
225
+ }
226
+
227
+ .gradient-card h3 {
228
+ color: white;
229
+ }
230
+
231
+ .gradient-card p {
232
+ color: rgba(255, 255, 255, 0.9);
233
+ }
234
+
235
+ .gradient-card:hover {
236
+ background-position: 100% 100%;
237
+ transform: translateY(-10px);
238
+ }
239
+
240
+ /* Responsive Design */
241
+ @media (max-width: 768px) {
242
+ h1 {
243
+ font-size: 2rem;
244
+ }
245
+
246
+ .cards-grid {
247
+ grid-template-columns: 1fr;
248
+ gap: 30px;
249
+ }
250
+
251
+ .card {
252
+ height: 320px;
253
+ }
254
+ }