Add 3 files
Browse files- README.md +7 -5
- index.html +354 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: kitchen
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: yellow
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,354 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Kitchen Stock - Track Out-of-Stock Items</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Poppins', sans-serif;
|
| 14 |
+
background-color: #f8fafc;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
.gradient-bg {
|
| 18 |
+
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
.item-card {
|
| 22 |
+
transition: all 0.3s ease;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.item-card:hover {
|
| 26 |
+
transform: translateY(-2px);
|
| 27 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
.pulse {
|
| 31 |
+
animation: pulse 2s infinite;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
@keyframes pulse {
|
| 35 |
+
0% {
|
| 36 |
+
transform: scale(0.95);
|
| 37 |
+
box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
|
| 38 |
+
}
|
| 39 |
+
70% {
|
| 40 |
+
transform: scale(1);
|
| 41 |
+
box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
|
| 42 |
+
}
|
| 43 |
+
100% {
|
| 44 |
+
transform: scale(0.95);
|
| 45 |
+
box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
</style>
|
| 49 |
+
</head>
|
| 50 |
+
<body class="min-h-screen gradient-bg">
|
| 51 |
+
<div class="container mx-auto px-4 py-8">
|
| 52 |
+
<!-- Header -->
|
| 53 |
+
<header class="flex justify-between items-center mb-8">
|
| 54 |
+
<div class="flex items-center">
|
| 55 |
+
<div class="w-12 h-12 rounded-full bg-white shadow-md flex items-center justify-center mr-4">
|
| 56 |
+
<i class="fas fa-utensils text-2xl text-emerald-500"></i>
|
| 57 |
+
</div>
|
| 58 |
+
<h1 class="text-3xl font-bold text-gray-800">Kitchen Stock</h1>
|
| 59 |
+
</div>
|
| 60 |
+
<button id="addItemBtn" class="bg-emerald-500 hover:bg-emerald-600 text-white px-6 py-2 rounded-full shadow-md flex items-center transition-all">
|
| 61 |
+
<i class="fas fa-plus mr-2"></i> Add Item
|
| 62 |
+
</button>
|
| 63 |
+
</header>
|
| 64 |
+
|
| 65 |
+
<!-- Stats Cards -->
|
| 66 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
|
| 67 |
+
<div class="bg-white rounded-xl shadow-md p-6">
|
| 68 |
+
<div class="flex items-center">
|
| 69 |
+
<div class="p-3 rounded-full bg-emerald-100 text-emerald-600 mr-4">
|
| 70 |
+
<i class="fas fa-box-open text-xl"></i>
|
| 71 |
+
</div>
|
| 72 |
+
<div>
|
| 73 |
+
<p class="text-gray-500 text-sm">Out of Stock</p>
|
| 74 |
+
<h3 class="text-2xl font-bold" id="outOfStockCount">0</h3>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
</div>
|
| 78 |
+
<div class="bg-white rounded-xl shadow-md p-6">
|
| 79 |
+
<div class="flex items-center">
|
| 80 |
+
<div class="p-3 rounded-full bg-blue-100 text-blue-600 mr-4">
|
| 81 |
+
<i class="fas fa-list text-xl"></i>
|
| 82 |
+
</div>
|
| 83 |
+
<div>
|
| 84 |
+
<p class="text-gray-500 text-sm">Total Items</p>
|
| 85 |
+
<h3 class="text-2xl font-bold" id="totalItemsCount">0</h3>
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
<div class="bg-white rounded-xl shadow-md p-6">
|
| 90 |
+
<div class="flex items-center">
|
| 91 |
+
<div class="p-3 rounded-full bg-purple-100 text-purple-600 mr-4">
|
| 92 |
+
<i class="fas fa-history text-xl"></i>
|
| 93 |
+
</div>
|
| 94 |
+
<div>
|
| 95 |
+
<p class="text-gray-500 text-sm">Recently Added</p>
|
| 96 |
+
<h3 class="text-2xl font-bold" id="recentItemsCount">0</h3>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
|
| 102 |
+
<!-- Main Content -->
|
| 103 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden">
|
| 104 |
+
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
|
| 105 |
+
<h2 class="text-xl font-semibold text-gray-800">Out of Stock Items</h2>
|
| 106 |
+
<div class="relative">
|
| 107 |
+
<input type="text" id="searchInput" placeholder="Search items..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-full focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-transparent">
|
| 108 |
+
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<div class="p-4" id="itemsContainer">
|
| 113 |
+
<!-- Empty state -->
|
| 114 |
+
<div id="emptyState" class="text-center py-12">
|
| 115 |
+
<div class="w-24 h-24 mx-auto mb-4 rounded-full bg-gray-100 flex items-center justify-center">
|
| 116 |
+
<i class="fas fa-box-open text-3xl text-gray-400"></i>
|
| 117 |
+
</div>
|
| 118 |
+
<h3 class="text-xl font-medium text-gray-700 mb-2">No out-of-stock items</h3>
|
| 119 |
+
<p class="text-gray-500 mb-6">Add items that are out of stock to keep track</p>
|
| 120 |
+
<button id="addFirstItemBtn" class="bg-emerald-500 hover:bg-emerald-600 text-white px-6 py-2 rounded-full shadow-md inline-flex items-center transition-all">
|
| 121 |
+
<i class="fas fa-plus mr-2"></i> Add Your First Item
|
| 122 |
+
</button>
|
| 123 |
+
</div>
|
| 124 |
+
|
| 125 |
+
<!-- Items will be added here dynamically -->
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
</div>
|
| 129 |
+
|
| 130 |
+
<!-- Add Item Modal -->
|
| 131 |
+
<div id="addItemModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 132 |
+
<div class="bg-white rounded-xl shadow-xl w-full max-w-md mx-4">
|
| 133 |
+
<div class="p-6">
|
| 134 |
+
<div class="flex justify-between items-center mb-4">
|
| 135 |
+
<h3 class="text-xl font-bold text-gray-800">Add Out-of-Stock Item</h3>
|
| 136 |
+
<button id="closeModalBtn" class="text-gray-500 hover:text-gray-700">
|
| 137 |
+
<i class="fas fa-times"></i>
|
| 138 |
+
</button>
|
| 139 |
+
</div>
|
| 140 |
+
|
| 141 |
+
<form id="addItemForm">
|
| 142 |
+
<div class="mb-4">
|
| 143 |
+
<label for="itemName" class="block text-sm font-medium text-gray-700 mb-1">Item Name</label>
|
| 144 |
+
<input type="text" id="itemName" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-transparent" placeholder="e.g. Milk, Eggs, Bread" required>
|
| 145 |
+
</div>
|
| 146 |
+
|
| 147 |
+
<div class="mb-4">
|
| 148 |
+
<label for="itemCategory" class="block text-sm font-medium text-gray-700 mb-1">Category</label>
|
| 149 |
+
<select id="itemCategory" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-transparent">
|
| 150 |
+
<option value="Dairy">Dairy</option>
|
| 151 |
+
<option value="Produce">Produce</option>
|
| 152 |
+
<option value="Pantry">Pantry</option>
|
| 153 |
+
<option value="Meat">Meat</option>
|
| 154 |
+
<option value="Beverages">Beverages</option>
|
| 155 |
+
<option value="Frozen">Frozen</option>
|
| 156 |
+
<option value="Other">Other</option>
|
| 157 |
+
</select>
|
| 158 |
+
</div>
|
| 159 |
+
|
| 160 |
+
<div class="mb-4">
|
| 161 |
+
<label for="itemNotes" class="block text-sm font-medium text-gray-700 mb-1">Notes (Optional)</label>
|
| 162 |
+
<textarea id="itemNotes" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-transparent" placeholder="Any specific details..."></textarea>
|
| 163 |
+
</div>
|
| 164 |
+
|
| 165 |
+
<div class="flex justify-end space-x-3">
|
| 166 |
+
<button type="button" id="cancelAddBtn" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-all">
|
| 167 |
+
Cancel
|
| 168 |
+
</button>
|
| 169 |
+
<button type="submit" class="px-6 py-2 bg-emerald-500 hover:bg-emerald-600 text-white rounded-lg shadow-md transition-all flex items-center">
|
| 170 |
+
<i class="fas fa-save mr-2"></i> Save Item
|
| 171 |
+
</button>
|
| 172 |
+
</div>
|
| 173 |
+
</form>
|
| 174 |
+
</div>
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<!-- Restock Confirmation Modal -->
|
| 179 |
+
<div id="restockModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 180 |
+
<div class="bg-white rounded-xl shadow-xl w-full max-w-md mx-4">
|
| 181 |
+
<div class="p-6">
|
| 182 |
+
<div class="flex justify-between items-center mb-4">
|
| 183 |
+
<h3 class="text-xl font-bold text-gray-800">Item Restocked</h3>
|
| 184 |
+
<button id="closeRestockModalBtn" class="text-gray-500 hover:text-gray-700">
|
| 185 |
+
<i class="fas fa-times"></i>
|
| 186 |
+
</button>
|
| 187 |
+
</div>
|
| 188 |
+
|
| 189 |
+
<p class="mb-6 text-gray-700">Are you sure you want to mark <span id="restockItemName" class="font-semibold"></span> as restocked? This will remove it from your out-of-stock list.</p>
|
| 190 |
+
|
| 191 |
+
<input type="hidden" id="restockItemId">
|
| 192 |
+
|
| 193 |
+
<div class="flex justify-end space-x-3">
|
| 194 |
+
<button type="button" id="cancelRestockBtn" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-all">
|
| 195 |
+
Cancel
|
| 196 |
+
</button>
|
| 197 |
+
<button type="button" id="confirmRestockBtn" class="px-6 py-2 bg-emerald-500 hover:bg-emerald-600 text-white rounded-lg shadow-md transition-all flex items-center">
|
| 198 |
+
<i class="fas fa-check mr-2"></i> Confirm Restock
|
| 199 |
+
</button>
|
| 200 |
+
</div>
|
| 201 |
+
</div>
|
| 202 |
+
</div>
|
| 203 |
+
</div>
|
| 204 |
+
|
| 205 |
+
<script>
|
| 206 |
+
// Sample data - in a real app, this would come from a database
|
| 207 |
+
let items = JSON.parse(localStorage.getItem('kitchenStockItems')) || [];
|
| 208 |
+
let recentItems = [];
|
| 209 |
+
|
| 210 |
+
// DOM Elements
|
| 211 |
+
const itemsContainer = document.getElementById('itemsContainer');
|
| 212 |
+
const emptyState = document.getElementById('emptyState');
|
| 213 |
+
const addItemBtn = document.getElementById('addItemBtn');
|
| 214 |
+
const addFirstItemBtn = document.getElementById('addFirstItemBtn');
|
| 215 |
+
const addItemModal = document.getElementById('addItemModal');
|
| 216 |
+
const closeModalBtn = document.getElementById('closeModalBtn');
|
| 217 |
+
const cancelAddBtn = document.getElementById('cancelAddBtn');
|
| 218 |
+
const addItemForm = document.getElementById('addItemForm');
|
| 219 |
+
const searchInput = document.getElementById('searchInput');
|
| 220 |
+
const restockModal = document.getElementById('restockModal');
|
| 221 |
+
const closeRestockModalBtn = document.getElementById('closeRestockModalBtn');
|
| 222 |
+
const cancelRestockBtn = document.getElementById('cancelRestockBtn');
|
| 223 |
+
const confirmRestockBtn = document.getElementById('confirmRestockBtn');
|
| 224 |
+
const restockItemName = document.getElementById('restockItemName');
|
| 225 |
+
const restockItemId = document.getElementById('restockItemId');
|
| 226 |
+
const outOfStockCount = document.getElementById('outOfStockCount');
|
| 227 |
+
const totalItemsCount = document.getElementById('totalItemsCount');
|
| 228 |
+
const recentItemsCount = document.getElementById('recentItemsCount');
|
| 229 |
+
|
| 230 |
+
// Event Listeners
|
| 231 |
+
addItemBtn.addEventListener('click', openAddItemModal);
|
| 232 |
+
addFirstItemBtn.addEventListener('click', openAddItemModal);
|
| 233 |
+
closeModalBtn.addEventListener('click', closeAddItemModal);
|
| 234 |
+
cancelAddBtn.addEventListener('click', closeAddItemModal);
|
| 235 |
+
addItemForm.addEventListener('submit', handleAddItem);
|
| 236 |
+
searchInput.addEventListener('input', filterItems);
|
| 237 |
+
closeRestockModalBtn.addEventListener('click', closeRestockModal);
|
| 238 |
+
cancelRestockBtn.addEventListener('click', closeRestockModal);
|
| 239 |
+
confirmRestockBtn.addEventListener('click', handleRestock);
|
| 240 |
+
|
| 241 |
+
// Initialize the app
|
| 242 |
+
function init() {
|
| 243 |
+
renderItems();
|
| 244 |
+
updateStats();
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
// Render all items
|
| 248 |
+
function renderItems(filteredItems = null) {
|
| 249 |
+
const itemsToRender = filteredItems || items;
|
| 250 |
+
|
| 251 |
+
if (itemsToRender.length === 0) {
|
| 252 |
+
emptyState.classList.remove('hidden');
|
| 253 |
+
itemsContainer.innerHTML = '';
|
| 254 |
+
itemsContainer.appendChild(emptyState);
|
| 255 |
+
return;
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
emptyState.classList.add('hidden');
|
| 259 |
+
|
| 260 |
+
itemsContainer.innerHTML = '';
|
| 261 |
+
|
| 262 |
+
itemsToRender.forEach((item, index) => {
|
| 263 |
+
const itemCard = document.createElement('div');
|
| 264 |
+
itemCard.className = 'item-card bg-white rounded-lg shadow-sm p-4 mb-3 border-l-4 border-red-500 hover:shadow-md';
|
| 265 |
+
itemCard.innerHTML = `
|
| 266 |
+
<div class="flex justify-between items-start">
|
| 267 |
+
<div>
|
| 268 |
+
<h3 class="font-semibold text-lg text-gray-800">${item.name}</h3>
|
| 269 |
+
<div class="flex items-center mt-1">
|
| 270 |
+
<span class="text-xs px-2 py-1 rounded-full ${getCategoryColor(item.category)} mr-2">${item.category}</span>
|
| 271 |
+
<span class="text-xs text-gray-500"><i class="far fa-clock mr-1"></i> ${formatDate(item.dateAdded)}</span>
|
| 272 |
+
</div>
|
| 273 |
+
${item.notes ? `<p class="text-sm text-gray-600 mt-2">${item.notes}</p>` : ''}
|
| 274 |
+
</div>
|
| 275 |
+
<button class="restock-btn px-3 py-1 bg-emerald-500 hover:bg-emerald-600 text-white text-sm rounded-full transition-all" data-id="${index}">
|
| 276 |
+
<i class="fas fa-check mr-1"></i> Restocked
|
| 277 |
+
</button>
|
| 278 |
+
</div>
|
| 279 |
+
`;
|
| 280 |
+
|
| 281 |
+
itemsContainer.appendChild(itemCard);
|
| 282 |
+
});
|
| 283 |
+
|
| 284 |
+
// Add event listeners to all restock buttons
|
| 285 |
+
document.querySelectorAll('.restock-btn').forEach(btn => {
|
| 286 |
+
btn.addEventListener('click', (e) => {
|
| 287 |
+
const itemId = e.currentTarget.getAttribute('data-id');
|
| 288 |
+
openRestockModal(itemId);
|
| 289 |
+
});
|
| 290 |
+
});
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
// Open Add Item Modal
|
| 294 |
+
function openAddItemModal() {
|
| 295 |
+
addItemModal.classList.remove('hidden');
|
| 296 |
+
document.getElementById('itemName').focus();
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
// Close Add Item Modal
|
| 300 |
+
function closeAddItemModal() {
|
| 301 |
+
addItemModal.classList.add('hidden');
|
| 302 |
+
addItemForm.reset();
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
// Open Restock Modal
|
| 306 |
+
function openRestockModal(itemId) {
|
| 307 |
+
const item = items[itemId];
|
| 308 |
+
restockItemName.textContent = item.name;
|
| 309 |
+
restockItemId.value = itemId;
|
| 310 |
+
restockModal.classList.remove('hidden');
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
// Close Restock Modal
|
| 314 |
+
function closeRestockModal() {
|
| 315 |
+
restockModal.classList.add('hidden');
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
// Handle Add Item Form Submission
|
| 319 |
+
function handleAddItem(e) {
|
| 320 |
+
e.preventDefault();
|
| 321 |
+
|
| 322 |
+
const name = document.getElementById('itemName').value.trim();
|
| 323 |
+
const category = document.getElementById('itemCategory').value;
|
| 324 |
+
const notes = document.getElementById('itemNotes').value.trim();
|
| 325 |
+
|
| 326 |
+
const newItem = {
|
| 327 |
+
name,
|
| 328 |
+
category,
|
| 329 |
+
notes,
|
| 330 |
+
dateAdded: new Date().toISOString()
|
| 331 |
+
};
|
| 332 |
+
|
| 333 |
+
items.unshift(newItem);
|
| 334 |
+
recentItems.unshift(newItem);
|
| 335 |
+
|
| 336 |
+
if (recentItems.length > 5) {
|
| 337 |
+
recentItems.pop();
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
saveItems();
|
| 341 |
+
renderItems();
|
| 342 |
+
updateStats();
|
| 343 |
+
closeAddItemModal();
|
| 344 |
+
|
| 345 |
+
// Show success animation
|
| 346 |
+
const successIcon = document.createElement('div');
|
| 347 |
+
successIcon.className = 'fixed bottom-6 right-6 w-16 h-16 rounded-full bg-emerald-500 flex items-center justify-center text-white text-2xl shadow-lg pulse';
|
| 348 |
+
successIcon.innerHTML = '<i class="fas fa-check"></i>';
|
| 349 |
+
document.body.appendChild(successIcon);
|
| 350 |
+
|
| 351 |
+
setTimeout(() => {
|
| 352 |
+
successIcon.classList.remove('pulse');
|
| 353 |
+
success
|
| 354 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
DeepSite LogoDeepSite | New Imagine and Share in 1-Click Load Space Space IconSpace Load Project Load an existing DeepSite Space to continue working on it. Space URL https://huggingface.co/spaces/username/space-name Load Space Deploy to Space REQUIRED Login with Hugging Face Host this project for free and share it with your friends. Sign in with Hugging Face create android app to record items which are over in kitchen. i just need track of those items which are over
|