create-template-html-css 1.9.0 → 2.0.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 (54) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +179 -2
  3. package/bin/cli.js +15 -3
  4. package/package.json +1 -1
  5. package/templates/blackjack/index.html +97 -0
  6. package/templates/blackjack/script.js +381 -0
  7. package/templates/blackjack/style.css +452 -0
  8. package/templates/breakout/index.html +56 -0
  9. package/templates/breakout/script.js +387 -0
  10. package/templates/breakout/style.css +239 -0
  11. package/templates/connect-four/index.html +78 -0
  12. package/templates/connect-four/script.js +413 -0
  13. package/templates/connect-four/style.css +426 -0
  14. package/templates/dice-game/index.html +99 -0
  15. package/templates/dice-game/script.js +291 -0
  16. package/templates/dice-game/style.css +403 -0
  17. package/templates/flappy-bird/index.html +47 -0
  18. package/templates/flappy-bird/script.js +394 -0
  19. package/templates/flappy-bird/style.css +243 -0
  20. package/templates/game-2048/index.html +59 -0
  21. package/templates/game-2048/script.js +269 -0
  22. package/templates/game-2048/style.css +281 -0
  23. package/templates/pong/index.html +90 -0
  24. package/templates/pong/script.js +364 -0
  25. package/templates/pong/style.css +371 -0
  26. package/templates/rock-paper-scissors/index.html +84 -0
  27. package/templates/rock-paper-scissors/script.js +199 -0
  28. package/templates/rock-paper-scissors/style.css +295 -0
  29. package/templates/simon-says/index.html +64 -0
  30. package/templates/simon-says/script.js +206 -0
  31. package/templates/simon-says/style.css +250 -0
  32. package/templates/slot-machine/index.html +112 -0
  33. package/templates/slot-machine/script.js +238 -0
  34. package/templates/slot-machine/style.css +464 -0
  35. package/templates/tetris/index.html +84 -0
  36. package/templates/tetris/script.js +447 -0
  37. package/templates/tetris/style.css +286 -0
  38. package/templates/whack-a-mole/index.html +85 -0
  39. package/templates/whack-a-mole/script.js +172 -0
  40. package/{demo-games/snake-game → templates/whack-a-mole}/style.css +114 -97
  41. package/COMPONENTS-GALLERY.html +0 -773
  42. package/PUBLISH-GUIDE.md +0 -112
  43. package/create-template-html-css-1.8.0.tgz +0 -0
  44. package/demo-games/guess-number/index.html +0 -71
  45. package/demo-games/guess-number/script.js +0 -216
  46. package/demo-games/guess-number/style.css +0 -337
  47. package/demo-games/memory-game/index.html +0 -50
  48. package/demo-games/memory-game/script.js +0 -216
  49. package/demo-games/memory-game/style.css +0 -288
  50. package/demo-games/snake-game/index.html +0 -61
  51. package/demo-games/snake-game/script.js +0 -360
  52. package/demo-games/tic-tac-toe/index.html +0 -57
  53. package/demo-games/tic-tac-toe/script.js +0 -156
  54. package/demo-games/tic-tac-toe/style.css +0 -244
