Download index.html from BPSCODE/dfg: direct link, hf CLI and curl.
- Browser
- Download file 21 kB
-
https://huggingface.co/spaces/BPSCODE/dfg/resolve/main/index.html
- Command line
-
hf download hf://spaces/BPSCODE/dfg/index.html
-
curl -L -o index.html https://huggingface.co/spaces/BPSCODE/dfg/resolve/main/index.html
21 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>BPS Price List Search</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> | |
| .fade-in { | |
| animation: fadeIn 0.5s ease-in-out; | |
| } | |
| @keyframes fadeIn { | |
| from { opacity: 0; transform: translateY(10px); } | |
| to { opacity: 1; transform: translateY(0); } | |
| } | |
| .search-highlight { | |
| background-color: #fef2f2; | |
| padding: 0 2px; | |
| border-radius: 2px; | |
| } | |
| .price-cell { | |
| min-width: 80px; | |
| } | |
| .password-container { | |
| position: relative; | |
| } | |
| .password-box { | |
| background: white; | |
| padding: 2.5rem; | |
| border-radius: 1rem; | |
| box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); | |
| width: 100%; | |
| max-width: 400px; | |
| text-align: center; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| transform: translate(-50%, -50%); | |
| z-index: 10; | |
| } | |
| .shake { | |
| animation: shake 0.5s; | |
| } | |
| @keyframes shake { | |
| 0%, 100% { transform: translateX(0); } | |
| 20%, 60% { transform: translateX(-5px); } | |
| 40%, 80% { transform: translateX(5px); } | |
| } | |
| .locked-content { | |
| filter: blur(5px); | |
| pointer-events: none; | |
| user-select: none; | |
| } | |
| .password-overlay { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background-color: rgba(255, 255, 255, 0.9); | |
| z-index: 5; | |
| } | |
| </style> | |
| <!-- Main Content Area --> | |
| <main class="container mx-auto px-4 py-8"> | |
| <!-- Password Protected Section --> | |
| <div class="password-container bg-white rounded-xl shadow-lg p-6 mb-8 relative min-h-[500px]"> | |
| <!-- Password Overlay (only covers this section) --> | |
| <div id="passwordOverlay" class="password-overlay"></div> | |
| <!-- Password Box (centered within this section) --> | |
| <div id="passwordBox" class="password-box"> | |
| <div class="flex justify-center mb-6"> | |
| <div class="bg-red-100 p-4 rounded-full"> | |
| <i class="fas fa-lock text-red-600 text-3xl"></i> | |
| </div> | |
| </div> | |
| <h2 class="text-2xl font-bold text-gray-800 mb-2">BPS Price List</h2> | |
| <p class="text-gray-600 mb-6">Enter password to access the pricing system</p> | |
| <div class="mb-4"> | |
| <div class="relative"> | |
| <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> | |
| <i class="fas fa-key text-gray-400"></i> | |
| </div> | |
| <input | |
| type="password" | |
| id="passwordInput" | |
| class="block w-full pl-10 pr-3 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500" | |
| placeholder="Enter password..." | |
| autocomplete="off" | |
| > | |
| </div> | |
| <p id="passwordError" class="text-red-500 text-sm mt-1 hidden">Incorrect password. Please try again.</p> | |
| </div> | |
| <button | |
| id="passwordSubmit" | |
| class="w-full px-6 py-3 bg-red-600 text-white font-medium rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors" | |
| > | |
| Unlock | |
| </button> | |
| </div> | |
| <!-- Main Content (blurred and locked until password is entered) --> | |
| <div id="mainContent" class="locked-content"> | |
| <div class="text-center mb-10"> | |
| <h1 class="text-4xl font-bold text-red-700 mb-2">BPS Price List</h1> | |
| <p class="text-gray-600">Search for products to view pricing and information</p> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-lg p-6 mb-8"> | |
| <div class="flex items-center mb-6"> | |
| <div class="flex-1 relative"> | |
| <label for="search" class="block text-sm font-medium text-gray-700 mb-1">Search by Best # or Description</label> | |
| <div class="relative"> | |
| <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> | |
| <i class="fas fa-search text-gray-400"></i> | |
| </div> | |
| <input | |
| type="text" | |
| id="search" | |
| class="block w-full pl-10 pr-3 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-red-500" | |
| placeholder="Enter Best # or description..." | |
| autocomplete="off" | |
| > | |
| <div id="clear-search" class="absolute inset-y-0 right-0 pr-3 flex items-center cursor-pointer hidden"> | |
| <i class="fas fa-times text-gray-400 hover:text-gray-600"></i> | |
| </div> | |
| </div> | |
| <div id="suggestions" class="hidden absolute z-10 mt-1 w-full bg-white shadow-lg rounded-lg border border-gray-200 max-h-60 overflow-auto"></div> | |
| </div> | |
| <button id="search-btn" class="ml-4 px-6 py-3 bg-red-600 text-white font-medium rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors mt-6"> | |
| Search | |
| </button> | |
| </div> | |
| </div> | |
| <div id="results" class="hidden bg-white rounded-xl shadow-lg overflow-hidden fade-in"> | |
| <div class="p-6 border-b border-gray-200 bg-red-50"> | |
| <h2 class="text-xl font-semibold text-red-800">Item Details</h2> | |
| </div> | |
| <div class="divide-y divide-gray-200"> | |
| <div id="result-content" class="p-6"> | |
| <!-- Results will be displayed here --> | |
| </div> | |
| </div> | |
| </div> | |
| <div id="loading" class="hidden text-center py-8"> | |
| <div class="inline-block animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-red-600 mb-2"></div> | |
| <p class="text-gray-600">Loading data...</p> | |
| </div> | |
| <div id="no-results" class="hidden text-center py-8"> | |
| <i class="fas fa-exclamation-circle text-3xl text-gray-400 mb-3"></i> | |
| <h3 class="text-lg font-medium text-gray-700">No results found</h3> | |
| <p class="text-gray-500">Try a different search term</p> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <script> | |
| // Password Protection | |
| const passwordOverlay = document.getElementById('passwordOverlay'); | |
| const passwordInput = document.getElementById('passwordInput'); | |
| const passwordSubmit = document.getElementById('passwordSubmit'); | |
| const passwordError = document.getElementById('passwordError'); | |
| const passwordBox = document.getElementById('passwordBox'); | |
| const mainContent = document.getElementById('mainContent'); | |
| // Set your password here (in a real application, this would be server-side) | |
| const CORRECT_PASSWORD = "BestPrice20256"; // Change this to your desired password | |
| // Focus password input on page load | |
| window.addEventListener('DOMContentLoaded', () => { | |
| passwordInput.focus(); | |
| }); | |
| passwordSubmit.addEventListener('click', checkPassword); | |
| passwordInput.addEventListener('keypress', function(e) { | |
| if (e.key === 'Enter') { | |
| checkPassword(); | |
| } | |
| }); | |
| function checkPassword() { | |
| if (passwordInput.value === CORRECT_PASSWORD) { | |
| // Correct password | |
| passwordOverlay.style.display = 'none'; | |
| passwordBox.style.display = 'none'; | |
| mainContent.classList.remove('locked-content'); | |
| } else { | |
| // Incorrect password | |
| passwordError.classList.remove('hidden'); | |
| passwordBox.classList.add('shake'); | |
| setTimeout(() => { | |
| passwordBox.classList.remove('shake'); | |
| }, 500); | |
| passwordInput.focus(); | |
| } | |
| } | |
| // BPS Price List data | |
| const sheetData = [ | |
| { id: "00001", name: "O-RING", trade: "0.77", GSA: "0.77", minPlus: "0.67", list: "0.96", commission: "19", generic: "", newCat: ",9-42", oldCat: ",13-53"}, | |
| { id: "4", name: "O-RING 7/16 ID X 11/16 OD X 1/8", trade: "0.49", GSA: "0.49", minPlus: "0.33", list: "0.61", commission: "36", generic: "", newCat: ",1-3,1-21,2-7,2-51,2-52,4-23", oldCat: ",1-13"}, | |
| { id: "6", name: "O-RING 1-1/16 ID X 1-3/16 OD X 1/16", trade: "0.92", GSA: "0.92", minPlus: "0.56", list: "1.15", commission: "38", generic: "", newCat: ",2-5", oldCat: ",1-11"}, | |
| { id: "8", name: "O-RING 9/16 ID X 11/16 OD X 1/16", trade: "0.54", GSA: "0.54", minPlus: "0.33", list: "0.68", commission: "38", generic: "", newCat: ",2-5,2-50,2-64,4-33,5-13,5-32,9-7,9-54,16-9", oldCat: ",1-11"}, | |
| { id: "14", name: "O-RING 15/16 ID X 1-1/8 OD X 3/32", trade: "0.89", GSA: "0.89", minPlus: "0.55", list: "1.11", commission: "38", generic: "", newCat: ",2-6,11-50,12-3", oldCat: ",1-12"}, | |
| { id: "16", name: "O-RING 1-9/16 ID X 1-3/4 OD X 3/32", trade: "0.67", GSA: "0.67", minPlus: "0.48", list: "0.84", commission: "19", generic: "", newCat: ",9-7", oldCat: ",12-29"}, | |
| ]; | |
| // DOM elements | |
| const searchInput = document.getElementById('search'); | |
| const searchBtn = document.getElementById('search-btn'); | |
| const clearSearch = document.getElementById('clear-search'); | |
| const suggestions = document.getElementById('suggestions'); | |
| const results = document.getElementById('results'); | |
| const resultContent = document.getElementById('result-content'); | |
| const loading = document.getElementById('loading'); | |
| const noResults = document.getElementById('no-results'); | |
| // Event listeners | |
| searchInput.addEventListener('input', handleInput); | |
| searchBtn.addEventListener('click', handleSearch); | |
| clearSearch.addEventListener('click', clearSearchInput); | |
| document.addEventListener('click', closeSuggestions); | |
| // Handle input for autocomplete | |
| function handleInput() { | |
| const searchTerm = searchInput.value.trim().toLowerCase(); | |
| if (searchTerm.length === 0) { | |
| suggestions.classList.add('hidden'); | |
| clearSearch.classList.add('hidden'); | |
| return; | |
| } | |
| clearSearch.classList.remove('hidden'); | |
| const filteredItems = sheetData.filter(item => | |
| item.name.toLowerCase().includes(searchTerm) || | |
| item.id.toLowerCase().includes(searchTerm) | |
| ); | |
| showSuggestions(filteredItems, searchTerm); | |
| } | |
| // Show autocomplete suggestions | |
| function showSuggestions(items, searchTerm) { | |
| if (items.length === 0) { | |
| suggestions.classList.add('hidden'); | |
| return; | |
| } | |
| suggestions.innerHTML = ''; | |
| items.slice(0, 5).forEach(item => { | |
| const suggestionItem = document.createElement('div'); | |
| suggestionItem.className = 'px-4 py-2 hover:bg-red-50 cursor-pointer flex items-center'; | |
| // Highlight matching text | |
| const name = highlightMatch(item.name, searchTerm); | |
| const id = highlightMatch(item.id, searchTerm); | |
| suggestionItem.innerHTML = ` | |
| <span class="bg-red-100 text-red-800 text-xs font-medium px-2.5 py-0.5 rounded mr-3">${id}</span> | |
| <span class="truncate">${name}</span> | |
| `; | |
| suggestionItem.addEventListener('click', () => { | |
| searchInput.value = item.name; | |
| suggestions.classList.add('hidden'); | |
| handleSearch(); | |
| }); | |
| suggestions.appendChild(suggestionItem); | |
| }); | |
| suggestions.classList.remove('hidden'); | |
| } | |
| // Highlight matching text in suggestions | |
| function highlightMatch(text, searchTerm) { | |
| if (!searchTerm) return text; | |
| const regex = new RegExp(searchTerm, 'gi'); | |
| return text.replace(regex, match => `<span class="search-highlight">${match}</span>`); | |
| } | |
| // Close suggestions when clicking outside | |
| function closeSuggestions(e) { | |
| if (!suggestions.contains(e.target) && e.target !== searchInput) { | |
| suggestions.classList.add('hidden'); | |
| } | |
| } | |
| // Clear search input | |
| function clearSearchInput() { | |
| searchInput.value = ''; | |
| suggestions.classList.add('hidden'); | |
| clearSearch.classList.add('hidden'); | |
| results.classList.add('hidden'); | |
| noResults.classList.add('hidden'); | |
| searchInput.focus(); | |
| } | |
| // Handle search | |
| function handleSearch() { | |
| const searchTerm = searchInput.value.trim().toLowerCase(); | |
| if (searchTerm.length === 0) { | |
| return; | |
| } | |
| // Show loading | |
| results.classList.add('hidden'); | |
| noResults.classList.add('hidden'); | |
| loading.classList.remove('hidden'); | |
| // Simulate API delay | |
| setTimeout(() => { | |
| loading.classList.add('hidden'); | |
| const foundItem = sheetData.find(item => | |
| item.name.toLowerCase().includes(searchTerm) || | |
| item.id.toLowerCase().includes(searchTerm) | |
| ); | |
| if (foundItem) { | |
| displayResult(foundItem, searchTerm); | |
| } else { | |
| noResults.classList.remove('hidden'); | |
| } | |
| }, 800); | |
| } | |
| // Display search result | |
| function displayResult(item, searchTerm) { | |
| // Highlight search term in the name | |
| const highlightedName = highlightMatch(item.name, searchTerm); | |
| resultContent.innerHTML = ` | |
| <div class="grid grid-cols-1 gap-6"> | |
| <div class="space-y-4"> | |
| <div> | |
| <h3 class="text-2xl font-bold text-red-700">${highlightedName}</h3> | |
| <p class="text-lg text-gray-600">Best #: <span class="font-medium">${item.id}</span></p> | |
| </div> | |
| <div class="bg-gray-50 p-4 rounded-lg"> | |
| <h4 class="text-lg font-semibold text-gray-800 mb-3">Pricing Information</h4> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-100"> | |
| <tr> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Price Type</th> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Price</th> | |
| </tr> | |
| </thead> | |
| <tbody class="bg-white divide-y divide-gray-200"> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Trade Price</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.trade}</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">GSA Price</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.GSA}</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Min Plus Price</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.minPlus}</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">List Price</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.list}</td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div class="bg-gray-50 p-4 rounded-lg"> | |
| <h4 class="text-lg font-semibold text-gray-800 mb-3">Additional Information</h4> | |
| <div class="space-y-2"> | |
| <p class="text-sm"><span class="font-medium text-gray-700">Commission:</span> ${item.commission}%</p> | |
| <p class="text-sm"><span class="font-medium text-gray-700">Generic:</span> ${item.generic || 'N/A'}</p> | |
| </div> | |
| </div> | |
| <div class="bg-gray-50 p-4 rounded-lg"> | |
| <h4 class="text-lg font-semibold text-gray-800 mb-3">Categories</h4> | |
| <div class="space-y-2"> | |
| <p class="text-sm"><span class="font-medium text-gray-700">New Categories:</span> ${item.newCat.replace(/,/g, ', ').substring(1)}</p> | |
| <p class="text-sm"><span class="font-medium text-gray-700">Old Categories:</span> ${item.oldCat.replace(/,/g, ', ').substring(1)}</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| `; | |
| results.classList.remove('hidden'); | |
| } | |
| </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=BPSCODE/dfg" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |