wad-lab 1.2.2 → 1.2.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.
Files changed (207) hide show
  1. package/bin/index.js +477 -627
  2. package/package.json +1 -1
  3. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/App.vue +241 -429
  4. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemFormModal.vue +183 -0
  5. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemPatchModal.vue +193 -0
  6. package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemTable.vue +177 -0
  7. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/App.vue +150 -441
  8. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemFormModal.vue +207 -0
  9. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemStats.vue +64 -0
  10. package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemTable.vue +195 -0
  11. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/App.vue +41 -90
  12. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/ItemFormModal.vue +173 -0
  13. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/ItemTable.vue +102 -0
  14. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/NavBar.vue +57 -0
  15. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/DepartmentView.vue +132 -296
  16. package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/EmployeeView.vue +126 -219
  17. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/ItemDetail.vue +115 -0
  18. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/ItemTable.vue +104 -0
  19. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/SideBar.vue +59 -0
  20. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/CompanyLayout.vue +2 -51
  21. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/DepartmentListView.vue +92 -250
  22. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeDetailView.vue +59 -181
  23. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeListView.vue +67 -315
  24. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/App.vue +19 -70
  25. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemFormModal.vue +173 -0
  26. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemPatchModal.vue +144 -0
  27. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemTable.vue +102 -0
  28. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/NavBar.vue +53 -0
  29. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/DepartmentView.vue +107 -229
  30. package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/EmployeeView.vue +143 -257
  31. package/templates/game-bingo/script.js +1 -1
  32. package/templates/game-memory-cards/script.js +2 -2
  33. package/templates/game-rock-paper-scissors/index.html +3 -3
  34. package/templates/game-rock-paper-scissors/script.js +2 -2
  35. package/templates/game-tic-tac-toe/script.js +2 -2
  36. package/templates/game-whack-a-mole/index.html +9 -9
  37. package/templates/servlet-basic/WEB-INF/ItemServlet.java +13 -0
  38. package/templates/servlet-basic/WEB-INF/classes/ItemServlet.class +0 -0
  39. package/templates/servlet-flow/WEB-INF/HelloServlet.java +34 -25
  40. package/templates/servlet-flow/WEB-INF/classes/HelloServlet.class +0 -0
  41. package/templates/servlet-jdbc/WEB-INF/JdbcItemServlet.java +13 -0
  42. package/templates/servlet-jdbc/WEB-INF/classes/JdbcItemServlet.class +0 -0
  43. package/templates/snippets/mongo-queries-cheatsheet.txt +105 -0
  44. package/templates/springboot-2model-aggregation-join/.mvn/wrapper/maven-wrapper.properties +3 -0
  45. package/templates/springboot-2model-aggregation-join/mvnw +295 -0
  46. package/templates/springboot-2model-aggregation-join/mvnw.cmd +189 -0
  47. package/templates/springboot-2model-aggregation-join/pom.xml +54 -0
  48. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/AggregationApplication.java +11 -0
  49. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/controller/DepartmentController.java +65 -0
  50. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/controller/EmployeeController.java +65 -0
  51. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/dto/DepartmentStatsDTO.java +15 -0
  52. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/dto/EmployeeJoinDTO.java +19 -0
  53. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/model/Department.java +20 -0
  54. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/model/Employee.java +21 -0
  55. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/repository/DepartmentRepository.java +9 -0
  56. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/repository/EmployeeRepository.java +9 -0
  57. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/service/DepartmentService.java +81 -0
  58. package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/service/EmployeeService.java +80 -0
  59. package/templates/springboot-2model-aggregation-join/src/main/resources/application.properties +2 -0
  60. package/templates/springboot-2model-aggregation-join/src/test/java/com/example/aggregation/AggregationApplicationTests.java +13 -0
  61. package/templates/vue-2model-crud-patch/README.md +64 -0
  62. package/templates/vue-2model-crud-patch/index.html +12 -0
  63. package/templates/vue-2model-crud-patch/package-lock.json +1785 -0
  64. package/templates/vue-2model-crud-patch/package.json +21 -0
  65. package/templates/vue-2model-crud-patch/src/App.vue +63 -0
  66. package/templates/vue-2model-crud-patch/src/components/AnalyticsBoard.vue +291 -0
  67. package/templates/vue-2model-crud-patch/src/components/DepartmentFormModal.vue +138 -0
  68. package/templates/vue-2model-crud-patch/src/components/DepartmentPatchModal.vue +210 -0
  69. package/templates/vue-2model-crud-patch/src/components/DepartmentTable.vue +133 -0
  70. package/templates/vue-2model-crud-patch/src/components/EmployeeFormModal.vue +177 -0
  71. package/templates/vue-2model-crud-patch/src/components/EmployeePatchModal.vue +221 -0
  72. package/templates/vue-2model-crud-patch/src/components/EmployeeTable.vue +171 -0
  73. package/templates/vue-2model-crud-patch/src/components/NavBar.vue +156 -0
  74. package/templates/vue-2model-crud-patch/src/main.js +12 -0
  75. package/templates/vue-2model-crud-patch/src/router/index.js +33 -0
  76. package/templates/vue-2model-crud-patch/src/services/api.js +64 -0
  77. package/templates/vue-2model-crud-patch/src/stores/departmentStore.js +149 -0
  78. package/templates/vue-2model-crud-patch/src/stores/employeeStore.js +143 -0
  79. package/templates/vue-2model-crud-patch/src/style.css +415 -0
  80. package/templates/vue-2model-crud-patch/src/views/AnalyticsView.vue +59 -0
  81. package/templates/vue-2model-crud-patch/src/views/DepartmentsView.vue +135 -0
  82. package/templates/vue-2model-crud-patch/src/views/EmployeesView.vue +143 -0
  83. package/templates/vue-2model-crud-patch/vite.config.js +9 -0
  84. package/templates/vue-axios/src/App.vue +255 -264
  85. package/templates/vue-axios/src/components/ItemFormModal.vue +183 -0
  86. package/templates/vue-axios/src/components/ItemPatchModal.vue +193 -0
  87. package/templates/vue-axios/src/components/ItemTable.vue +177 -0
  88. package/templates/vue-axios-basic/src/App.vue +241 -429
  89. package/templates/vue-axios-basic/src/components/ItemFormModal.vue +183 -0
  90. package/templates/vue-axios-basic/src/components/ItemPatchModal.vue +193 -0
  91. package/templates/vue-axios-basic/src/components/ItemTable.vue +177 -0
  92. package/templates/vue-axios-pinia/src/App.vue +150 -441
  93. package/templates/vue-axios-pinia/src/components/ItemFormModal.vue +207 -0
  94. package/templates/vue-axios-pinia/src/components/ItemStats.vue +64 -0
  95. package/templates/vue-axios-pinia/src/components/ItemTable.vue +195 -0
  96. package/templates/vue-axios-router/src/App.vue +41 -90
  97. package/templates/vue-axios-router/src/components/ItemFormModal.vue +173 -0
  98. package/templates/vue-axios-router/src/components/ItemTable.vue +102 -0
  99. package/templates/vue-axios-router/src/components/NavBar.vue +57 -0
  100. package/templates/vue-axios-router/src/views/DepartmentView.vue +132 -296
  101. package/templates/vue-axios-router/src/views/EmployeeView.vue +126 -219
  102. package/templates/vue-axios-router-children/src/components/ItemDetail.vue +115 -0
  103. package/templates/vue-axios-router-children/src/components/ItemTable.vue +104 -0
  104. package/templates/vue-axios-router-children/src/components/SideBar.vue +59 -0
  105. package/templates/vue-axios-router-children/src/views/CompanyLayout.vue +2 -51
  106. package/templates/vue-axios-router-children/src/views/DepartmentListView.vue +92 -250
  107. package/templates/vue-axios-router-children/src/views/EmployeeDetailView.vue +59 -181
  108. package/templates/vue-axios-router-children/src/views/EmployeeListView.vue +67 -315
  109. package/templates/vue-axios-router-pinia/src/App.vue +19 -70
  110. package/templates/vue-axios-router-pinia/src/components/ItemFormModal.vue +173 -0
  111. package/templates/vue-axios-router-pinia/src/components/ItemPatchModal.vue +144 -0
  112. package/templates/vue-axios-router-pinia/src/components/ItemTable.vue +102 -0
  113. package/templates/vue-axios-router-pinia/src/components/NavBar.vue +53 -0
  114. package/templates/vue-axios-router-pinia/src/views/DepartmentView.vue +107 -229
  115. package/templates/vue-axios-router-pinia/src/views/EmployeeView.vue +143 -257
  116. package/templates/vue-banking-app/src/components/AccountOverview.vue +75 -0
  117. package/templates/vue-banking-app/src/components/TransactionForm.vue +89 -0
  118. package/templates/vue-banking-app/src/components/TransactionTable.vue +113 -0
  119. package/templates/vue-banking-app/src/stores/bankStore.js +16 -3
  120. package/templates/vue-banking-app/src/views/DashboardView.vue +23 -71
  121. package/templates/vue-banking-app/src/views/StatementView.vue +11 -158
  122. package/templates/vue-banking-app/src/views/TransactionFormView.vue +23 -121
  123. package/templates/vue-basics/src/App.vue +105 -76
  124. package/templates/vue-basics/src/components/CounterCard.vue +107 -0
  125. package/templates/vue-basics/src/components/ItemList.vue +99 -0
  126. package/templates/vue-basics/src/components/UserForm.vue +138 -0
  127. package/templates/vue-cart-router-pinia/src/components/CartSummary.vue +139 -0
  128. package/templates/vue-cart-router-pinia/src/components/CheckoutModal.vue +149 -0
  129. package/templates/vue-cart-router-pinia/src/components/ProductCard.vue +63 -0
  130. package/templates/vue-cart-router-pinia/src/stores/cartStore.js +11 -0
  131. package/templates/vue-cart-router-pinia/src/views/CartView.vue +52 -118
  132. package/templates/vue-cart-router-pinia/src/views/CheckoutView.vue +2 -5
  133. package/templates/vue-cart-router-pinia/src/views/ProductCatalogView.vue +20 -56
  134. package/templates/vue-employee-system/src/App.vue +75 -344
  135. package/templates/vue-employee-system/src/components/DepartmentFilter.vue +108 -0
  136. package/templates/vue-employee-system/src/components/EmployeeModal.vue +183 -0
  137. package/templates/vue-employee-system/src/components/EmployeeTable.vue +91 -0
  138. package/templates/vue-employee-system/src/stores/employeeStore.js +12 -0
  139. package/templates/vue-fetch/src/App.vue +261 -285
  140. package/templates/vue-fetch/src/components/FetchFormModal.vue +183 -0
  141. package/templates/vue-fetch/src/components/FetchPatchModal.vue +193 -0
  142. package/templates/vue-fetch/src/components/FetchTable.vue +177 -0
  143. package/templates/vue-food-ordering/src/components/CartSummary.vue +134 -0
  144. package/templates/vue-food-ordering/src/components/FoodMenu.vue +126 -0
  145. package/templates/vue-food-ordering/src/components/OrderModal.vue +150 -0
  146. package/templates/vue-food-ordering/src/views/MenuView.vue +11 -132
  147. package/templates/vue-food-ordering/src/views/OrderCartView.vue +31 -164
  148. package/templates/vue-game-rps/src/App.vue +29 -88
  149. package/templates/vue-game-tictactoe/src/App.vue +23 -53
  150. package/templates/vue-game-whackamole/src/App.vue +44 -63
  151. package/templates/vue-hospital-portal/src/components/AppointmentForm.vue +144 -0
  152. package/templates/vue-hospital-portal/src/components/DoctorCard.vue +73 -0
  153. package/templates/vue-hospital-portal/src/components/PatientTable.vue +123 -0
  154. package/templates/vue-hospital-portal/src/stores/hospitalStore.js +10 -1
  155. package/templates/vue-hospital-portal/src/views/OPDRegistrationView.vue +40 -416
  156. package/templates/vue-hospital-portal/src/views/PatientListView.vue +11 -301
  157. package/templates/vue-library-system/src/components/BookForm.vue +125 -0
  158. package/templates/vue-library-system/src/components/BookTable.vue +112 -0
  159. package/templates/vue-library-system/src/components/BorrowModal.vue +131 -0
  160. package/templates/vue-library-system/src/stores/libraryStore.js +26 -1
  161. package/templates/vue-library-system/src/views/BookCatalogView.vue +34 -415
  162. package/templates/vue-memory-game/src/App.vue +36 -40
  163. package/templates/vue-memory-game/src/stores/memoryStore.js +32 -37
  164. package/templates/vue-router/src/App.vue +24 -14
  165. package/templates/vue-router/src/components/AboutCard.vue +38 -0
  166. package/templates/vue-router/src/components/HomeHero.vue +75 -0
  167. package/templates/vue-router/src/components/NavBar.vue +54 -0
  168. package/templates/vue-router/src/views/ItemsLayout.vue +17 -9
  169. package/templates/vue-router/src/views/ListView.vue +106 -18
  170. package/templates/vue-router-pinia/src/App.vue +24 -14
  171. package/templates/vue-router-pinia/src/components/ItemFormModal.vue +163 -0
  172. package/templates/vue-router-pinia/src/components/ItemTable.vue +90 -0
  173. package/templates/vue-router-pinia/src/components/NavBar.vue +54 -0
  174. package/templates/vue-router-pinia/src/stores/itemStore.js +8 -1
  175. package/templates/vue-router-pinia/src/views/ListView.vue +78 -14
  176. package/templates/vue-router-pinia-springboot/frontend/src/App.vue +25 -8
  177. package/templates/vue-router-pinia-springboot/frontend/src/components/ItemFormModal.vue +183 -0
  178. package/templates/vue-router-pinia-springboot/frontend/src/components/ItemPatchModal.vue +193 -0
  179. package/templates/vue-router-pinia-springboot/frontend/src/components/ItemTable.vue +177 -0
  180. package/templates/vue-router-pinia-springboot/frontend/src/components/NavBar.vue +54 -0
  181. package/templates/vue-router-pinia-springboot/frontend/src/views/ListView.vue +92 -76
  182. package/templates/vue-springboot-mongo-aggregation/frontend/src/App.vue +184 -193
  183. package/templates/vue-springboot-mongo-aggregation/frontend/src/components/AnalyticsCards.vue +56 -0
  184. package/templates/vue-springboot-mongo-aggregation/frontend/src/components/CategorySummaryTable.vue +71 -0
  185. package/templates/vue-springboot-mongo-aggregation/frontend/src/components/ItemTable.vue +114 -0
  186. package/templates/vue-springboot-mongo-crud/frontend/src/App.vue +228 -158
  187. package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemFormModal.vue +183 -0
  188. package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemPatchModal.vue +193 -0
  189. package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemTable.vue +177 -0
  190. package/templates/vue-symposium-system/src/App.vue +41 -256
  191. package/templates/vue-symposium-system/src/components/AttendeeTable.vue +100 -0
  192. package/templates/vue-symposium-system/src/components/EventCard.vue +67 -0
  193. package/templates/vue-symposium-system/src/components/RegistrationForm.vue +118 -0
  194. package/templates/vue-symposium-system/src/stores/symposiumStore.js +10 -0
  195. package/templates/vue-todo-pinia/src/App.vue +40 -138
  196. package/templates/vue-todo-pinia/src/components/TodoFilter.vue +74 -0
  197. package/templates/vue-todo-pinia/src/components/TodoInput.vue +53 -0
  198. package/templates/vue-todo-pinia/src/components/TodoList.vue +101 -0
  199. package/templates/vue-todo-pinia/src/stores/todoStore.js +6 -0
  200. package/templates/vue-todo-router/src/App.vue +5 -36
  201. package/templates/vue-todo-router/src/components/TodoForm.vue +78 -0
  202. package/templates/vue-todo-router/src/components/TodoList.vue +84 -0
  203. package/templates/vue-todo-router/src/components/TodoNavBar.vue +47 -0
  204. package/templates/vue-todo-router/src/data/todoState.js +7 -0
  205. package/templates/vue-todo-router/src/views/AddTodoView.vue +7 -66
  206. package/templates/vue-todo-router/src/views/TodoDetailView.vue +15 -1
  207. package/templates/vue-todo-router/src/views/TodoListView.vue +22 -64
