create-template-html-css 1.2.2 → 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.
Files changed (36) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +165 -1
  3. package/bin/cli.js +27 -3
  4. package/package.json +16 -8
  5. package/src/generator.js +1 -1
  6. package/src/inserter.js +1 -1
  7. package/templates/animated-card/index.html +85 -0
  8. package/templates/animated-card/script.js +37 -0
  9. package/templates/animated-card/style.css +254 -0
  10. package/templates/dashboard-grid/index.html +247 -0
  11. package/templates/dashboard-grid/script.js +157 -0
  12. package/templates/dashboard-grid/style.css +558 -0
  13. package/templates/fade-gallery/index.html +134 -0
  14. package/templates/fade-gallery/script.js +123 -0
  15. package/templates/fade-gallery/style.css +309 -0
  16. package/templates/flex-cards/index.html +276 -0
  17. package/templates/flex-cards/script.js +122 -0
  18. package/templates/flex-cards/style.css +556 -0
  19. package/templates/flex-dashboard/index.html +282 -0
  20. package/templates/flex-dashboard/script.js +149 -0
  21. package/templates/flex-dashboard/style.css +659 -0
  22. package/templates/flex-layout/index.html +185 -0
  23. package/templates/flex-layout/script.js +79 -0
  24. package/templates/flex-layout/style.css +336 -0
  25. package/templates/grid-layout/index.html +164 -0
  26. package/templates/grid-layout/script.js +75 -0
  27. package/templates/grid-layout/style.css +452 -0
  28. package/templates/masonry-grid/index.html +196 -0
  29. package/templates/masonry-grid/script.js +122 -0
  30. package/templates/masonry-grid/style.css +259 -0
  31. package/templates/spinner/index.html +56 -0
  32. package/templates/spinner/script.js +22 -0
  33. package/templates/spinner/style.css +207 -0
  34. package/templates/typing-effect/index.html +58 -0
  35. package/templates/typing-effect/script.js +247 -0
  36. package/templates/typing-effect/style.css +253 -0
