bala41 commited on
Commit
3af56b6
·
verified ·
1 Parent(s): 191e8ec

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +66 -3
  2. prompts.txt +2 -1
index.html CHANGED
@@ -203,9 +203,9 @@
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');
@@ -239,6 +239,8 @@
239
  confirmRestockBtn.addEventListener('click', handleRestock);
240
 
241
  // Initialize the app
 
 
242
  function init() {
243
  renderItems();
244
  updateStats();
@@ -290,6 +292,26 @@
290
  });
291
  }
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  // Open Add Item Modal
294
  function openAddItemModal() {
295
  addItemModal.classList.remove('hidden');
@@ -350,5 +372,46 @@
350
 
351
  setTimeout(() => {
352
  successIcon.classList.remove('pulse');
353
- success
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  </html>
 
203
  </div>
204
 
205
  <script>
206
+ // Sample data - stored in localStorage
207
  let items = JSON.parse(localStorage.getItem('kitchenStockItems')) || [];
208
+ let recentItems = JSON.parse(localStorage.getItem('recentKitchenItems')) || [];
209
 
210
  // DOM Elements
211
  const itemsContainer = document.getElementById('itemsContainer');
 
239
  confirmRestockBtn.addEventListener('click', handleRestock);
240
 
241
  // Initialize the app
242
+ document.addEventListener('DOMContentLoaded', init);
243
+
244
  function init() {
245
  renderItems();
246
  updateStats();
 
292
  });
293
  }
294
 
295
+ // Get category color class
296
+ function getCategoryColor(category) {
297
+ const colors = {
298
+ 'Dairy': 'bg-blue-100 text-blue-800',
299
+ 'Produce': 'bg-green-100 text-green-800',
300
+ 'Pantry': 'bg-yellow-100 text-yellow-800',
301
+ 'Meat': 'bg-red-100 text-red-800',
302
+ 'Beverages': 'bg-indigo-100 text-indigo-800',
303
+ 'Frozen': 'bg-purple-100 text-purple-800',
304
+ 'Other': 'bg-gray-100 text-gray-800'
305
+ };
306
+ return colors[category] || 'bg-gray-100 text-gray-800';
307
+ }
308
+
309
+ // Format date
310
+ function formatDate(dateString) {
311
+ const date = new Date(dateString);
312
+ return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
313
+ }
314
+
315
  // Open Add Item Modal
316
  function openAddItemModal() {
317
  addItemModal.classList.remove('hidden');
 
372
 
373
  setTimeout(() => {
374
  successIcon.classList.remove('pulse');
375
+ setTimeout(() => {
376
+ successIcon.remove();
377
+ }, 300);
378
+ }, 2000);
379
+ }
380
+
381
+ // Handle Restock
382
+ function handleRestock() {
383
+ const itemId = restockItemId.value;
384
+ items.splice(itemId, 1);
385
+
386
+ saveItems();
387
+ renderItems();
388
+ updateStats();
389
+ closeRestockModal();
390
+ }
391
+
392
+ // Filter items based on search input
393
+ function filterItems() {
394
+ const searchTerm = searchInput.value.toLowerCase();
395
+ const filteredItems = items.filter(item =>
396
+ item.name.toLowerCase().includes(searchTerm) ||
397
+ item.category.toLowerCase().includes(searchTerm) ||
398
+ (item.notes && item.notes.toLowerCase().includes(searchTerm))
399
+ );
400
+ renderItems(filteredItems);
401
+ }
402
+
403
+ // Update statistics
404
+ function updateStats() {
405
+ outOfStockCount.textContent = items.length;
406
+ totalItemsCount.textContent = items.length + recentItems.length;
407
+ recentItemsCount.textContent = recentItems.length;
408
+ }
409
+
410
+ // Save items to localStorage
411
+ function saveItems() {
412
+ localStorage.setItem('kitchenStockItems', JSON.stringify(items));
413
+ localStorage.setItem('recentKitchenItems', JSON.stringify(recentItems));
414
+ }
415
+ </script>
416
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=bala41/kitchen" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
417
  </html>
prompts.txt CHANGED
@@ -1 +1,2 @@
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
 
 
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
2
+ bottons are not adding anything