@@ -1,51 +1,39 @@
1
+ <script setup>
2
+ import { useRpsStore } from './stores/rpsStore'
3
+
4
+ const store = useRpsStore()
5
+ </script>
6
+
1
7
  <template>
2
- <div class="container">
3
- <h1>Vue Rock Paper Scissors</h1>
8
+ <div class="game-container">
9
+ <h1>Rock Paper Scissors</h1>
4
10
 
5
11
  <div class="scoreboard">
6
- <div class="score-card">
7
- <span class="label">Player:</span>
8
- <span class="value">{{ store.playerScore }}</span>
9
- </div>
10
- <div class="score-card">
11
- <span class="label">Computer:</span>
12
- <span class="value">{{ store.computerScore }}</span>
13
- </div>
14
- <div class="score-card">
15
- <span class="label">Ties:</span>
16
- <span class="value">{{ store.ties }}</span>
17
- </div>
12
+ <div>Player: {{ store.playerScore }}</div>
13
+ <div>Computer: {{ store.computerScore }}</div>
14
+ <div>Ties: {{ store.ties }}</div>
18
15
  </div>
19
16
 
20
17
  <div class="choices">
21
- <button @click="store.playRound('Rock')">✊ Rock</button>
22
- <button @click="store.playRound('Paper')">✋ Paper</button>
23
- <button @click="store.playRound('Scissors')">✌ Scissors</button>
18
+ <button @click="store.playRound('Rock')">Rock</button>
19
+ <button @click="store.playRound('Paper')">Paper</button>
20
+ <button @click="store.playRound('Scissors')">Scissors</button>
24
21
  </div>
