]> git repositories - simple-cash-register.git/commitdiff
initialize project
authorbochard <mail@tenkyuu.dev>
Thu, 27 Feb 2025 12:05:44 +0000 (20:05 +0800)
committerbochard <mail@tenkyuu.dev>
Thu, 27 Feb 2025 12:05:44 +0000 (20:05 +0800)
README.md [new file with mode: 0644]
index.css [new file with mode: 0644]
index.html [new file with mode: 0644]
index.js [new file with mode: 0644]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..182d2c8
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+### simple cash register
\ No newline at end of file
diff --git a/index.css b/index.css
new file mode 100644 (file)
index 0000000..79d3918
--- /dev/null
+++ b/index.css
@@ -0,0 +1,37 @@
+*,
+::before,
+::after {
+  box-sizing: border-box;
+  margin: 0;
+  padding: 0;
+}
+html {
+  font-size: 62.5%;
+}
+body {
+  font-size: 2rem;
+}
+.cash-register-screen {
+  padding: 1rem;
+  border: 1px solid black;
+}
+.product-list {
+  display: flex;
+  flex-direction: column;
+  gap: 1rem;
+  padding: 1rem;
+  border: 1px solid black;
+}
+.product-wrapper {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 1rem;
+  border: 1px solid black;
+}
+.quantity-controls {
+  display: flex;
+  align-items: center;
+  gap: 1rem;
+  padding: 0.5rem;
+}
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644 (file)
index 0000000..7b47696
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Digital Cash Register</title>
+    <link rel="stylesheet" href="./styles.css">
+  </head>
+  <body>
+    <div class="customer-input-ctn">
+      <label for="cash">Enter your cash here:</label>
+      <input type="number" id="cash" min="0">
+      <button id="purchase-btn">Purchase</button>
+    </div>
+    
+    <div class="cash-register">
+      <div class="cash-register-screen">
+        <div class="price-indicator">Total: <span id="total-price">$0.00</span></div>
+        <div id="change-due"></div>
+      </div>
+
+      <div class="product-list">
+        <div class="product-wrapper">
+          <p class="product-name">Water <span id="price-tag">$1.00</span></p>
+          <div class="quantity-controls">
+            <button class="minus-btn">-</button>
+            <p class="product-quantity">0</p>
+            <button class="plus-btn">+</button>
+          </div>
+        </div>
+        <div class="product-wrapper">
+          <p class="product-name">Bread <span id="price-tag">$2.50</span></p>
+          <div class="quantity-controls">
+            <button class="minus-btn">-</button>
+            <p class="product-quantity">0</p>
+            <button class="plus-btn">+</button>
+          </div>
+        </div>
+      </div>
+
+      <div id="change-drawer"></div>
+    </div>
+
+    <script src="./script.js"></script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100644 (file)
index 0000000..e69de29