diff --git a/te.css b/te.css index f1ebbc1..ebc07e4 100644 --- a/te.css +++ b/te.css @@ -1,7 +1,4 @@ - body { - font-family: Arial, sans-serif; - line-height: 1.6; margin: 0; padding: 0; background-color: #f4f4f4; @@ -10,7 +7,6 @@ .container { width: 80%; margin: auto; - overflow: hidden; padding: 20px; } @@ -43,7 +39,6 @@ } ul { - list-style-type: none; padding: 0; } diff --git a/tentative.css b/tentative.css new file mode 100644 index 0000000..6248b7b --- /dev/null +++ b/tentative.css @@ -0,0 +1,56 @@ +body { + line-height: 1.6; + margin: 0; + padding: 0; + background-color: #f4f4f4; +} + +.container { + width: 80%; + margin: auto; + padding: 20px; +} + +h1 { + text-align: center; + color: #333; +} + +form { + display: flex; + flex-direction: column; + margin-bottom: 20px; +} + +input[type="text"], input[type="date"] { + padding: 10px; + margin-bottom: 10px; +} + +button { + background: #333; + color: #fff; + border: none; + padding: 10px 20px; + cursor: pointer; +} + +button:hover { + background: #555; +} + +ul { + list-style-type: none; + padding: 0; +} + +li { + background: #fff; + border: 1px solid #ddd; + margin-bottom: 5px; + padding: 10px; +} + +.expired { + background-color: #ffcccc; +} \ No newline at end of file diff --git a/tentative.html b/tentative.html new file mode 100644 index 0000000..1feef21 --- /dev/null +++ b/tentative.html @@ -0,0 +1,21 @@ + + + + + + 賞味期限チェックリスト + + + +
+

賞味期限チェックリスト

+
+ + + +
+ +
+ + + diff --git a/tentative.js b/tentative.js new file mode 100644 index 0000000..89f96fa --- /dev/null +++ b/tentative.js @@ -0,0 +1,26 @@ +document.addEventListener('DOMContentLoaded', () => { + const form = document.getElementById('item-form'); + const itemList = document.getElementById('item-list'); + + form.addEventListener('submit', (e) => { + e.preventDefault(); + + const itemName = document.getElementById('item-name').value; + const expiryDate = document.getElementById('expiry-date').value; + + const li = document.createElement('li'); + li.innerHTML = `${itemName} - 賞味期限: ${expiryDate}`; + + // 賞味期限チェック + const today = new Date(); + const expiry = new Date(expiryDate); + + if (expiry < today) { + li.classList.add('expired'); + } + + itemList.appendChild(li); + + form.reset(); + }); +}); \ No newline at end of file