create-template-html-css 2.0.3 → 2.0.4

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/bin/cli.js CHANGED
@@ -14,7 +14,7 @@ program
14
14
  .description(
15
15
  chalk.cyan("🎨 Create HTML/CSS UI component templates in seconds"),
16
16
  )
17
- .version("2.0.3");
17
+ .version("2.0.4");
18
18
 
19
19
  // Add intro message
20
20
  program.on("--help", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-template-html-css",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "CLI tool to generate HTML and CSS templates for common UI elements",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -156,7 +156,7 @@ document.querySelectorAll('.bet-btn').forEach(btn => {
156
156
  updateDisplay();
157
157
  document.getElementById('dealBtn').disabled = false;
158
158
  } else {
159
- showMessage('אין מספיק קרדיטים!', 'error');
159
+ showMessage('Not enough credits!', 'error');
160
160
  }
161
161
  });
162
162
  });
@@ -166,7 +166,7 @@ document.getElementById('dealBtn').addEventListener('click', startGame);
166
166
 
167
167
  function startGame() {
168
168
  if (gameState.currentBet === 0) {
169
- showMessage('בחר הימור תחילה!', 'error');
169
+ showMessage('Choose a bet first!', 'error');
170
170
  return;
171
171
  }
172
172
 
@@ -261,7 +261,7 @@ document.getElementById('doubleBtn').addEventListener('click', () => {
261
261
  stand();
262
262
  }
263
263
  } else {
264
- showMessage('אין מספיק קרדיטים להכפלה!', 'error');
264
+ showMessage('Not enough credits to double down!', 'error');
265
265
  }
266
266
  });
267
267
 