25
22
 
26
- <div class="results">
27
- <div v-if="store.playerChoice && store.computerChoice" class="matchup">
28
- <p>Player: <strong>{{ store.playerChoice }}</strong></p>
29
- <p>Computer: <strong>{{ store.computerChoice }}</strong></p>
30
- </div>
31
- <p class="message">{{ store.resultMessage }}</p>
23
+ <div class="round-result" v-if="store.lastResult">
24
+ <p>You chose: <strong>{{ store.playerChoice }}</strong></p>
25
+ <p>Computer chose: <strong>{{ store.computerChoice }}</strong></p>
26
+ <h2>{{ store.lastResult }}</h2>
32
27
  </div>
33
28
 
34
29
  <button class="reset-btn" @click="store.resetGame">Reset Game</button>
35
30
  </div>
36
31
  </template>
37
32
 
38
- <script setup>
39
- import { useRpsStore } from './stores/rpsStore'
40
-
41
- const store = useRpsStore()
42
- </script>
43
-
44
33
  <style scoped>
45
- .container {
46
- max-width: 500px;
47
- margin: 40px auto;
48
- padding: 20px;
34
+ .game-container {
35
+ max-width: 450px;
36
+ margin: 30px auto;
49
37
  text-align: center;
50
38
  font-family: Arial, sans-serif;
51
39
  }
@@ -54,72 +42,25 @@ const store = useRpsStore()
54
42
  display: flex;
55
43
  justify-content: space-around;
56
44
  margin: 20px 0;
57
- padding: 12px;
58
- background: #f0f0f0;
59
- border-radius: 6px;
60
- }
61
-
62
- .score-card {
63
- display: flex;
64
- flex-direction: column;
65
- gap: 4px;
66
- }
67
-
68
- .label {
69
45
  font-weight: bold;
70
46
  }