package/CHANGELOG.md CHANGED
@@ -5,6 +5,86 @@ 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
+ ## [2.0.0] - 2026-02-05
9
+
10
+ ### Added
11
+ - **12 Additional Interactive Game Templates**: Major expansion with diverse game genres
12
+
13
+ **Puzzle & Strategy Games**:
14
+ - **2048**: Addictive tile-merging puzzle with touch & keyboard controls, undo feature, best score tracking
15
+ - **Connect Four**: Classic 4-in-a-row with AI opponent (3 difficulty levels), drop animations, win detection
16
+ - **Simon Says**: Memory pattern game with increasing difficulty, sound effects, high score tracking
17
+
18
+ **Arcade Classics**:
19
+ - **Breakout**: Brick breaker with lives system, level progression, paddle/ball physics, mouse & keyboard
20
+ - **Tetris**: Full Tetris with all 7 pieces, ghost preview, next piece display, level/speed progression
21
+ - **Flappy Bird**: Tap-to-flap obstacle game with animated background, realistic physics, increasing difficulty
22
+ - **Pong**: Classic paddle game with AI opponent (4 difficulty levels), 2-player mode, realistic ball physics
23
+ - **Whack-a-Mole**: Fast-paced arcade with difficulty levels, combo system, high score tracking
24
+
25
+ **Card & Casino Games**:
26
+ - **Blackjack**: Full 21 card game with betting system, dealer AI, Hit/Stand/Double, 3:2 blackjack payout
27
+ - **Slot Machine**: 3-reel slots with 8 weighted symbols, jackpot x100, confetti celebration, paytable
28
+
29
+ **Skill Games**:
30
+ - **Dice Game**: Race to 100 strategy game with AI opponent, roll/hold mechanics, animated dice
31
+ - **Rock-Paper-Scissors**: Classic hand game vs AI with best-of series, winning streak tracking
32
+
33
+ - **Enhanced Game Features**:
34
+ - Multiple AI difficulty levels in strategy games
35
+ - Advanced physics engines (Breakout, Pong, Flappy Bird)
36
+ - Complex game state management (Tetris, Blackjack)
37
+ - Canvas-based rendering for arcade games
38
+ - Weighted random algorithms (Slot Machine)
39
+ - localStorage for all game progress/scores
40
+ - Touch and keyboard control support
41
+ - Professional animations and visual feedback
42
+ - Responsive designs for all screen sizes
43
+
44
+ ### Changed
45
+ - Updated total template count from 30 to 46 components
46
+ - Expanded "Interactive Games" category from 4 to 16 games
47
+ - Updated CLI list command to display all 46 templates
48
+ - All game UI text translated to English
49
+ - Package version bumped to 2.0.0 (major release)
50
+
51
+ ### Technical Details
52
+ - All games are fully self-contained and work offline
53
+ - No external dependencies required
54
+ - Compatible with all modern browsers
55
+ - Canvas API used for rendering in applicable games
56
+ - Complex AI implementations (minimax-style for Connect Four, strategic for Dice Game)
57
+ - Proper game loop implementations with requestAnimationFrame
58
+
59
+ ## [1.9.0] - 2026-02-05
60
+
61
+ ### Added
62
+ - **4 New Interactive Game Templates**: Complete, playable games with full functionality
63
+ - **Tic-Tac-Toe**: Classic X and O game with score tracking, win detection, auto-reset, and winning cell highlighting
64
+ - **Memory Game**: Card matching game with 3 difficulty levels (4×4, 4×5, 4×6), move counter, timer, and emoji cards
65
+ - **Snake Game**: Classic snake with keyboard/touch controls, canvas rendering, increasing speed, and high score tracking
66
+ - **Guess the Number**: Number guessing game with hot/cold hints, 3 difficulty levels (1-100, 1-500, 1-1000), and best score tracking
67
+
68
+ - **Game Features**:
69
+ - Complete game logic and state management
70
+ - Score persistence using localStorage
71
+ - Responsive designs for mobile and desktop
72
+ - Smooth animations and visual feedback
73
+ - Touch and keyboard controls support
74
+ - Professional UI with modern gradients
75
+ - Win/lose detection and celebration animations
76
+
77
+ ### Changed
78
+ - Updated CLI list command to show 30 total components (was 26)
79
+ - Added new "Interactive Games" category in component list
80
+ - Updated package version from 1.8.1 to 1.9.0
81
+
82
+ ### Technical Details
83
+ - All games include HTML, CSS, and JavaScript files
84
+ - Games are fully self-contained and work offline
85
+ - No external dependencies required
86
+ - Compatible with all modern browsers
87
+
8
88
  ## [1.8.0] - 2026-02-02
9
89
 
10
90
  ### Added
package/README.md CHANGED
@@ -33,7 +33,7 @@ npm install -g create-template-html-css
33
33
  - 🌈 **Stunning Gradients** - Colorful and attractive designs
34
34
  - ⚡ **Animations** - Smooth and professional effects