@@ -0,0 +1,207 @@
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, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
10
+ min-height: 100vh;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ padding: 40px 20px;
15
+ }
16
+
17
+ .container {
18
+ background: rgba(255, 255, 255, 0.95);
19
+ padding: 50px 40px;
20
+ border-radius: 20px;
21
+ box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
22
+ max-width: 900px;
23
+ width: 100%;
24
+ }
25
+
26
+ h1 {
27
+ text-align: center;
28
+ margin-bottom: 50px;
29
+ color: #1e3c72;
30
+ font-size: 2.5rem;
31
+ font-weight: 700;
32
+ }
33
+
34
+ .spinner-group {
35
+ margin: 40px 0;
36
+ text-align: center;
37
+ padding: 30px;
38
+ background: #f8f9fa;
39
+ border-radius: 15px;
40
+ }
41
+
42
+ .spinner-group h3 {
43
+ margin-bottom: 25px;
44
+ color: #333;
45
+ font-size: 1.3rem;
46
+ }
47
+
48
+ /* Circle Spinner */
49
+ .spinner-circle {
50
+ width: 60px;
51
+ height: 60px;
52
+ border: 6px solid #e0e0e0;
53
+ border-top-color: #667eea;
54
+ border-radius: 50%;
55
+ animation: spin 1s linear infinite;
56
+ margin: 0 auto;
57
+ }
58
+
59
+ @keyframes spin {
60
+ to {
61
+ transform: rotate(360deg);
62
+ }
63
+ }
64
+
65
+ /* Dots Spinner */
66
+ .spinner-dots {
67
+ display: flex;
68
+ gap: 12px;
69
+ justify-content: center;
70
+ align-items: center;
71
+ }
72
+
73
+ .spinner-dots .dot {
74
+ width: 18px;
75
+ height: 18px;
76
+ background: #667eea;
77
+ border-radius: 50%;
78
+ animation: bounce 1.4s infinite ease-in-out both;
79
+ }
80
+
81
+ .spinner-dots .dot:nth-child(1) {
82
+ animation-delay: -0.32s;
83
+ }
84
+
85
+ .spinner-dots .dot:nth-child(2) {
86
+ animation-delay: -0.16s;
87
+ }
88
+
89
+ @keyframes bounce {
90
+ 0%, 80%, 100% {
91
+ transform: scale(0);
92
+ opacity: 0.5;
93
+ }
94
+ 40% {
95
+ transform: scale(1);
96
+ opacity: 1;
97
+ }
98
+ }
99
+
100
+ /* Pulse Spinner */
101
+ .spinner-pulse {
102
+ width: 60px;
103
+ height: 60px;
104
+ background: #667eea;
105
+ border-radius: 50%;
106
+ animation: pulse 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
107
+ margin: 0 auto;
108
+ }
109
+
110
+ @keyframes pulse {
111
+ 0%, 100% {
112
+ transform: scale(0.8);
113
+ opacity: 1;
114
+ }
115
+ 50% {
116
+ transform: scale(1.2);
117
+ opacity: 0.5;
118
+ }
119
+ }
120
+
121
+ /* Bar Spinner */
122
+ .spinner-bars {
123
+ display: flex;
124
+ gap: 8px;
125
+ justify-content: center;
126
+ align-items: center;
127
+ height: 60px;
128
+ }
129
+
130
+ .spinner-bars .bar {
131
+ width: 8px;
132
+ background: #667eea;
133
+ border-radius: 4px;
134
+ animation: stretch 1.2s ease-in-out infinite;
135
+ }
136
+
137
+ .spinner-bars .bar:nth-child(1) {
138
+ animation-delay: -0.4s;
139
+ }
140
+
141
+ .spinner-bars .bar:nth-child(2) {
142
+ animation-delay: -0.3s;
143
+ }
144
+
145
+ .spinner-bars .bar:nth-child(3) {
146
+ animation-delay: -0.2s;
147
+ }
148
+
149
+ .spinner-bars .bar:nth-child(4) {
150
+ animation-delay: -0.1s;
151
+ }
152
+
153
+ @keyframes stretch {
154
+ 0%, 100% {
155
+ height: 20px;
156
+ }
157
+ 50% {
158
+ height: 60px;
159
+ }
160
+ }
161
+
162
+ /* Gradient Spinner */
163
+ .spinner-gradient {
164
+ width: 60px;
165
+ height: 60px;
166
+ border-radius: 50%;
167
+ background: conic-gradient(
168
+ from 0deg,
169
+ transparent 0deg,
170
+ #667eea 90deg,
171
+ #764ba2 180deg,
172
+ transparent 270deg
173
+ );
174
+ animation: rotate 1.5s linear infinite;
175
+ margin: 0 auto;
176
+ position: relative;
177
+ }
178
+
179
+ .spinner-gradient::before {
180
+ content: '';
181
+ position: absolute;
182
+ inset: 6px;
183
+ background: #f8f9fa;
184
+ border-radius: 50%;
185
+ }
186
+
187
+ @keyframes rotate {
188
+ to {
189
+ transform: rotate(360deg);
190
+ }
191
+ }
192
+
193
+ /* Responsive Design */
194
+ @media (max-width: 768px) {
195
+ .container {
196
+ padding: 30px 20px;
197
+ }
198
+
199
+ h1 {
200
+ font-size: 2rem;
201
+ }
202
+
203
+ .spinner-group {
204
+ padding: 20px;
205
+ margin: 25px 0;
206
+ }
207
+ }
@@ -0,0 +1,58 @@
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}} - Typing Effect Component</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <!-- Hero Section with Typing Effect -->
12
+ <section class="hero-section">
13
+ <h1 class="main-title">Welcome to <span class="gradient-text">Amazing</span></h1>
14
+ <p class="typing-text" id="typingText"></p>
15
+ <div class="cursor"></div>
16
+ </section>
17
+
18
+ <!-- Multiple Typing Examples -->
19
+ <section class="examples-section">
20
+ <h2>Typing Animation Examples</h2>
21
+
22
+ <div class="example-card">
23
+ <h3>Simple Typing</h3>
24
+ <p class="typed" data-text="This text appears letter by letter..."></p>
25
+ </div>
26
+
27
+ <div class="example-card">
28
+ <h3>Multiple Lines</h3>
29
+ <div class="multi-line-typed">
30
+ <p class="typed-line" data-text="First line appears first..." data-delay="0"></p>
31
+ <p class="typed-line" data-text="Then the second line..." data-delay="2000"></p>
32
+ <p class="typed-line" data-text="And finally the third!" data-delay="4000"></p>
33
+ </div>
34
+ </div>
35
+
36
+ <div class="example-card">
37
+ <h3>Rotating Text</h3>
38
+ <p class="rotating-container">
39
+ I am <span class="rotating-text" id="rotatingText"></span>
40
+ </p>
41
+ </div>
42
+
43
+ <div class="example-card highlight">
44
+ <h3>Code Typing Effect</h3>
45
+ <pre class="code-block"><code id="codeTyping"></code></pre>
46
+ </div>
47
+ </section>
48
+
49
+ <!-- Action Buttons -->
50
+ <section class="action-section">
51
+ <button class="btn btn-primary" id="restartBtn">Restart Animations</button>
52
+ <button class="btn btn-secondary" id="pauseBtn">Pause</button>
53
+ </section>
54
+ </div>
55
+
56
+ <script src="script.js"></script>
57
+ </body>
58
+ </html>
@@ -0,0 +1,247 @@
1
+ // Typing Effect Component JavaScript
2
+
3
+ class TypeWriter {
4
+ constructor(element, text, speed = 100, deleteSpeed = 50) {
5
+ this.element = element;
6
+ this.text = text;
7
+ this.speed = speed;
8
+ this.deleteSpeed = deleteSpeed;
9
+ this.index = 0;
10
+ this.isDeleting = false;
11
+ this.isPaused = false;
12
+ }
13
+
14
+ type() {
15
+ if (this.isPaused) return;
16
+
17
+ const current = this.text.substring(0, this.index);
18
+ this.element.textContent = current;
19
+
20
+ if (!this.isDeleting && this.index < this.text.length) {
21
+ this.index++;
22
+ setTimeout(() => this.type(), this.speed);
23
+ } else if (this.isDeleting && this.index > 0) {
24
+ this.index--;
25
+ setTimeout(() => this.type(), this.deleteSpeed);
26
+ }
27
+ }
28
+
29
+ start() {
30
+ this.type();
31
+ }
32
+
33
+ pause() {
34
+ this.isPaused = true;
35
+ }
36
+
37
+ resume() {
38
+ this.isPaused = false;
39
+ this.type();
40
+ }
41
+
42
+ reset() {
43
+ this.index = 0;
44
+ this.isDeleting = false;
45
+ this.element.textContent = '';
46
+ }
47
+ }
48
+
49
+ // Main typing text with multiple phrases
50
+ const mainPhrases = [
51
+ "We create stunning animations...",
52
+ "We build modern websites...",
53
+ "We design beautiful interfaces...",
54
+ "We bring ideas to life..."
55
+ ];
56
+
57
+ let mainPhraseIndex = 0;
58
+ let mainTyping = null;
59
+ let isPaused = false;
60
+
61
+ function typeMainText() {
62
+ if (isPaused) return;
63
+
64
+ const element = document.getElementById('typingText');
65
+ const text = mainPhrases[mainPhraseIndex];
66
+
67
+ let index = 0;
68
+ element.textContent = '';
69
+
70
+ function typeChar() {
71
+ if (isPaused) return;
72
+
73
+ if (index < text.length) {
74
+ element.textContent += text.charAt(index);
75
+ index++;
76
+ setTimeout(typeChar, 80);
77
+ } else {
78
+ setTimeout(deleteText, 2000);
79
+ }
80
+ }
81
+
82
+ function deleteText() {
83
+ if (isPaused) return;
84
+
85
+ if (index > 0) {
86
+ element.textContent = text.substring(0, index - 1);
87
+ index--;
88
+ setTimeout(deleteText, 40);
89
+ } else {
90
+ mainPhraseIndex = (mainPhraseIndex + 1) % mainPhrases.length;
91
+ setTimeout(typeMainText, 500);
92
+ }
93
+ }
94
+
95
+ typeChar();
96
+ }
97
+
98
+ // Simple typing for example cards
99
+ function typeSimpleText(element, text, speed = 100) {
100
+ let index = 0;
101
+ element.textContent = '';
102
+
103
+ function type() {
104
+ if (isPaused) return;
105
+
106
+ if (index < text.length) {
107
+ element.textContent += text.charAt(index);
108
+ index++;
109
+ setTimeout(type, speed);
110
+ }
111
+ }
112
+
113
+ type();
114
+ }
115
+
116
+ // Rotating text effect
117
+ const rotatingWords = ["a Developer", "a Designer", "Creative", "Innovative", "Passionate"];
118
+ let rotatingIndex = 0;
119
+
120
+ function rotateText() {
121
+ if (isPaused) return;
122
+
123
+ const element = document.getElementById('rotatingText');
124
+ const word = rotatingWords[rotatingIndex];
125
+
126
+ let index = 0;
127
+ element.textContent = '';
128
+
129
+ function typeWord() {
130
+ if (isPaused) return;
131
+
132
+ if (index < word.length) {
133
+ element.textContent += word.charAt(index);
134
+ index++;
135
+ setTimeout(typeWord, 100);
136
+ } else {
137
+ setTimeout(deleteWord, 2000);
138
+ }
139
+ }
140
+
141
+ function deleteWord() {
142
+ if (isPaused) return;
143
+
144
+ if (index > 0) {
145
+ element.textContent = word.substring(0, index - 1);
146
+ index--;
147
+ setTimeout(deleteWord, 50);
148
+ } else {
149
+ rotatingIndex = (rotatingIndex + 1) % rotatingWords.length;
150
+ setTimeout(rotateText, 500);
151
+ }
152
+ }
153
+
154
+ typeWord();
155
+ }
156
+
157
+ // Code typing effect
158
+ const codeText = `function createAnimation() {
159
+ const element = document.querySelector('.box');
160
+ element.style.animation = 'fadeIn 1s ease';
161
+ console.log('Animation started!');
162
+ }`;
163
+
164
+ function typeCode() {
165
+ if (isPaused) return;
166
+
167
+ const element = document.getElementById('codeTyping');
168
+ let index = 0;
169
+ element.textContent = '';
170
+
171
+ function type() {
172
+ if (isPaused) return;
173
+
174
+ if (index < codeText.length) {
175
+ element.textContent += codeText.charAt(index);
176
+ index++;
177
+ setTimeout(type, 50);
178
+ }
179
+ }
180
+
181
+ type();
182
+ }
183
+
184
+ // Initialize all typing effects
185
+ function initializeTyping() {
186
+ // Main typing text
187
+ typeMainText();
188
+
189
+ // Simple typing examples
190
+ const simpleTyped = document.querySelector('.typed');
191
+ if (simpleTyped) {
192
+ const text = simpleTyped.getAttribute('data-text');
193
+ setTimeout(() => typeSimpleText(simpleTyped, text), 500);
194
+ }
195
+
196
+ // Multi-line typing
197
+ const typedLines = document.querySelectorAll('.typed-line');
198
+ typedLines.forEach(line => {
199
+ const text = line.getAttribute('data-text');
200
+ const delay = parseInt(line.getAttribute('data-delay')) || 0;
201
+ setTimeout(() => typeSimpleText(line, text, 80), delay);
202
+ });
203
+
204
+ // Rotating text
205
+ setTimeout(rotateText, 1000);
206
+
207
+ // Code typing
208
+ setTimeout(typeCode, 1500);
209
+ }
210
+
211
+ // Event listeners
212
+ document.addEventListener('DOMContentLoaded', () => {
213
+ initializeTyping();
214
+
215
+ // Restart button
216
+ const restartBtn = document.getElementById('restartBtn');
217
+ if (restartBtn) {
218
+ restartBtn.addEventListener('click', () => {
219
+ isPaused = false;
220
+ mainPhraseIndex = 0;
221
+ rotatingIndex = 0;
222
+
223
+ // Clear all text
224
+ document.getElementById('typingText').textContent = '';
225
+ document.getElementById('rotatingText').textContent = '';
226
+ document.getElementById('codeTyping').textContent = '';
227
+
228
+ document.querySelectorAll('.typed, .typed-line').forEach(el => {
229
+ el.textContent = '';
230
+ });
231
+
232
+ // Restart animations
233
+ initializeTyping();
234
+ });
235
+ }
236
+
237
+ // Pause button
238
+ const pauseBtn = document.getElementById('pauseBtn');
239
+ if (pauseBtn) {
240
+ pauseBtn.addEventListener('click', () => {
241
+ isPaused = !isPaused;
242
+ pauseBtn.textContent = isPaused ? 'Resume' : 'Pause';
243
+ });
244
+ }
245
+ });
246
+
247
+ console.log('Typing Effect Component initialized');