forked from next-step/js-vending-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
155 lines (153 loc) · 5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="src/css/index.css" />
<title>NEXTSTEP JavaScript Vending machine</title>
<script type="module" src="./src/js/index.js" defer></script>
</head>
<body>
<div id="view-state-tabs-container">
<button id="product-manage-menu" data-testid="manageProductTab">상품 관리</button>
<button id="vending-machine-manage-menu" data-testid="chargeChangeTab">잔돈충전</button>
<button id="product-purchase-menu" data-testid="purchaseProductTab">상품 구매</button>
</div>
<div id="app">
<div id="new-product-form-container" data-testid="productsContainer">
<h3>상품 추가하기</h3>
<form class="product-container" data-testid="newProductForm">
<input type="text" id="product-name-input" placeholder="상품명" data-testid="productNameInput" />
<input type="number" id="product-price-input" placeholder="가격" data-testid="productPriceInput" />
<input type="number" id="product-quantity-input" placeholder="수량" data-testid="productQuantityInput" />
<button type="submit" id="product-add-button" data-testid="productAddButton">추가하기</button>
</form>
<table class="product-inventory" data-testid="products">
<colgroup>
<col style="width: 140px" />
<col style="width: 100px" />
<col style="width: 100px" />
</colgroup>
<thead id="productTable" data-testid="productTable">
<tr>
<th>상품명</th>
<th>가격</th>
<th>수량</th>
</tr>
</thead>
<tbody id="product-inventory-container" data-testid="productInventoryContainer">
<!-- <tr>-->
<!-- <th>상품명</th>-->
<!-- <th>가격</th>-->
<!-- <th>수량</th>-->
<!-- </tr>-->
</tbody>
</table>
</div>
<div id="charge-form-container" data-testid="chargeCoinContainer">
<h3>자판기 돈통 충전하기</h3>
<form class="vending-machine-wrapper">
<input type="number" name="vending-machine-charge-amount" id="vending-machine-charge-input" autofocus data-testid="chargeAmount" />
<button type='submit' id="vending-machine-charge-button" data-testid="chargeButton">충전하기</button>
</form>
<p>보유 금액: <span id="vending-machine-charge-amount" data-testid="chargedAmount">0</span>원</p>
<h3>동전 보유 현황</h3>
<table class="cashbox-remaining">
<colgroup>
<col />
<col />
</colgroup>
<thead>
<tr>
<th>동전</th>
<th>개수</th>
</tr>
</thead>
<tbody>
<tr>
<td>500원</td>
<td id="vending-machine-coin-500-quantity" data-testid="coinQuantity500"></td>
</tr>
<tr>
<td>100원</td>
<td id="vending-machine-coin-100-quantity" data-testid="coinQuantity100"></td>
</tr>
<tr>
<td>50원</td>
<td id="vending-machine-coin-50-quantity" data-testid="coinQuantity50"></td>
</tr>
<tr>
<td>10원</td>
<td id="vending-machine-coin-10-quantity" data-testid="coinQuantity10"></td>
</tr>
</tbody>
</table>
</div>
<div id="insert-money" data-testid="chargeMoneyContainer">
<div class="purchase-container">
<h3>충전하기</h3>
<form class="vending-machine-wrapper">
<input type="number" name="charge-amount" id="charge-input" data-testid="chargeInput"/>
<button type='submit' id="charge-button" data-testid="chargeMoneyButton">충전하기</button>
</form>
<p>충전 금액: <span id="charge-amount" data-testid="insertedAmount">0</span>원</p>
</div>
</div>
<div id="purchasable-container" data-testid="purchasableContainer">
<table class="purchasable-inventory-table">
<colgroup>
<col style="width: 140px" />
<col style="width: 100px" />
<col style="width: 100px" />
<col style="width: 120px" />
</colgroup>
<thead>
<tr>
<th>상품명</th>
<th>가격</th>
<th>수량</th>
<th>구매</th>
</tr>
</thead>
<tbody id="purchasable-inventory" data-testid="purchasableInventory">
</tbody>
</table>
</div>
<div id="coin-return-container" data-testid="coinReturnContainer">
<h3>잔돈</h3>
<button id="coin-return-button" data-testid="coinReturnButton">반환하기</button>
<table class="cashbox-change">
<colgroup>
<col />
<col />
</colgroup>
<thead>
<tr>
<th>동전</th>
<th>개수</th>
</tr>
</thead>
<tbody>
<tr>
<td>500원</td>
<td><span id="return-coin-500-quantity"></span>원</td>
</tr>
<tr>
<td>100원</td>
<td><span id="return-coin-100-quantity"></span>원</td>
</tr>
<tr>
<td>50원</td>
<td><span id="return-coin-50-quantity"></span>원</td>
</tr>
<tr>
<td>10원</td>
<td><span id="return-coin-10-quantity"></span>원</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>