35
35
  - 🔧 **Customizable** - Easy to edit and modify the code
36
- - 📦 **26 Templates** - Button, Card, Form, Navigation, Modal, Footer, Hero, Slider, Table, Login, Register, Skeleton, Spinner, Animated Cards, Typing Effect, Fade Gallery, Grid Layouts, Masonry Grid, Dashboard, Flexbox Layouts, Todo List, Counter, Accordion, Tabs
36
+ - 📦 **46 Templates** - Button, Card, Form, Navigation, Modal, Footer, Hero, Slider, Table, Login, Register, Skeleton, Spinner, Animated Cards, Typing Effect, Fade Gallery, Grid Layouts, Masonry Grid, Dashboard, Flexbox Layouts, Todo List, Counter, Accordion, Tabs, 16 Interactive Games (Tic-Tac-Toe, Memory, Snake, Guess Number, 2048, Whack-a-Mole, Simon Says, Rock-Paper-Scissors, Breakout, Tetris, Flappy Bird, Connect Four, Blackjack, Slot Machine, Dice Game, Pong)
37
37
  - 🎯 **Two Modes** - Create new projects or insert into existing HTML pages
38
38
  - 🔒 **Secure** - Input validation and path protection
39
39
  - 📚 **Well Documented** - Comprehensive guides and examples
@@ -43,6 +43,82 @@ npm install -g create-template-html-css
43
43
  - 💾 **Simple Backups** - Clean backup naming without timestamps (v1.6.2+)
44
44
  - 🎯 **Customizable Components** - Choose navigation items and form fields during creation (v1.7.0+)
45
45
 
46
+ ## 🆕 What's New in v2.0.0
47
+
48
+ ### 🎮 12 Additional Game Templates
49
+ Massive expansion with 12 new fully-functional games:
50
+
51
+ **Puzzle & Strategy Games:**
52
+ - **2048** - Addictive tile-merging puzzle with touch & keyboard controls, undo feature, and best score tracking
53
+ - **Connect Four** - Classic 4-in-a-row strategy game with AI opponent (3 difficulty levels), drop animations
54
+ - **Simon Says** - Memory pattern game with increasing difficulty, sound effects, and high score tracking
55
+
56
+ **Arcade Classics:**
57
+ - **Breakout** - Brick breaker with lives system, level progression, paddle/ball physics, mouse & keyboard controls
58
+ - **Tetris** - Full Tetris implementation with all 7 pieces, ghost preview, next piece display, level progression
59
+ - **Flappy Bird** - Tap-to-flap obstacle game with animated background, realistic physics, increasing difficulty
60
+ - **Pong** - Classic paddle game with AI opponent (4 difficulty levels), 2-player mode, realistic ball physics
61
+ - **Whack-a-Mole** - Fast-paced arcade game with difficulty levels, combo system, and high score tracking
62
+
63
+ **Card & Casino Games:**
64
+ - **Blackjack** - Full 21 card game with betting system, dealer AI, Hit/Stand/Double actions, 3:2 payout
65
+ - **Slot Machine** - 3-reel slots with 8 symbols, weighted payouts, jackpot x100, confetti celebration
66
+ - **Dice Game** - Race to 100 dice strategy game with AI opponent, roll/hold mechanics, animated dice
67
+
68
+ **Skill Games:**
69
+ - **Rock-Paper-Scissors** - Classic hand game vs AI with best-of series, winning streak tracking
70
+
71
+ **All Games Feature:**
72
+ - Complete game logic and state management
73
+ - Score/progress tracking with localStorage
74
+ - Responsive designs for mobile and desktop
75
+ - Smooth animations and visual feedback
76
+ - Professional UI with modern styling
77
+ - Touch and keyboard controls
78
+ - AI opponents with multiple difficulty levels
79
+
80
+ **Usage:**
81
+ ```bash
82
+ create-template create -c game-2048 -n 2048-game
83
+ create-template create -c breakout -n brick-breaker
84
+ create-template create -c tetris -n tetris-game
85
+ create-template create -c flappy-bird -n flappy
86
+ create-template create -c connect-four -n connect4
87
+ create-template create -c blackjack -n blackjack-game
88
+ create-template create -c slot-machine -n slots
89
+ create-template create -c dice-game -n dice
90
+ create-template create -c pong -n pong-game
91
+ create-template create -c whack-a-mole -n whack
92
+ create-template create -c simon-says -n simon
93
+ create-template create -c rock-paper-scissors -n rps
94
+ ```
95
+
96
+ ## 🆕 What's New in v1.9.0
97
+
98
+ ### 🎮 Interactive Game Templates
99
+ 4 new fully-functional game templates with complete gameplay mechanics:
100
+
101
+ - **Tic-Tac-Toe** - Classic X and O game with score tracking, win detection, and auto-reset
102
+ - **Memory Game** - Card matching game with 3 difficulty levels (4×4, 4×5, 4×6), timer, and move counter
103
+ - **Snake Game** - Classic snake with keyboard/touch controls, increasing speed, and high score tracking
104
+ - **Guess the Number** - Number guessing game with hot/cold hints, multiple difficulty levels, and best score tracking
105
+
106
+ **Features:**
107
+ - Complete game logic and state management
108
+ - Score tracking with localStorage persistence
109
+ - Responsive designs for mobile and desktop
110
+ - Smooth animations and visual feedback
111
+ - Professional UI with gradients and modern styling
112
+ - Touch and keyboard controls
113
+
114
+ **Usage:**
115
+ ```bash
116
+ create-template create -c tic-tac-toe -n my-game
117
+ create-template create -c memory-game -n memory
118
+ create-template create -c snake-game -n snake
119
+ create-template create -c guess-number -n guess
120
+ ```
121
+
46
122
  ## 🆕 What's New in v1.8.0