71
47
 
72
- .value {
73
- font-size: 1.4rem;
74
- }
75
-
76
- .choices {
77
- display: flex;
78
- justify-content: center;
79
- gap: 12px;
80
- margin: 20px 0;
81
- }
82
-
83
- button {
48
+ .choices button {
49
+ font-size: 18px;
84
50
  padding: 10px 16px;
85
- font-size: 1rem;
51
+ margin: 0 8px;
86
52
  cursor: pointer;
87
- border: 1px solid #ccc;
88
- border-radius: 4px;
89
- background: #fff;
90
53
  }
91
54
 
92
- button:hover {
93
- background: #e9e9e9;
94
- }
95
-
96
- .results {
55
+ .round-result {
97
56
  margin: 20px 0;
98
- padding: 15px;
57
+ padding: 10px;
99
58
  border: 1px solid #ddd;
100
- border-radius: 6px;
101
- background: #fafafa;
102
- }
103
-
104
- .matchup {
105
- display: flex;
106
- justify-content: space-around;
107
- margin-bottom: 10px;
108
- }
109
-
110
- .message {
111
- font-size: 1.2rem;
112
- font-weight: bold;
113
- margin: 5px 0 0;
114
59
  }
115
60
 
116
61
  .reset-btn {
117
- background: #e74c3c;
118
- color: #fff;
119
- border: none;
120
- }
121
-
122
- .reset-btn:hover {
123
- background: #c0392b;
62
+ margin-top: 15px;
63
+ padding: 8px 16px;
64
+ cursor: pointer;
124
65
  }
125
66
  </style>
@@ -6,100 +6,70 @@ const store = useTicTacToeStore()
6
6
 
7
7
  <template>
8
8
  <div class="game-container">
9
- <h1>Vue Tic Tac Toe</h1>
9
+ <h1>Tic Tac Toe</h1>
10
10
 
11
- <div class="status">
12
- <span v-if="store.winner">Player {{ store.winner }} Wins! 🎉</span>
13
- <span v-else-if="store.isDraw">Game Draw! 🤝</span>
14
- <span v-else>Player {{ store.currentPlayer }}'s Turn</span>
11
+ <div class="status-msg">
12
+ <span v-if="store.winner">Player {{ store.winner }} Wins!</span>
13
+ <span v-else-if="store.isDraw">Game Draw!</span>
14
+ <span v-else>Turn: Player {{ store.currentPlayer }}</span>
15
15
  </div>
16
16
 
17
17
  <div class="board">
18
18
  <button
19
19
  v-for="(cell, index) in store.board"
20
20
  :key="index"
21
- type="button"
22
21
  class="cell"
23
- :disabled="cell !== '' || !!store.winner || store.isDraw"
22
+ :disabled="cell !== null || store.winner !== null"
24
23
  @click="store.makeMove(index)"
25
24
  >
26
25
  {{ cell }}
27
26
  </button>
28
27
  </div>
29
28
 
30
- <button type="button" class="btn-reset" @click="store.resetBoard">Reset Game</button>
29
+ <button class="reset-btn" @click="store.resetGame">Restart Game</button>
31
30
  </div>
32
31
  </template>
33
32
 
34
- <style>
35
- body {
36
- font-family: Arial, sans-serif;
37
- display: flex;
38
- justify-content: center;
39
- align-items: center;
40
- min-height: 100vh;
41
- margin: 0;
42
- background-color: #f5f5f5;
43
- }
44
-
33
+ <style scoped>
45
34
  .game-container {
35
+ max-width: 320px;
36
+ margin: 40px auto;
46
37
  text-align: center;
47
- background: #ffffff;
48
- padding: 30px;
49
- border: 1px solid #ccc;
50
- border-radius: 8px;
51
- }
52
-
53
- h1 {
54
- margin-top: 0;
38
+ font-family: Arial, sans-serif;
55
39
  }
56
40
 
57
- .status {
58
- margin: 15px 0;
41
+ .status-msg {
59
42
  font-size: 20px;
60
43
  font-weight: bold;
44
+ margin-bottom: 20px;
61
45
  }
62
46
 
63
47
  .board {
64
48
  display: grid;
65
- grid-template-columns: repeat(3, 80px);
49
+ grid-template-columns: repeat(3, 1fr);
66
50
  gap: 8px;
67
- margin: 20px auto;
68
- width: 256px;
51
+ background-color: #333;
52
+ padding: 8px;
53
+ border-radius: 8px;
69
54
  }
70
55
 
71
56
  .cell {
72
- width: 80px;
73
- height: 80px;
74
- background-color: #f9f9f9;
75
- border: 2px solid #555;
57
+ height: 90px;
76
58
  font-size: 36px;
77
59
  font-weight: bold;
60
+ background-color: #fff;
61
+ border: none;
78
62
  cursor: pointer;
79
- display: flex;
80
- justify-content: center;
81
- align-items: center;
82
- }
83
-
84
- .cell:hover:not(:disabled) {
85
- background-color: #eee;
86
63
  }
87
64
 
88
65
  .cell:disabled {
89
66
  cursor: not-allowed;
90
67
  }
91
68
 
92
- .btn-reset {
93
- padding: 10px 20px;
69
+ .reset-btn {
70
+ margin-top: 20px;
71
+ padding: 8px 16px;
94
72
  font-size: 16px;
95
- background-color: #333;
96
- color: white;
97
- border: none;
98
- border-radius: 4px;
99
73
  cursor: pointer;
100
74
  }
101
-
102
- .btn-reset:hover {
103
- background-color: #555;
104
- }
105
75
  </style>
@@ -1,85 +1,52 @@
1
+ <script setup>
2
+ import { useMoleStore } from './stores/moleStore'
3
+
4
+ const store = useMoleStore()
5
+ </script>
6
+
1
7
  <template>
2
8
  <div class="game-container">
3
- <h1>Vue Whack A Mole</h1>
9
+ <h1>Whack A Mole</h1>
4
10
 
5
- <div class="status-bar">
6
- <span>Score: {{ store.score }}</span>
7
- <span>Time Left: {{ store.timeLeft }}s</span>
11
+ <div class="info-bar">
12
+ <div>Score: {{ store.score }}</div>
13
+ <div>Time Left: {{ store.timeLeft }}s</div>
8
14
  </div>
9
15
 
10
- <button class="start-btn" :disabled="store.isPlaying" @click="store.startGame()">
11
- Start Game
12
- </button>
13
-
14
16
  <div class="grid">
15
17
  <div
16
- v-for="i in 9"
17
- :key="i - 1"
18
+ v-for="i in store.holeCount"
19
+ :key="i"
18
20
  class="hole"
19
- @click="store.whackMole(i - 1)"
21
+ @click="store.whack(i - 1)"
20
22
  >
21
- <span v-if="store.activeHoleIndex === i - 1" class="mole">🐹</span>
23
+ <span v-if="store.activeHoleIndex === i - 1" class="mole">[TARGET]</span>
22
24
  </div>
23
25
  </div>
26
+
27
+ <div class="controls">
28
+ <button v-if="!store.isPlaying" @click="store.startGame">Start Game</button>
29
+ <button v-else @click="store.stopGame">Stop Game</button>
30
+ </div>
24
31
  </div>
25
32
  </template>
26
33
 
27
- <script setup>
28
- import { useMoleStore } from './stores/moleStore'
29
-
30
- const store = useMoleStore()
31
- </script>
32
-
33
- <style>
34
- body {
35
- margin: 0;
36
- font-family: sans-serif;
37
- display: flex;
38
- justify-content: center;
39
- align-items: center;
40
- min-height: 100vh;
41
- background-color: #f0f2f5;
42
- }
43
-
34
+ <style scoped>
44
35
  .game-container {
36
+ max-width: 360px;
37
+ margin: 30px auto;
45
38
  text-align: center;
46
- background: #ffffff;
47
- padding: 24px;
48
- border-radius: 12px;
49
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
50
- width: 320px;
51
- }
52
-
53
- h1 {
54
- margin-top: 0;
55
- margin-bottom: 16px;
56
- font-size: 24px;
39
+ font-family: Arial, sans-serif;
57
40
  }
58
41
 
59
- .status-bar {
42
+ .info-bar {
60
43
  display: flex;
61
44
  justify-content: space-between;
62
- margin-bottom: 16px;
63
- font-size: 16px;
45
+ font-size: 18px;
64
46
  font-weight: bold;
65
- }
66
-
67
- .start-btn {
68
- padding: 10px 20px;
69
- font-size: 16px;
70
- background-color: #42b883;
71
- color: white;
72
- border: none;
73
- border-radius: 6px;
74
- cursor: pointer;
75
47
  margin-bottom: 20px;
76
48
  }
77
49
 
78
- .start-btn:disabled {
79
- background-color: #a8d5c2;
80
- cursor: not-allowed;
81
- }
82
-
83
50
  .grid {
84
51
  display: grid;
85
52
  grid-template-columns: repeat(3, 1fr);
@@ -87,18 +54,32 @@ h1 {
87
54
  }
88
55
 
89
56
  .hole {
90
- width: 80px;
91
- height: 80px;
57
+ height: 90px;
92
58
  background-color: #795548;
93
59
  border-radius: 50%;
94
60
  display: flex;
95
- justify-content: center;
96
61
  align-items: center;
62
+ justify-content: center;
97
63
  cursor: pointer;
98
- user-select: none;
99
64
  }
100
65
 
101
66
  .mole {
102
- font-size: 40px;
67
+ font-size: 16px;
68
+ font-weight: bold;
69
+ color: #fff;
70
+ background: #d97706;
71
+ padding: 4px 8px;
72
+ border-radius: 4px;
73
+ user-select: none;
74
+ }
75
+
76
+ .controls {
77
+ margin-top: 20px;
78
+ }
79
+
80
+ .controls button {
81
+ padding: 10px 20px;
82
+ font-size: 16px;
83
+ cursor: pointer;
103
84
  }
104
85
  </style>
@@ -0,0 +1,144 @@
1
+ <script setup>
2
+ import { reactive } from 'vue'
3
+
4
+ const props = defineProps({
5
+ doctors: { type: Array, required: true }
6
+ })
7
+
8
+ const emit = defineEmits(['submit-patient'])
9
+
10
+ const form = reactive({
11
+ name: '',
12
+ age: '',
13
+ doctor: props.doctors[0]?.name || '',
14
+ bedType: 'General Ward',
15
+ bp: '120/80',
16
+ hr: 75,
17
+ temp: 98.6
18
+ })
19
+
20
+ function handleSubmit() {
21
+ if (!form.name.trim() || !form.age) return
22
+ emit('submit-patient', {
23
+ name: form.name.trim(),
24
+ age: Number(form.age),
25
+ doctor: form.doctor,
26
+ bedType: form.bedType,
27
+ vitals: {
28
+ bp: form.bp,
29
+ hr: Number(form.hr),
30
+ temp: Number(form.temp)
31
+ }
32
+ })
33
+ form.name = ''
34
+ form.age = ''
35
+ }
36
+ </script>
37
+
38
+ <template>
39
+ <form @submit.prevent="handleSubmit" class="appt-form">
40
+ <h3>Patient Admission / OPD Registration</h3>
41
+
42
+ <div class="form-row">
43
+ <div class="form-group">
44
+ <label for="p-name">Patient Name</label>
45
+ <input id="p-name" v-model="form.name" required placeholder="Full Name" />
46
+ </div>
47
+ <div class="form-group">
48
+ <label for="p-age">Age</label>
49
+ <input id="p-age" v-model.number="form.age" type="number" min="1" max="120" required placeholder="Age" />
50
+ </div>
51
+ </div>
52
+
53
+ <div class="form-row">
54
+ <div class="form-group">
55
+ <label for="p-doc">Doctor</label>
56
+ <select id="p-doc" v-model="form.doctor">
57
+ <option v-for="d in doctors" :key="d.id" :value="d.name">{{ d.name }} ({{ d.specialty }})</option>
58
+ </select>
59
+ </div>
60
+ <div class="form-group">
61
+ <label for="p-bed">Bed Type</label>
62
+ <select id="p-bed" v-model="form.bedType">
63
+ <option value="General Ward">General Ward</option>
64
+ <option value="Semi-Private">Semi-Private</option>
65
+ <option value="Private Deluxe">Private Deluxe</option>
66
+ <option value="ICU">ICU</option>
67
+ </select>
68
+ </div>
69
+ </div>
70
+
71
+ <div class="vitals-row">
72
+ <div class="form-group">
73
+ <label for="p-bp">BP</label>
74
+ <input id="p-bp" v-model="form.bp" placeholder="120/80" />
75
+ </div>
76
+ <div class="form-group">
77
+ <label for="p-hr">Heart Rate</label>
78
+ <input id="p-hr" v-model.number="form.hr" type="number" placeholder="75" />
79
+ </div>
80
+ <div class="form-group">
81
+ <label for="p-temp">Temp (F)</label>
82
+ <input id="p-temp" v-model.number="form.temp" type="number" step="0.1" placeholder="98.6" />
83
+ </div>
84
+ </div>
85
+
86
+ <button type="submit" class="btn btn-primary">Admit / Register</button>
87
+ </form>
88
+ </template>
89
+
90
+ <style scoped>
91
+ .appt-form {
92
+ background: #ffffff;
93
+ border: 1px solid #e2e8f0;
94
+ border-radius: 8px;
95
+ padding: 20px;
96
+ display: flex;
97
+ flex-direction: column;
98
+ gap: 12px;
99
+ }
100
+
101
+ .appt-form h3 {
102
+ font-size: 16px;
103
+ margin-bottom: 4px;
104
+ }
105
+
106
+ .form-row, .vitals-row {
107
+ display: flex;
108
+ gap: 12px;
109
+ flex-wrap: wrap;
110
+ }
111
+
112
+ .form-group {
113
+ flex: 1;
114
+ min-width: 140px;
115
+ display: flex;
116
+ flex-direction: column;
117
+ gap: 4px;
118
+ }
119
+
120
+ .form-group label {
121
+ font-size: 12px;
122
+ font-weight: 600;
123
+ color: #475569;
124
+ }
125
+
126
+ .form-group input,
127
+ .form-group select {
128
+ padding: 8px 10px;
129
+ border: 1px solid #cbd5e1;
130
+ border-radius: 6px;
131
+ font-size: 13px;
132
+ }
133
+
134
+ .btn-primary {
135
+ background: #0284c7;
136
+ color: #fff;
137
+ border: none;
138
+ padding: 10px;
139
+ border-radius: 6px;
140
+ cursor: pointer;
141
+ font-weight: 500;
142
+ margin-top: 6px;
143
+ }
144
+ </style>
@@ -0,0 +1,73 @@
1
+ <script setup>
2
+ defineProps({
3
+ doctor: { type: Object, required: true }
4
+ })
5
+
6
+ const emit = defineEmits(['book'])
7
+ </script>
8
+
9
+ <template>
10
+ <div class="doctor-card">
11
+ <h3>{{ doctor.name }}</h3>
12
+ <p class="specialty">{{ doctor.specialty }}</p>
13
+ <div class="doc-meta">
14
+ <span>Fee: ${{ doctor.fee }}</span>
15
+ <span>Slots: {{ doctor.availableSlots }}</span>
16
+ </div>
17
+ <button
18
+ type="button"
19
+ class="btn btn-book"
20
+ :disabled="doctor.availableSlots <= 0"
21
+ @click="emit('book', doctor.id)"
22
+ >
23
+ {{ doctor.availableSlots > 0 ? 'Book Consultation' : 'Fully Booked' }}
24
+ </button>
25
+ </div>
26
+ </template>
27
+
28
+ <style scoped>
29
+ .doctor-card {
30
+ background: #ffffff;
31
+ border: 1px solid #e2e8f0;
32
+ border-radius: 8px;
33
+ padding: 16px;
34
+ display: flex;
35
+ flex-direction: column;
36
+ gap: 6px;
37
+ }
38
+
39
+ .doctor-card h3 {
40
+ font-size: 16px;
41
+ margin: 0;
42
+ color: #1e293b;
43
+ }
44
+
45
+ .specialty {
46
+ font-size: 13px;
47
+ color: #64748b;
48
+ margin: 0;
49
+ }
50
+
51
+ .doc-meta {
52
+ display: flex;
53
+ justify-content: space-between;
54
+ font-size: 13px;
55
+ font-weight: 600;
56
+ margin: 8px 0;
57
+ }
58
+
59
+ .btn-book {
60
+ padding: 8px 12px;
61
+ background: #0284c7;
62
+ color: #fff;
63
+ border: none;
64
+ border-radius: 6px;
65
+ cursor: pointer;
66
+ font-size: 13px;
67
+ }
68
+
69
+ .btn-book:disabled {
70
+ background: #cbd5e1;
71
+ cursor: not-allowed;
72
+ }
73
+ </style>