Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Fruit Ripeness Dashboard</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap'); | |
| body { | |
| font-family: 'Poppins', sans-serif; | |
| } | |
| .ripeness-indicator { | |
| width: 12px; | |
| height: 12px; | |
| border-radius: 50%; | |
| display: inline-block; | |
| margin-right: 6px; | |
| } | |
| .filter-active { | |
| background-color: #e2e8f0; | |
| font-weight: 600; | |
| } | |
| #fruitGrid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); | |
| gap: 1.5rem; | |
| } | |
| @media (max-width: 768px) { | |
| #fruitGrid { | |
| grid-template-columns: 1fr; | |
| } | |
| } | |
| .fruit-card { | |
| transition: all 0.2s ease; | |
| } | |
| .fruit-card:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50"> | |
| <div class="container mx-auto px-4 py-6"> | |
| <!-- Header --> | |
| <header class="mb-8"> | |
| <div class="flex flex-col md:flex-row md:items-center justify-between gap-4"> | |
| <div> | |
| <h1 class="text-2xl md:text-3xl font-bold text-gray-800">Fruit Ripeness Dashboard</h1> | |
| <p class="text-gray-600">Manage and analyze your fruit classification results</p> | |
| </div> | |
| <div class="flex items-center gap-3"> | |
| <button id="newScanBtn" class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 flex items-center"> | |
| <i class="fas fa-plus mr-2"></i> New Scan | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Controls Section --> | |
| <div class="bg-white rounded-xl shadow-sm p-5 mb-6"> | |
| <div class="flex flex-col md:flex-row gap-4"> | |
| <!-- Search Bar --> | |
| <div class="flex-1 relative"> | |
| <i class="fas fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i> | |
| <input type="text" id="searchInput" placeholder="Search fruits..." class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500"> | |
| </div> | |
| <!-- Date Filter --> | |
| <div class="relative"> | |
| <i class="fas fa-calendar-alt absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i> | |
| <input type="date" id="dateFilter" class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500"> | |
| </div> | |
| <!-- Fruit Type Filter --> | |
| <select id="fruitTypeFilter" class="border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-green-500 focus:border-green-500"> | |
| <option value="">All Fruits</option> | |
| <option value="apple">Apple</option> | |
| <option value="banana">Banana</option> | |
| <option value="orange">Orange</option> | |
| <option value="avocado">Avocado</option> | |
| <option value="mango">Mango</option> | |
| </select> | |
| <!-- Ripeness Filter --> | |
| <select id="ripenessFilter" class="border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-green-500 focus:border-green-500"> | |
| <option value="">All Status</option> | |
| <option value="unripe">Unripe</option> | |
| <option value="ripe">Ripe</option> | |
| <option value="overripe">Overripe</option> | |
| </select> | |
| </div> | |
| <!-- Secondary Filters --> | |
| <div class="flex flex-wrap items-center gap-3 mt-4 pt-4 border-t border-gray-100"> | |
| <span class="text-sm text-gray-500">Sort by:</span> | |
| <button class="sort-btn filter-active px-3 py-1 rounded-lg text-sm" data-sort="newest"> | |
| <i class="fas fa-clock mr-1"></i> Newest First | |
| </button> | |
| <button class="sort-btn px-3 py-1 rounded-lg text-sm" data-sort="oldest"> | |
| <i class="fas fa-clock mr-1"></i> Oldest First | |
| </button> | |
| <button class="sort-btn px-3 py-1 rounded-lg text-sm" data-sort="confidence-high"> | |
| <i class="fas fa-chart-line mr-1"></i> Highest Confidence | |
| </button> | |
| <button class="sort-btn px-3 py-1 rounded-lg text-sm" data-sort="confidence-low"> | |
| <i class="fas fa-chart-line mr-1"></i> Lowest Confidence | |
| </button> | |
| </div> | |
| </div> | |
| <!-- View Toggle --> | |
| <div class="flex justify-end mb-4"> | |
| <div class="inline-flex rounded-lg border border-gray-300 overflow-hidden"> | |
| <button id="gridViewBtn" class="view-toggle-btn active px-4 py-2 bg-white hover:bg-gray-50"> | |
| <i class="fas fa-th-large"></i> | |
| </button> | |
| <button id="tableViewBtn" class="view-toggle-btn px-4 py-2 bg-white hover:bg-gray-50"> | |
| <i class="fas fa-list"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Grid View --> | |
| <div id="gridView" class="mb-8"> | |
| <div id="fruitGrid"> | |
| <!-- Example Fruit Cards - These would be generated dynamically in a real app --> | |
| <div class="fruit-card bg-white rounded-lg shadow-sm overflow-hidden border border-gray-100"> | |
| <img src="https://images.unsplash.com/photo-1568702846914-96b305d2aaeb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&q=80" | |
| alt="Apple" class="w-full h-48 object-cover"> | |
| <div class="p-4"> | |
| <div class="flex justify-between items-start mb-2"> | |
| <h3 class="font-semibold text-gray-800">Apple</h3> | |
| <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800"> | |
| <span class="ripeness-indicator bg-green-500"></span> | |
| Ripe | |
| </span> | |
| </div> | |
| <div class="flex items-center text-sm text-gray-500 mb-1"> | |
| <i class="fas fa-star text-yellow-400 mr-1"></i> | |
| <span>4.5</span> | |
| <span class="mx-2">•</span> | |
| <i class="fas fa-chart-line text-blue-400 mr-1"></i> | |
| <span>92%</span> | |
| </div> | |
| <div class="text-xs text-gray-400"> | |
| <i class="fas fa-clock mr-1"></i> | |
| 15 Jun 2023, 14:30 | |
| </div> | |
| <div class="flex justify-between mt-3 pt-3 border-t border-gray-100"> | |
| <button class="text-blue-500 text-sm hover:text-blue-700"> | |
| <i class="fas fa-eye mr-1"></i> View | |
| </button> | |
| <button class="text-red-500 text-sm hover:text-red-700"> | |
| <i class="fas fa-trash-alt mr-1"></i> Delete | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="fruit-card bg-white rounded-lg shadow-sm overflow-hidden border border-gray-100"> | |
| <img src="https://images.unsplash.com/photo-1550258987-190a2d41a8ba?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&q=80" | |
| alt="Banana" class="w-full h-48 object-cover"> | |
| <div class="p-4"> | |
| <div class="flex justify-between items-start mb-2"> | |
| <h3 class="font-semibold text-gray-800">Banana</h3> | |
| <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800"> | |
| <span class="ripeness-indicator bg-yellow-500"></span> | |
| Unripe | |
| </span> | |
| </div> | |
| <div class="flex items-center text-sm text-gray-500 mb-1"> | |
| <i class="fas fa-star text-yellow-400 mr-1"></i> | |
| <span>3.2</span> | |
| <span class="mx-2">•</span> | |
| <i class="fas fa-chart-line text-blue-400 mr-1"></i> | |
| <span>65%</span> | |
| </div> | |
| <div class="text-xs text-gray-400"> | |
| <i class="fas fa-clock mr-1"></i> | |
| 14 Jun 2023, 09:15 | |
| </div> | |
| <div class="flex justify-between mt-3 pt-3 border-t border-gray-100"> | |
| <button class="text-blue-500 text-sm hover:text-blue-700"> | |
| <i class="fas fa-eye mr-1"></i> View | |
| </button> | |
| <button class="text-red-500 text-sm hover:text-red-700"> | |
| <i class="fas fa-trash-alt mr-1"></i> Delete | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="fruit-card bg-white rounded-lg shadow-sm overflow-hidden border border-gray-100"> | |
| <img src="https://images.unsplash.com/photo-1557800636-894a64c1696f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&q=80" | |
| alt="Orange" class="w-full h-48 object-cover"> | |
| <div class="p-4"> | |
| <div class="flex justify-between items-start mb-2"> | |
| <h3 class="font-semibold text-gray-800">Orange</h3> | |
| <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800"> | |
| <span class="ripeness-indicator bg-green-500"></span> | |
| Ripe | |
| </span> | |
| </div> | |
| <div class="flex items-center text-sm text-gray-500 mb-1"> | |
| <i class="fas fa-star text-yellow-400 mr-1"></i> | |
| <span>4.8</span> | |
| <span class="mx-2">•</span> | |
| <i class="fas fa-chart-line text-blue-400 mr-1"></i> | |
| <span>88%</span> | |
| </div> | |
| <div class="text-xs text-gray-400"> | |
| <i class="fas fa-clock mr-1"></i> | |
| 12 Jun 2023, 16:45 | |
| </div> | |
| <div class="flex justify-between mt-3 pt-3 border-t border-gray-100"> | |
| <button class="text-blue-500 text-sm hover:text-blue-700"> | |
| <i class="fas fa-eye mr-1"></i> View | |
| </button> | |
| <button class="text-red-500 text-sm hover:text-red-700"> | |
| <i class="fas fa-trash-alt mr-1"></i> Delete | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="fruit-card bg-white rounded-lg shadow-sm overflow-hidden border border-gray-100"> | |
| <img src="https://images.unsplash.com/photo-1582284540020-8acbe03f4924?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&q=80" | |
| alt="Avocado" class="w-full h-48 object-cover"> | |
| <div class="p-4"> | |
| <div class="flex justify-between items-start mb-2"> | |
| <h3 class="font-semibold text-gray-800">Avocado</h3> | |
| <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-red-100 text-red-800"> | |
| <span class="ripeness-indicator bg-red-500"></span> | |
| Overripe | |
| </span> | |
| </div> | |
| <div class="flex items-center text-sm text-gray-500 mb-1"> | |
| <i class="fas fa-star text-yellow-400 mr-1"></i> | |
| <span>2.5</span> | |
| <span class="mx-2">•</span> | |
| <i class="fas fa-chart-line text-blue-400 mr-1"></i> | |
| <span>78%</span> | |
| </div> | |
| <div class="text-xs text-gray-400"> | |
| <i class="fas fa-clock mr-1"></i> | |
| 10 Jun 2023, 11:20 | |
| </div> | |
| <div class="flex justify-between mt-3 pt-3 border-t border-gray-100"> | |
| <button class="text-blue-500 text-sm hover:text-blue-700"> | |
| <i class="fas fa-eye mr-1"></i> View | |
| </button> | |
| <button class="text-red-500 text-sm hover:text-red-700"> | |
| <i class="fas fa-trash-alt mr-1"></i> Delete | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="fruit-card bg-white rounded-lg shadow-sm overflow-hidden border border-gray-100"> | |
| <img src="https://images.unsplash.com/photo-1518630383494-b9f400aebee5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&q=80" | |
| alt="Mango" class="w-full h-48 object-cover"> | |
| <div class="p-4"> | |
| <div class="flex justify-between items-start mb-2"> | |
| <h3 class="font-semibold text-gray-800">Mango</h3> | |
| <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800"> | |
| <span class="ripeness-indicator bg-green-500"></span> | |
| Ripe | |
| </span> | |
| </div> | |
| <div class="flex items-center text-sm text-gray-500 mb-1"> | |
| <i class="fas fa-star text-yellow-400 mr-1"></i> | |
| <span>4.7</span> | |
| <span class="mx-2">•</span> | |
| <i class="fas fa-chart-line text-blue-400 mr-1"></i> | |
| <span>95%</span> | |
| </div> | |
| <div class="text-xs text-gray-400"> | |
| <i class="fas fa-clock mr-1"></i> | |
| 08 Jun 2023, 19:10 | |
| </div> | |
| <div class="flex justify-between mt-3 pt-3 border-t border-gray-100"> | |
| <button class="text-blue-500 text-sm hover:text-blue-700"> | |
| <i class="fas fa-eye mr-1"></i> View | |
| </button> | |
| <button class="text-red-500 text-sm hover:text-red-700"> | |
| <i class="fas fa-trash-alt mr-1"></i> Delete | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Pagination --> | |
| <div class="flex justify-center mt-8"> | |
| <nav class="inline-flex rounded-lg shadow-sm border border-gray-200 bg-white"> | |
| <button class="px-3 py-2 rounded-l-lg border-r border-gray-200 bg-gray-50 text-gray-500"> | |
| <i class="fas fa-chevron-left"></i> | |
| </button> | |
| <button class="px-4 py-2 border-r border-gray-200 bg-green-600 text-white font-medium">1</button> | |
| <button class="px-4 py-2 border-r border-gray-200 hover:bg-gray-50">2</button> | |
| <button class="px-4 py-2 border-r border-gray-200 hover:bg-gray-50">3</button> | |
| <span class="px-4 py-2 border-r border-gray-200 text-gray-500">...</span> | |
| <button class="px-4 py-2 border-r border-gray-200 hover:bg-gray-50">8</button> | |
| <button class="px-3 py-2 rounded-r-lg hover:bg-gray-50 text-gray-500"> | |
| <i class="fas fa-chevron-right"></i> | |
| </button> | |
| </nav> | |
| </div> | |
| </div> | |
| <!-- Table View (Hidden by default) --> | |
| <div id="tableView" class="mb-8 hidden"> | |
| <div class="overflow-x-auto bg-white rounded-lg shadow-sm border border-gray-100"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | |
| Fruit Image | |
| </th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | |
| Fruit Name | |
| </th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | |
| Ripeness | |
| </th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | |
| Confidence | |
| </th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | |
| User Rating | |
| </th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | |
| Date | |
| </th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> | |
| Actions | |
| </th> | |
| </tr> | |
| </thead> | |
| <tbody class="bg-white divide-y divide-gray-200"> | |
| <tr class="hover:bg-gray-50"> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <div class="flex-shrink-0 h-10 w-10"> | |
| <img class="h-10 w-10 rounded-full object-cover" src="https://images.unsplash.com/photo-1568702846914-96b305d2aaeb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=100&q=80" alt=""> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap font-medium text-gray-900"> | |
| Apple | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800"> | |
| <span class="ripeness-indicator bg-green-500"></span> Ripe | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-gray-500"> | |
| <div class="flex items-center"> | |
| <div class="h-2 w-full bg-gray-200 rounded-full overflow-hidden"> | |
| <div class="h-full bg-green-500" style="width: 92%"></div> | |
| </div> | |
| <span class="ml-2 text-sm text-gray-500">92%</span> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-gray-500"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-star text-yellow-400"></i> | |
| <span class="ml-1">4.5</span> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> | |
| 15 Jun 2023, 14:30 | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> | |
| <button class="text-blue-500 hover:text-blue-700 mr-3"> | |
| <i class="fas fa-eye"></i> | |
| </button> | |
| <button class="text-red-500 hover:text-red-700"> | |
| <i class="fas fa-trash-alt"></i> | |
| </button> | |
| </td> | |
| </tr> | |
| <tr class="hover:bg-gray-50"> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <div class="flex-shrink-0 h-10 w-10"> | |
| <img class="h-10 w-10 rounded-full object-cover" src="https://images.unsplash.com/photo-1550258987-190a2d41a8ba?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=100&q=80" alt=""> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap font-medium text-gray-900"> | |
| Banana | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800"> | |
| <span class="ripeness-indicator bg-yellow-500"></span> Unripe | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-gray-500"> | |
| <div class="flex items-center"> | |
| <div class="h-2 w-full bg-gray-200 rounded-full overflow-hidden"> | |
| <div class="h-full bg-yellow-500" style="width: 65%"></div> | |
| </div> | |
| <span class="ml-2 text-sm text-gray-500">65%</span> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-gray-500"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-star text-yellow-400"></i> | |
| <span class="ml-1">3.2</span> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> | |
| 14 Jun 2023, 09:15 | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> | |
| <button class="text-blue-500 hover:text-blue-700 mr-3"> | |
| <i class="fas fa-eye"></i> | |
| </button> | |
| <button class="text-red-500 hover:text-red-700"> | |
| <i class="fas fa-trash-alt"></i> | |
| </button> | |
| </td> | |
| </tr> | |
| <tr class="hover:bg-gray-50"> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <div class="flex-shrink-0 h-10 w-10"> | |
| <img class="h-10 w-10 rounded-full object-cover" src="https://images.unsplash.com/photo-1582284540020-8acbe03f4924?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=100&q=80" alt=""> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap font-medium text-gray-900"> | |
| Avocado | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap"> | |
| <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800"> | |
| <span class="ripeness-indicator bg-red-500"></span> Overripe | |
| </span> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-gray-500"> | |
| <div class="flex items-center"> | |
| <div class="h-2 w-full bg-gray-200 rounded-full overflow-hidden"> | |
| <div class="h-full bg-red-500" style="width: 78%"></div> | |
| </div> | |
| <span class="ml-2 text-sm text-gray-500">78%</span> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-gray-500"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-star text-yellow-400"></i> | |
| <span class="ml-1">2.5</span> | |
| </div> | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> | |
| 10 Jun 2023, 11:20 | |
| </td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> | |
| <button class="text-blue-500 hover:text-blue-700 mr-3"> | |
| <i class="fas fa-eye"></i> | |
| </button> | |
| <button class="text-red-500 hover:text-red-700"> | |
| <i class="fas fa-trash-alt"></i> | |
| </button> | |
| </td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| <!-- Table Pagination --> | |
| <div class="flex justify-between items-center mt-4"> | |
| <div class="text-sm text-gray-500"> | |
| Showing <span class="font-medium">1</span> to <span class="font-medium">3</span> of <span class="font-medium">15</span> results | |
| </div> | |
| <div class="flex"> | |
| <button class="px-3 py-1 rounded-l-lg border border-gray-300 bg-white text-gray-700 hover:bg-gray-50"> | |
| Previous | |
| </button> | |
| <button class="px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-50"> | |
| 1 | |
| </button> | |
| <button class="px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-50"> | |
| 2 | |
| </button> | |
| <button class="px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-50"> | |
| 3 | |
| </button> | |
| <span class="px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700"> | |
| ... | |
| </span> | |
| <button class="px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-50"> | |
| 5 | |
| </button> | |
| <button class="px-3 py-1 rounded-r-lg border border-gray-300 bg-white text-gray-700 hover:bg-gray-50"> | |
| Next | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Toggle between grid and table view | |
| document.getElementById('gridViewBtn').addEventListener('click', function() { | |
| document.getElementById('gridView').classList.remove('hidden'); | |
| document.getElementById('tableView').classList.add('hidden'); | |
| document.getElementById('gridViewBtn').classList.add('active'); | |
| document.getElementById('tableViewBtn').classList.remove('active'); | |
| }); | |
| document.getElementById('tableViewBtn').addEventListener('click', function() { | |
| document.getElementById('tableView').classList.remove('hidden'); | |
| document.getElementById('gridView').classList.add('hidden'); | |
| document.getElementById('tableViewBtn').classList.add('active'); | |
| document.getElementById('gridViewBtn').classList.remove('active'); | |
| }); | |
| // Sort buttons | |
| document.querySelectorAll('.sort-btn').forEach(button => { | |
| button.addEventListener('click', function() { | |
| document.querySelectorAll('.sort-btn').forEach(btn => { | |
| btn.classList.remove('filter-active'); | |
| }); | |
| this.classList.add('filter-active'); | |
| // In a real app, this would trigger a resorting of the results | |
| const sortType = this.getAttribute('data-sort'); | |
| console.log(`Sorting by: ${sortType}`); | |
| }); | |
| }); | |
| // Filter controls | |
| document.getElementById('searchInput').addEventListener('input', function() { | |
| const searchTerm = this.value.toLowerCase(); | |
| console.log(`Searching for: ${searchTerm}`); | |
| // In a real app, this would filter the displayed results | |
| }); | |
| document.getElementById('dateFilter').addEventListener('change', function() { | |
| console.log(`Filtering by date: ${this.value}`); | |
| }); | |
| document.getElementById('fruitTypeFilter').addEventListener('change', function() { | |
| console.log(`Filtering by fruit type: ${this.value}`); | |
| }); | |
| document.getElementById('ripenessFilter').addEventListener('change', function() { | |
| console.log(`Filtering by ripeness: ${this.value}`); | |
| }); | |
| // New scan button | |
| document.getElementById('newScanBtn').addEventListener('click', function() { | |
| alert("In a real application, this would open the camera/file upload for a new fruit scan."); | |
| }); | |
| // Demo: Make today's date the default in the date filter | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const today = new Date(); | |
| const formattedDate = today.toISOString().substr(0, 10); | |
| document.getElementById('dateFilter').value = formattedDate; | |
| // Set default sort to newest first | |
| document.querySelector('[data-sort="newest"]').classList.add('filter-active'); | |
| }); | |
| </script> | |
| <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=mrwhy06/fruit-ripe" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body> | |
| </html> |