47
123
 
48
124
  ### 🌙 Dark Mode Support
@@ -103,7 +179,7 @@ create-template create -c modal
103
179
 
104
180
  ### 📊 Interactive Component Gallery
105
181
  New **COMPONENTS-GALLERY.html** showcase page:
106
- - Browse all 26 components with descriptions
182
+ - Browse all 30 components with descriptions
107
183
  - Search and filter by category
108
184
  - View all 10 color scheme presets with color swatches
109
185
  - Copy CLI commands (both npx and local) with one click
@@ -720,6 +796,107 @@ Admin dashboard built entirely with Flexbox:
720
796
  - Interactive animations
721
797
  - Professional design
722
798
 
799
+ ### 20. Todo List ✅
800
+
801
+ Interactive todo list with add/remove functionality:
802
+
803
+ **Features:**
804
+ - Add new tasks
805
+ - Mark tasks as complete
806
+ - Delete tasks
807
+ - Task counter
808
+ - LocalStorage persistence
809
+ - Animated interactions
810
+
811
+ ### 21. Counter 🔢
812
+
813
+ Click counter with history tracking:
814
+
815
+ **Features:**
816
+ - Increment/decrement buttons
817
+ - Custom step size
818
+ - Reset functionality
819
+ - History log
820
+ - Color-coded display
821
+ - Animated transitions
822
+
823
+ ### 22. Accordion 📑
824
+
825
+ Collapsible accordion component:
826
+
827
+ **Features:**
828
+ - Multiple sections
829
+ - Smooth expand/collapse
830
+ - Only one section open at a time
831
+ - Icon rotation
832
+ - Responsive design
833
+
834
+ ### 23. Tabs 📑
835
+
836
+ Tabbed content switcher:
837
+
838
+ **Features:**
839
+ - Multiple tab panels
840
+ - Smooth transitions
841
+ - Active state highlighting
842
+ - Responsive layout
843
+ - Keyboard navigation
844
+
845
+ ### 24. Tic-Tac-Toe 🎯
846
+
847
+ Classic X and O game:
848
+
849
+ **Features:**
850
+ - Two-player gameplay
851
+ - Win detection (rows, columns, diagonals)
852
+ - Score tracking for X, O, and draws
853
+ - Auto-reset after game ends
854
+ - Winning cell highlighting
855
+ - Responsive design
856
+ - Score persistence
857
+
858
+ ### 25. Memory Game 🧠
859
+
860
+ Card matching memory game:
861
+
862
+ **Features:**
863
+ - 3 difficulty levels (4×4, 4×5, 4×6)
864
+ - Move counter
865
+ - Timer
866
+ - Match tracking
867
+ - Card flip animations
868
+ - Emoji-based cards
869
+ - Win detection
870
+ - Responsive grid
871
+
872
+ ### 26. Snake Game 🐍
873
+
874
+ Classic snake game:
875
+
876
+ **Features:**
877
+ - Keyboard controls (Arrow keys, WASD)
878
+ - Touch swipe controls for mobile
879
+ - On-screen button controls
880
+ - Increasing speed as you score
881
+ - High score tracking (localStorage)
882
+ - Collision detection
883
+ - Smooth canvas rendering
884
+ - Pause/resume functionality
885
+
886
+ ### 27. Guess the Number 🎲
887
+
888
+ Number guessing game with hints:
889
+
890
+ **Features:**
891
+ - 3 difficulty levels (1-100, 1-500, 1-1000)
892
+ - Hot/cold hint system
893
+ - Guess history
894
+ - Attempt counter
895
+ - Best score tracking per difficulty
896
+ - Visual feedback animations
897
+ - Duplicate guess detection
898
+ - Give up option
899
+
723
900
 