@@ -301,23 +301,23 @@ function endGame(result) {
301
301
  switch (result) {
302
302
  case 'blackjack':
303
303
  winAmount = Math.floor(gameState.currentBet * 2.5); // 3:2 payout
304
- message = '🎉 BLACKJACK! אתה מנצח!';
304
+ message = '🎉 BLACKJACK! You win!';
305
305
  gameState.wins++;
306
306
  break;
307
307
  case 'win':
308
308
  winAmount = gameState.currentBet * 2;
309
- message = '🎉 ניצחת!';
309
+ message = '🎉 You won!';
310
310
  gameState.wins++;
311
311
  break;
312
312
  case 'lose':
313
- message = '😢 הפסדת!';
313
+ message = '😢 You lost!';
314
314
  break;
315
315
  case 'push':
316
316
  winAmount = gameState.currentBet;
317
- message = '🤝 תיקו!';
317
+ message = '🤝 Push!';
318
318
  break;
319
319
  case 'bust':
320
- message = '💥 עברת את 21! הפסדת!';
320
+ message = '💥 Busted! You lost!';
321
321
  break;
322
322
  }
323
323
 
@@ -337,7 +337,7 @@ function endGame(result) {
337
337
  // Check if out of credits
338
338
  if (gameState.credits < 10) {
339
339
  setTimeout(() => {
340
- alert('נגמרו הקרדיטים! מקבל 1000 קרדיטים חדשים.');
340
+ alert('Out of credits! Receiving 1000 new credits.');
341
341
  gameState.credits = 1000;
342
342
  updateDisplay();
343
343
  saveGame();
@@ -263,11 +263,11 @@ function gameOver() {
263
263
  ctx.fillStyle = '#FFFFFF';
264
264
  ctx.font = 'bold 48px Arial';
265
265
  ctx.textAlign = 'center';
266
- ctx.fillText('משחק נגמר!', canvas.width / 2, canvas.height / 2 - 40);
266
+ ctx.fillText('Game Over!', canvas.width / 2, canvas.height / 2 - 40);
267
267
 
268
268
  ctx.font = '24px Arial';
269
- ctx.fillText(`ניקוד סופי: ${gameState.score}`, canvas.width / 2, canvas.height / 2 + 20);
270
- ctx.fillText('לחץ "אתחל" להתחיל מחדש', canvas.width / 2, canvas.height / 2 + 60);
269
+ ctx.fillText(`Final Score: ${gameState.score}`, canvas.width / 2, canvas.height / 2 + 20);
270
+ ctx.fillText('Click "Reset" to restart', canvas.width / 2, canvas.height / 2 + 60);
271
271
 
272
272
  document.getElementById('startBtn').disabled = false;
273
273
  document.getElementById('pauseBtn').disabled = true;
@@ -306,7 +306,7 @@ function draw() {
306
306
  ctx.fillStyle = '#FFFFFF';
307
307
  ctx.font = 'bold 36px Arial';
308
308
  ctx.textAlign = 'center';
309
- ctx.fillText('משחק מושהה', canvas.width / 2, canvas.height / 2);
309
+ ctx.fillText('Game Paused', canvas.width / 2, canvas.height / 2);
310
310
  }
311
311
  }
312
312
 
@@ -349,7 +349,7 @@ function startGame() {
349
349
  // Pause game
350
350
  function pauseGame() {
351
351
  gameState.paused = !gameState.paused;
352
- document.getElementById('pauseBtn').textContent = gameState.paused ? 'המשך' : 'השהה';
352
+ document.getElementById('pauseBtn').textContent = gameState.paused ? 'Resume' : 'Pause';
353
353
  }
354
354
 
355
355
  // Reset game
@@ -372,7 +372,7 @@ function resetGame() {
372
372
 
373
373
  document.getElementById('startBtn').disabled = false;
374
374
  document.getElementById('pauseBtn').disabled = true;
375
- document.getElementById('pauseBtn').textContent = 'השהה';
375
+ document.getElementById('pauseBtn').textContent = 'Pause';
376
376
  }
377
377
 
378
378
  // Event listeners
@@ -331,15 +331,15 @@ function endGame(winner) {
331
331
  gameState.score1++;
332
332
  localStorage.setItem('connect4Score1', gameState.score1);
333
333
  updateScore();
334
- showMessage('🎉 שחקן 1 ניצח!', 'player1');
334
+ showMessage('🎉 Player 1 wins!', 'player1');
335
335
  } else if (winner === PLAYER2) {
336
336
  gameState.score2++;
337
337
  localStorage.setItem('connect4Score2', gameState.score2);
338
338
  updateScore();
339
- const message = gameState.gameMode === 'pvc' ? '🤖 המחשב ניצח!' : '🎉 שחקן 2 ניצח!';
339
+ const message = gameState.gameMode === 'pvc' ? '🤖 Computer wins!' : '🎉 Player 2 wins!';
340
340
  showMessage(message, 'player2');
341
341
  } else {
342
- showMessage('🤝 תיקו!', 'draw');
342
+ showMessage('🤝 Draw!', 'draw');
343
343
  }
344
344
  }
345
345
 
@@ -354,10 +354,10 @@ function showMessage(text, type) {
354
354
  function updateTurnIndicator() {
355
355
  const turnIndicator = document.getElementById('turnIndicator');
356
356
  if (gameState.currentPlayer === PLAYER1) {
357
- turnIndicator.textContent = 'תור שחקן 1';
357
+ turnIndicator.textContent = 'Player 1\'s Turn';
358
358
  turnIndicator.className = 'player1-turn';
359
359
  } else {
360
- const text = gameState.gameMode === 'pvc' ? 'תור המחשב' : 'תור שחקן 2';
360
+ const text = gameState.gameMode === 'pvc' ? 'Computer\'s Turn' : 'Player 2\'s Turn';
361
361
  turnIndicator.textContent = text;
362
362
  turnIndicator.className = 'player2-turn';
363
363
  }
@@ -1,8 +1,8 @@
1
1
  // Game state
2
2
  let gameState = {
3
3
  players: [
4
- { total: 0, current: 0, name: 'שחקן 1' },
5
- { total: 0, current: 0, name: 'שחקן 2' }
4
+ { total: 0, current: 0, name: 'Player 1' },
5
+ { total: 0, current: 0, name: 'Player 2' }
6
6
  ],
7
7
  currentPlayer: 0,
8
8
  gameActive: true,
@@ -34,13 +34,13 @@ function updateDisplay() {
34
34
  if (gameState.currentPlayer === 0) {
35
35
  player1Card.classList.add('active');
36
36
  player2Card.classList.remove('active');
37
- player1Card.querySelector('.current-turn').textContent = 'תורך!';
38
- player2Card.querySelector('.current-turn').textContent = 'המתן...';
37
+ player1Card.querySelector('.current-turn').textContent = 'Your Turn!';
38
+ player2Card.querySelector('.current-turn').textContent = 'Wait...';
39
39
  } else {
40
40
  player1Card.classList.remove('active');
41
41
  player2Card.classList.add('active');
42
- player1Card.querySelector('.current-turn').textContent = 'המתן...';
43
- player2Card.querySelector('.current-turn').textContent = gameState.gameMode === 'pvc' ? 'תור המחשב...' : 'תורך!';
42
+ player1Card.querySelector('.current-turn').textContent = 'Wait...';
43
+ player2Card.querySelector('.current-turn').textContent = gameState.gameMode === 'pvc' ? 'Computer\'s Turn...' : 'Your Turn!';
44
44
  }
45
45
  }
46
46
 
@@ -96,7 +96,7 @@ document.getElementById('rollBtn').addEventListener('click', async () => {
96
96
  if (roll === 1) {
97
97
  // Lost turn
98
98
  gameState.players[gameState.currentPlayer].current = 0;
99
- showMessage(`💥 הטלת 1! איבדת את כל ניקוד התור!`, 'error');
99
+ showMessage(`💥 Rolled 1! You lost all turn points!`, 'error');
100
100
 
101
101
  await new Promise(resolve => setTimeout(resolve, 1500));
102
102
  switchPlayer();
@@ -104,7 +104,7 @@ document.getElementById('rollBtn').addEventListener('click', async () => {
104
104
  // Add to current
105
105
  gameState.players[gameState.currentPlayer].current += roll;
106
106
  updateDisplay();
107
- showMessage(`🎲 הטלת ${roll}!`, 'info');
107
+ showMessage(`🎲 Rolled ${roll}!`, 'info');
108
108
  }
109
109
  });
110
110
 
@@ -115,7 +115,7 @@ document.getElementById('holdBtn').addEventListener('click', () => {
115
115
  const player = gameState.players[gameState.currentPlayer];
116
116
 
117
117
  if (player.current === 0) {
118
- showMessage('אין מה לשמור! הטל קובייה תחילה.', 'error');
118
+ showMessage('Nothing to save! Roll the dice first.', 'error');
119
119
  return;
120
120
  }
121
121
 
@@ -128,7 +128,7 @@ document.getElementById('holdBtn').addEventListener('click', () => {
128
128
  if (player.total >= 100) {
129
129
  endGame();
130
130
  } else {
131
- showMessage(`✅ נשמר! ${player.total} נקודות סה"כ.`, 'success');
131
+ showMessage(`✅ Saved! ${player.total} points total.`, 'success');
132
132
  setTimeout(() => {
133
133
  switchPlayer();
134
134
  }, 1000);
@@ -161,7 +161,7 @@ async function computerTurn() {
161
161
 
162
162
  if (roll === 1) {
163
163
  player.current = 0;
164
- showMessage(`🤖 המחשב הטיל 1! איבד את התור!`, 'error');
164
+ showMessage(`🤖 Computer rolled 1! Lost the turn!`, 'error');
165
165
  await new Promise(resolve => setTimeout(resolve, 1500));
166
166
  switchPlayer();
167
167
  return;
@@ -169,7 +169,7 @@ async function computerTurn() {
169
169
 
170
170
  player.current += roll;
171
171
  updateDisplay();
172
- showMessage(`🤖 המחשב הטיל ${roll}!`, 'info');
172
+ showMessage(`🤖 Computer rolled ${roll}!`, 'info');
173
173
 
174
174
  // AI decision logic
175
175
  const shouldHold =
@@ -189,7 +189,7 @@ async function computerTurn() {
189
189
  return;
190
190
  }
191
191
 
192
- showMessage(`🤖 המחשב שומר ${player.total} נקודות!`, 'success');
192
+ showMessage(`🤖 Computer saves ${player.total} points!`, 'success');
193
193
  await new Promise(resolve => setTimeout(resolve, 1500));
194
194
  switchPlayer();
195
195
  return;
@@ -203,10 +203,10 @@ function endGame() {
203
203
 
204
204
  const winner = gameState.players[gameState.currentPlayer];
205
205
  const winnerName = gameState.currentPlayer === 0 ?
206
- 'שחקן 1' :
207
- (gameState.gameMode === 'pvc' ? 'המחשב' : 'שחקן 2');
206
+ 'Player 1' :
207
+ (gameState.gameMode === 'pvc' ? 'Computer' : 'Player 2');
208
208
 
209
- showMessage(`🎉 ${winnerName} ניצח עם ${winner.total} נקודות!`, 'success');
209
+ showMessage(`🎉 ${winnerName} won with ${winner.total} points!`, 'success');
210
210
 
211
211
  // Celebrate
212
212
  celebrate();
@@ -217,8 +217,8 @@ document.getElementById('newGameBtn').addEventListener('click', newGame);
217
217
 
218
218
  function newGame() {
219
219
  gameState.players = [
220
- { total: 0, current: 0, name: 'שחקן 1' },
221
- { total: 0, current: 0, name: 'שחקן 2' }
220
+ { total: 0, current: 0, name: 'Player 1' },
221
+ { total: 0, current: 0, name: 'Player 2' }
222
222
  ];
223
223
  gameState.currentPlayer = 0;
224
224
  gameState.gameActive = true;
@@ -241,9 +241,9 @@ document.querySelectorAll('.mode-btn').forEach(btn => {
241
241
 
242
242
  // Update player 2 name
243
243
  if (gameState.gameMode === 'pvc') {
244
- document.querySelector('#player2Card h3').textContent = '🤖 מחשב';
244
+ document.querySelector('#player2Card h3').textContent = '🤖 Computer';
245
245
  } else {
246
- document.querySelector('#player2Card h3').textContent = '👤 שחקן 2';
246
+ document.querySelector('#player2Card h3').textContent = '👤 Player 2';
247
247
  }
248
248
 
249
249
  newGame();
@@ -279,15 +279,15 @@ function gameOver() {
279
279
  ctx.fillText('Game Over!', canvas.width / 2, canvas.height / 2 - 50);
280
280
 
281
281
  ctx.font = '24px Arial';
282
- ctx.strokeText(`ניקוד: ${gameState.score}`, canvas.width / 2, canvas.height / 2 + 10);
283
- ctx.fillText(`ניקוד: ${gameState.score}`, canvas.width / 2, canvas.height / 2 + 10);
282
+ ctx.strokeText(`Score: ${gameState.score}`, canvas.width / 2, canvas.height / 2 + 10);
283
+ ctx.fillText(`Score: ${gameState.score}`, canvas.width / 2, canvas.height / 2 + 10);
284
284
 
285
- ctx.strokeText(`שיא: ${gameState.highScore}`, canvas.width / 2, canvas.height / 2 + 50);
286
- ctx.fillText(`שיא: ${gameState.highScore}`, canvas.width / 2, canvas.height / 2 + 50);
285
+ ctx.strokeText(`High Score: ${gameState.highScore}`, canvas.width / 2, canvas.height / 2 + 50);
286
+ ctx.fillText(`High Score: ${gameState.highScore}`, canvas.width / 2, canvas.height / 2 + 50);
287
287
 
288
288
  ctx.font = '18px Arial';
289
- ctx.strokeText('לחץ "אתחל" להתחיל מחדש', canvas.width / 2, canvas.height / 2 + 100);
290
- ctx.fillText('לחץ "אתחל" להתחיל מחדש', canvas.width / 2, canvas.height / 2 + 100);
289
+ ctx.strokeText('Click "Reset" to restart', canvas.width / 2, canvas.height / 2 + 100);
290
+ ctx.fillText('Click "Reset" to restart', canvas.width / 2, canvas.height / 2 + 100);
291
291
 
292
292
  document.getElementById('startBtn').disabled = false;
293
293
  }
@@ -318,11 +318,11 @@ function drawStartScreen() {
318
318
  ctx.fillText('🐦 Flappy Bird', canvas.width / 2, canvas.height / 2 - 40);
319
319
 
320
320
  ctx.font = '20px Arial';
321
- ctx.strokeText('לחץ "התחל משחק"', canvas.width / 2, canvas.height / 2 + 20);
322
- ctx.fillText('לחץ "התחל משחק"', canvas.width / 2, canvas.height / 2 + 20);
321
+ ctx.strokeText('Click "Start Game"', canvas.width / 2, canvas.height / 2 + 20);
322
+ ctx.fillText('Click "Start Game"', canvas.width / 2, canvas.height / 2 + 20);
323
323
 
324
- ctx.strokeText('להתחיל!', canvas.width / 2, canvas.height / 2 + 50);
325
- ctx.fillText('להתחיל!', canvas.width / 2, canvas.height / 2 + 50);
324
+ ctx.strokeText('to begin!', canvas.width / 2, canvas.height / 2 + 50);
325
+ ctx.fillText('to begin!', canvas.width / 2, canvas.height / 2 + 50);
326
326
  }
327
327
 
328
328
  // Game loop
@@ -89,10 +89,10 @@ document.querySelectorAll('.mode-btn').forEach(btn => {
89
89
 
90
90
  // Update player 2 name
91
91
  if (gameState.gameMode === 'pvc') {
92
- document.getElementById('player2Name').textContent = '🤖 מחשב';
92
+ document.getElementById('player2Name').textContent = '🤖 Computer';
93
93
  document.querySelector('.difficulty-selector').style.display = 'flex';
94
94
  } else {
95
- document.getElementById('player2Name').textContent = '👤 שחקן 2';
95
+ document.getElementById('player2Name').textContent = '👤 Player 2';
96
96
  document.querySelector('.difficulty-selector').style.display = 'none';
97
97
  }
98
98
  });
@@ -251,7 +251,7 @@ function draw() {
251
251
  ctx.fillStyle = '#FFFFFF';
252
252
  ctx.font = 'bold 36px Arial';
253
253
  ctx.textAlign = 'center';
254
- ctx.fillText('משחק מושהה', canvas.width / 2, canvas.height / 2);
254
+ ctx.fillText('Game Paused', canvas.width / 2, canvas.height / 2);
255
255
  }
256
256
  }
257
257
 
@@ -288,10 +288,10 @@ function endGame(winner) {
288
288
  gameState.running = false;
289
289
 
290
290
  const winnerName = winner === 1 ?
291
- 'שחקן 1' :
292
- (gameState.gameMode === 'pvc' ? 'המחשב' : 'שחקן 2');
291
+ 'Player 1' :
292
+ (gameState.gameMode === 'pvc' ? 'Computer' : 'Player 2');
293
293
 
294
- showMessage(`🎉 ${winnerName} ניצח ${gameState.winningScore} - ${winner === 1 ? gameState.score2 : gameState.score1}!`, 'success');
294
+ showMessage(`🎉 ${winnerName} wins ${gameState.winningScore} - ${winner === 1 ? gameState.score2 : gameState.score1}!`, 'success');
295
295
 
296
296
  document.getElementById('startBtn').disabled = false;
297
297
  document.getElementById('pauseBtn').disabled = true;
@@ -325,7 +325,7 @@ document.getElementById('pauseBtn').addEventListener('click', pauseGame);
325
325
 
326
326
  function pauseGame() {
327
327
  gameState.paused = !gameState.paused;
328
- document.getElementById('pauseBtn').textContent = gameState.paused ? 'המשך' : 'השהה';
328
+ document.getElementById('pauseBtn').textContent = gameState.paused ? 'Resume' : 'Pause';
329
329
  }
330
330
 
331
331
  // Reset game
@@ -347,7 +347,7 @@ function resetGame() {
347
347
 
348
348
  document.getElementById('startBtn').disabled = false;
349
349
  document.getElementById('pauseBtn').disabled = true;
350
- document.getElementById('pauseBtn').textContent = 'השהה';
350
+ document.getElementById('pauseBtn').textContent = 'Pause';
351
351
  document.getElementById('resultMessage').textContent = '';
352
352
  }
353
353
 
@@ -72,7 +72,7 @@ async function spin() {
72
72
  if (gameState.spinning) return;
73
73
 
74
74
  if (gameState.credits < gameState.bet) {
75
- showMessage('אין מספיק קרדיטים!', 'error');
75
+ showMessage('Not enough credits!', 'error');
76
76
  return;
77
77
  }
78
78
 
@@ -105,7 +105,7 @@ async function spin() {
105
105
  // Check if out of credits
106
106
  if (gameState.credits < 10) {
107
107
  setTimeout(() => {
108
- alert('נגמרו הקרדיטים! מקבל 1000 קרדיטים חדשים.');
108
+ alert('Out of credits! Receiving 1000 new credits.');
109
109
  gameState.credits = 1000;
110
110
  updateDisplay();
111
111
  saveGame();
@@ -171,18 +171,18 @@ function checkWin(results) {
171
171
  let type = 'success';
172
172
 
173
173
  if (first.icon === '💰') {
174
- message = `🎉 ג'קפוט! זכית ${winAmount} קרדיטים! 🎉`;
174
+ message = `🎉 Jackpot! You won ${winAmount} credits! 🎉`;
175
175
  type = 'jackpot';
176
176
  celebrate();
177
177
  } else {
178
- message = `🎊 זכייה! +${winAmount} קרדיטים!`;
178
+ message = `🎊 You Win! +${winAmount} credits!`;
179
179
  }
180
180
 
181
181
  showMessage(message, type);
182
182
  } else if (first.icon === second.icon || second.icon === third.icon || first.icon === third.icon) {
183
- showMessage('כמעט! שני סמלים תואמים!', 'info');
183
+ showMessage('Almost! Two matching symbols!', 'info');
184
184
  } else {
185
- showMessage('נסה שוב!', 'info');
185
+ showMessage('Try again!', 'info');
186
186
  }
187
187
 
188
188
  updateDisplay();
@@ -273,10 +273,10 @@ function gameOver() {
273
273
  ctx.fillStyle = '#FFFFFF';
274
274
  ctx.font = 'bold 36px Arial';
275
275
  ctx.textAlign = 'center';
276
- ctx.fillText('משחק נגמר!', canvas.width / 2, canvas.height / 2 - 30);
276
+ ctx.fillText('Game Over!', canvas.width / 2, canvas.height / 2 - 30);
277
277
 
278
278
  ctx.font = '20px Arial';
279
- ctx.fillText(`ניקוד: ${gameState.score}`, canvas.width / 2, canvas.height / 2 + 10);
279
+ ctx.fillText(`Score: ${gameState.score}`, canvas.width / 2, canvas.height / 2 + 10);
280
280
 
281
281
  document.getElementById('startBtn').disabled = false;
282
282
  document.getElementById('pauseBtn').disabled = true;
@@ -324,7 +324,7 @@ function draw() {
324
324
  ctx.fillStyle = '#FFFFFF';
325
325
  ctx.font = 'bold 28px Arial';
326
326
  ctx.textAlign = 'center';
327
- ctx.fillText('משחק מושהה', canvas.width / 2, canvas.height / 2);
327
+ ctx.fillText('Game Paused', canvas.width / 2, canvas.height / 2);
328
328
  }
329
329
  }
330
330
 
@@ -408,7 +408,7 @@ function startGame() {
408
408
  // Pause game
409
409
  function pauseGame() {
410
410
  gameState.paused = !gameState.paused;
411
- document.getElementById('pauseBtn').textContent = gameState.paused ? 'המשך' : 'השהה';
411
+ document.getElementById('pauseBtn').textContent = gameState.paused ? 'Resume' : 'Pause';
412
412
  }
413
413
 
414
414
  // Reset game
@@ -432,7 +432,7 @@ function resetGame() {
432
432
 
433
433
  document.getElementById('startBtn').disabled = false;
434
434
  document.getElementById('pauseBtn').disabled = true;
435
- document.getElementById('pauseBtn').textContent = 'השהה';
435
+ document.getElementById('pauseBtn').textContent = 'Pause';
436
436
  }
437
437
 
438
438
  // Event listeners