724
901
  ## 💡 Examples
725
902
 
package/bin/cli.js CHANGED
@@ -601,7 +601,7 @@ program
601
601
  .command("list")
602
602
  .description(chalk.green("List all available templates"))
603
603
  .action(() => {
604
- console.log("\n" + chalk.blue("📦 Available Components (30 total)\n"));
604
+ console.log("\n" + chalk.blue("📦 Available Components (46 total)\n"));
605
605
 
606
606
  console.log(chalk.yellow("━ Basic Components (9)"));
607
607
  console.log(" button Styled button component");
@@ -643,11 +643,23 @@ program
643
643
  console.log(" accordion Collapsible accordion component");
644
644
  console.log(" tabs Tabbed content switcher");
645
645
 
646
- console.log("\n" + chalk.green("━ Interactive Games (4)"));
646
+ console.log("\n" + chalk.green("━ Interactive Games (16)"));
647
647
  console.log(" tic-tac-toe Classic Tic-Tac-Toe game with score tracking");
648
648
  console.log(" memory-game Memory card matching game with difficulty levels");
649
649
  console.log(" snake-game Classic Snake game with keyboard controls");
650
650
  console.log(" guess-number Number guessing game with hints and scoring");
651
+ console.log(" game-2048 2048 puzzle game with touch & keyboard controls");
652
+ console.log(" whack-a-mole Whack-A-Mole arcade game with difficulty levels");
653
+ console.log(" simon-says Simon Says memory pattern game");
654
+ console.log(" rock-paper-scissors Rock Paper Scissors vs AI");
655
+ console.log(" breakout Brick breaker arcade game with levels");
656
+ console.log(" tetris Classic Tetris with piece preview");
657
+ console.log(" flappy-bird Flappy Bird obstacle avoidance game");
658
+ console.log(" connect-four Connect 4 strategy game vs AI");
659
+ console.log(" blackjack Blackjack card game with betting");
660
+ console.log(" slot-machine 3-reel slot machine with jackpots");
661
+ console.log(" dice-game Dice race to 100 strategy game");
662
+ console.log(" pong Classic Pong paddle game vs AI");
651
663
 
652
664
  console.log("\n" + chalk.gray("Usage:"));
653
665
  console.log(" create-template create Create a new component");
@@ -705,7 +717,7 @@ if (!process.argv.slice(2).length) {
705
717
  console.log(" $ create-template create # Create with prompts");
706
718
  console.log(" $ create-template insert # Insert with prompts");
707
719
  console.log(" $ create-template gallery # View all components in gallery");
708
- console.log(" $ create-template list # View all 26 templates\n");
720
+ console.log(" $ create-template list # View all 46 templates\n");
709
721
  console.log(chalk.gray("Flag Examples (Non-interactive):"));
710
722
  console.log(" $ create-template create -c button -n my-btn");
711
723
  console.log(" $ create-template insert -f index.html -c card -s separate");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-template-html-css",
3
- "version": "1.9.0",
3
+ "version": "2.0.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": {
@@ -0,0 +1,97 @@
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>Blackjack - 21</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <div class="header">
12
+ <h1>🃏 Blackjack</h1>
13
+ <p class="subtitle">Get to 21 and beat the dealer!</p>
14
+ </div>
15
+
16
+ <div class="game-info">
17
+ <div class="info-item">
18
+ <span class="label">Credits:</span>
19
+ <span id="credits" class="value">1000</span>
20
+ </div>
21
+ <div class="info-item">
22
+ <span class="label">Bet:</span>
23
+ <span id="bet" class="value">0</span>
24
+ </div>
25
+ <div class="info-item">
26
+ <span class="label">Wins:</span>
27
+ <span id="wins" class="value">0</span>
28
+ </div>
29
+ </div>
30
+
31
+ <div class="game-area">
32
+ <!-- Dealer Section -->
33
+ <div class="player-section dealer-section">
34
+ <div class="player-header">
35
+ <h3>🎩 Dealer</h3>
36
+ <div class="score-display">
37
+ <span id="dealerScore">0</span>
38
+ </div>
39
+ </div>
40
+ <div id="dealerHand" class="hand"></div>
41
+ </div>
42
+
43
+ <!-- Player Section -->
44
+ <div class="player-section player-section-main">
45
+ <div class="player-header">
46
+ <h3>👤 You</h3>
47
+ <div class="score-display">
48
+ <span id="playerScore">0</span>
49
+ </div>
50
+ </div>
51
+ <div id="playerHand" class="hand"></div>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- Betting Area -->
56
+ <div class="betting-area" id="bettingArea">
57
+ <h3>🎲 Place Bet:</h3>
58
+ <div class="bet-buttons">
59
+ <button class="bet-btn" data-amount="10">10</button>
60
+ <button class="bet-btn" data-amount="25">25</button>
61
+ <button class="bet-btn" data-amount="50">50</button>
62
+ <button class="bet-btn" data-amount="100">100</button>
63
+ <button class="bet-btn" data-amount="250">250</button>
64
+ </div>
65
+ <button id="dealBtn" class="btn btn-primary" disabled>Deal Cards</button>
66
+ </div>
67
+
68
+ <!-- Action Buttons -->
69
+ <div class="action-buttons" id="actionButtons" style="display: none;">
70
+ <button id="hitBtn" class="btn btn-success">Hit</button>
71
+ <button id="standBtn" class="btn btn-warning">Stand</button>
72
+ <button id="doubleBtn" class="btn btn-info">Double</button>
73
+ </div>
74
+
75
+ <!-- Result Message -->
76
+ <div id="resultMessage" class="result-message"></div>
77
+
78
+ <!-- Next Round Button -->
79
+ <button id="nextRoundBtn" class="btn btn-primary" style="display: none;">Next Round</button>
80
+
81
+ <div class="instructions">
82
+ <h3>📖 Game Rules:</h3>
83
+ <ul>
84
+ <li>Goal: Get to 21 or as close as possible without going over</li>
85
+ <li>Face cards are worth 10, Ace is worth 1 or 11</li>
86
+ <li><strong>Hit</strong> - Take another card</li>
87
+ <li><strong>Stand</strong> - Stop and let dealer play</li>
88
+ <li><strong>Double</strong> - Double your bet and get one card</li>
89
+ <li><strong>Blackjack</strong> - 21 with 2 cards = 3:2 payout!</li>
90
+ <li>Dealer must hit until 17 or higher</li>
91
+ </ul>
92
+ </div>
93
+ </div>
94
+
95
+ <script src="script.js"></script>
96
+ </body>
97
+ </html>