BPSCODE commited on
Commit
f89c41c
·
verified ·
1 Parent(s): 069fb79

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +5 -3
  2. index.html +414 -19
  3. prompts.txt +6 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Dfg
3
- emoji: 🏃
4
  colorFrom: red
5
  colorTo: yellow
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: dfg
3
+ emoji: 🐳
4
  colorFrom: red
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,414 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>BPS Price List Search</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
+ .fade-in {
11
+ animation: fadeIn 0.5s ease-in-out;
12
+ }
13
+ @keyframes fadeIn {
14
+ from { opacity: 0; transform: translateY(10px); }
15
+ to { opacity: 1; transform: translateY(0); }
16
+ }
17
+ .search-highlight {
18
+ background-color: #fef2f2;
19
+ padding: 0 2px;
20
+ border-radius: 2px;
21
+ }
22
+ .price-cell {
23
+ min-width: 80px;
24
+ }
25
+ .password-container {
26
+ position: relative;
27
+ }
28
+ .password-box {
29
+ background: white;
30
+ padding: 2.5rem;
31
+ border-radius: 1rem;
32
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
33
+ width: 100%;
34
+ max-width: 400px;
35
+ text-align: center;
36
+ position: absolute;
37
+ top: 50%;
38
+ left: 50%;
39
+ transform: translate(-50%, -50%);
40
+ z-index: 10;
41
+ }
42
+ .shake {
43
+ animation: shake 0.5s;
44
+ }
45
+ @keyframes shake {
46
+ 0%, 100% { transform: translateX(0); }
47
+ 20%, 60% { transform: translateX(-5px); }
48
+ 40%, 80% { transform: translateX(5px); }
49
+ }
50
+ .locked-content {
51
+ filter: blur(5px);
52
+ pointer-events: none;
53
+ user-select: none;
54
+ }
55
+ .password-overlay {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ width: 100%;
60
+ height: 100%;
61
+ background-color: rgba(255, 255, 255, 0.9);
62
+ z-index: 5;
63
+ }
64
+ </style>
65
+ <!-- Main Content Area -->
66
+ <main class="container mx-auto px-4 py-8">
67
+ <!-- Password Protected Section -->
68
+ <div class="password-container bg-white rounded-xl shadow-lg p-6 mb-8 relative min-h-[500px]">
69
+ <!-- Password Overlay (only covers this section) -->
70
+ <div id="passwordOverlay" class="password-overlay"></div>
71
+
72
+ <!-- Password Box (centered within this section) -->
73
+ <div id="passwordBox" class="password-box">
74
+ <div class="flex justify-center mb-6">
75
+ <div class="bg-red-100 p-4 rounded-full">
76
+ <i class="fas fa-lock text-red-600 text-3xl"></i>
77
+ </div>
78
+ </div>
79
+ <h2 class="text-2xl font-bold text-gray-800 mb-2">BPS Price List</h2>
80
+ <p class="text-gray-600 mb-6">Enter password to access the pricing system</p>
81
+
82
+ <div class="mb-4">
83
+ <div class="relative">
84
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
85
+ <i class="fas fa-key text-gray-400"></i>
86
+ </div>
87
+ <input
88
+ type="password"
89
+ id="passwordInput"
90
+ 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"
91
+ placeholder="Enter password..."
92
+ autocomplete="off"
93
+ >
94
+ </div>
95
+ <p id="passwordError" class="text-red-500 text-sm mt-1 hidden">Incorrect password. Please try again.</p>
96
+ </div>
97
+
98
+ <button
99
+ id="passwordSubmit"
100
+ 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"
101
+ >
102
+ Unlock
103
+ </button>
104
+ </div>
105
+
106
+ <!-- Main Content (blurred and locked until password is entered) -->
107
+ <div id="mainContent" class="locked-content">
108
+ <div class="text-center mb-10">
109
+ <h1 class="text-4xl font-bold text-red-700 mb-2">BPS Price List</h1>
110
+ <p class="text-gray-600">Search for products to view pricing and information</p>
111
+ </div>
112
+
113
+ <div class="bg-white rounded-xl shadow-lg p-6 mb-8">
114
+ <div class="flex items-center mb-6">
115
+ <div class="flex-1 relative">
116
+ <label for="search" class="block text-sm font-medium text-gray-700 mb-1">Search by Best # or Description</label>
117
+ <div class="relative">
118
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
119
+ <i class="fas fa-search text-gray-400"></i>
120
+ </div>
121
+ <input
122
+ type="text"
123
+ id="search"
124
+ 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"
125
+ placeholder="Enter Best # or description..."
126
+ autocomplete="off"
127
+ >
128
+ <div id="clear-search" class="absolute inset-y-0 right-0 pr-3 flex items-center cursor-pointer hidden">
129
+ <i class="fas fa-times text-gray-400 hover:text-gray-600"></i>
130
+ </div>
131
+ </div>
132
+ <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>
133
+ </div>
134
+ <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">
135
+ Search
136
+ </button>
137
+ </div>
138
+ </div>
139
+
140
+ <div id="results" class="hidden bg-white rounded-xl shadow-lg overflow-hidden fade-in">
141
+ <div class="p-6 border-b border-gray-200 bg-red-50">
142
+ <h2 class="text-xl font-semibold text-red-800">Item Details</h2>
143
+ </div>
144
+
145
+ <div class="divide-y divide-gray-200">
146
+ <div id="result-content" class="p-6">
147
+ <!-- Results will be displayed here -->
148
+ </div>
149
+ </div>
150
+ </div>
151
+
152
+ <div id="loading" class="hidden text-center py-8">
153
+ <div class="inline-block animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-red-600 mb-2"></div>
154
+ <p class="text-gray-600">Loading data...</p>
155
+ </div>
156
+
157
+ <div id="no-results" class="hidden text-center py-8">
158
+ <i class="fas fa-exclamation-circle text-3xl text-gray-400 mb-3"></i>
159
+ <h3 class="text-lg font-medium text-gray-700">No results found</h3>
160
+ <p class="text-gray-500">Try a different search term</p>
161
+ </div>
162
+ </div>
163
+ </div>
164
+
165
+ </main>
166
+
167
+
168
+ <script>
169
+ // Password Protection
170
+ const passwordOverlay = document.getElementById('passwordOverlay');
171
+ const passwordInput = document.getElementById('passwordInput');
172
+ const passwordSubmit = document.getElementById('passwordSubmit');
173
+ const passwordError = document.getElementById('passwordError');
174
+ const passwordBox = document.getElementById('passwordBox');
175
+ const mainContent = document.getElementById('mainContent');
176
+
177
+ // Set your password here (in a real application, this would be server-side)
178
+ const CORRECT_PASSWORD = "BestPrice20256"; // Change this to your desired password
179
+
180
+ // Focus password input on page load
181
+ window.addEventListener('DOMContentLoaded', () => {
182
+ passwordInput.focus();
183
+ });
184
+
185
+ passwordSubmit.addEventListener('click', checkPassword);
186
+ passwordInput.addEventListener('keypress', function(e) {
187
+ if (e.key === 'Enter') {
188
+ checkPassword();
189
+ }
190
+ });
191
+
192
+ function checkPassword() {
193
+ if (passwordInput.value === CORRECT_PASSWORD) {
194
+ // Correct password
195
+ passwordOverlay.style.display = 'none';
196
+ passwordBox.style.display = 'none';
197
+ mainContent.classList.remove('locked-content');
198
+ } else {
199
+ // Incorrect password
200
+ passwordError.classList.remove('hidden');
201
+ passwordBox.classList.add('shake');
202
+ setTimeout(() => {
203
+ passwordBox.classList.remove('shake');
204
+ }, 500);
205
+ passwordInput.focus();
206
+ }
207
+ }
208
+
209
+ // BPS Price List data
210
+ const sheetData = [
211
+ { 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"},
212
+ { 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"},
213
+ { 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"},
214
+ { 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"},
215
+ { 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"},
216
+ { 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"},
217
+ ];
218
+
219
+ // DOM elements
220
+ const searchInput = document.getElementById('search');
221
+ const searchBtn = document.getElementById('search-btn');
222
+ const clearSearch = document.getElementById('clear-search');
223
+ const suggestions = document.getElementById('suggestions');
224
+ const results = document.getElementById('results');
225
+ const resultContent = document.getElementById('result-content');
226
+ const loading = document.getElementById('loading');
227
+ const noResults = document.getElementById('no-results');
228
+
229
+ // Event listeners
230
+ searchInput.addEventListener('input', handleInput);
231
+ searchBtn.addEventListener('click', handleSearch);
232
+ clearSearch.addEventListener('click', clearSearchInput);
233
+ document.addEventListener('click', closeSuggestions);
234
+
235
+ // Handle input for autocomplete
236
+ function handleInput() {
237
+ const searchTerm = searchInput.value.trim().toLowerCase();
238
+
239
+ if (searchTerm.length === 0) {
240
+ suggestions.classList.add('hidden');
241
+ clearSearch.classList.add('hidden');
242
+ return;
243
+ }
244
+
245
+ clearSearch.classList.remove('hidden');
246
+
247
+ const filteredItems = sheetData.filter(item =>
248
+ item.name.toLowerCase().includes(searchTerm) ||
249
+ item.id.toLowerCase().includes(searchTerm)
250
+ );
251
+
252
+ showSuggestions(filteredItems, searchTerm);
253
+ }
254
+
255
+ // Show autocomplete suggestions
256
+ function showSuggestions(items, searchTerm) {
257
+ if (items.length === 0) {
258
+ suggestions.classList.add('hidden');
259
+ return;
260
+ }
261
+
262
+ suggestions.innerHTML = '';
263
+ items.slice(0, 5).forEach(item => {
264
+ const suggestionItem = document.createElement('div');
265
+ suggestionItem.className = 'px-4 py-2 hover:bg-red-50 cursor-pointer flex items-center';
266
+
267
+ // Highlight matching text
268
+ const name = highlightMatch(item.name, searchTerm);
269
+ const id = highlightMatch(item.id, searchTerm);
270
+
271
+ suggestionItem.innerHTML = `
272
+ <span class="bg-red-100 text-red-800 text-xs font-medium px-2.5 py-0.5 rounded mr-3">${id}</span>
273
+ <span class="truncate">${name}</span>
274
+ `;
275
+
276
+ suggestionItem.addEventListener('click', () => {
277
+ searchInput.value = item.name;
278
+ suggestions.classList.add('hidden');
279
+ handleSearch();
280
+ });
281
+
282
+ suggestions.appendChild(suggestionItem);
283
+ });
284
+
285
+ suggestions.classList.remove('hidden');
286
+ }
287
+
288
+ // Highlight matching text in suggestions
289
+ function highlightMatch(text, searchTerm) {
290
+ if (!searchTerm) return text;
291
+
292
+ const regex = new RegExp(searchTerm, 'gi');
293
+ return text.replace(regex, match => `<span class="search-highlight">${match}</span>`);
294
+ }
295
+
296
+ // Close suggestions when clicking outside
297
+ function closeSuggestions(e) {
298
+ if (!suggestions.contains(e.target) && e.target !== searchInput) {
299
+ suggestions.classList.add('hidden');
300
+ }
301
+ }
302
+
303
+ // Clear search input
304
+ function clearSearchInput() {
305
+ searchInput.value = '';
306
+ suggestions.classList.add('hidden');
307
+ clearSearch.classList.add('hidden');
308
+ results.classList.add('hidden');
309
+ noResults.classList.add('hidden');
310
+ searchInput.focus();
311
+ }
312
+
313
+ // Handle search
314
+ function handleSearch() {
315
+ const searchTerm = searchInput.value.trim().toLowerCase();
316
+
317
+ if (searchTerm.length === 0) {
318
+ return;
319
+ }
320
+
321
+ // Show loading
322
+ results.classList.add('hidden');
323
+ noResults.classList.add('hidden');
324
+ loading.classList.remove('hidden');
325
+
326
+ // Simulate API delay
327
+ setTimeout(() => {
328
+ loading.classList.add('hidden');
329
+
330
+ const foundItem = sheetData.find(item =>
331
+ item.name.toLowerCase().includes(searchTerm) ||
332
+ item.id.toLowerCase().includes(searchTerm)
333
+ );
334
+
335
+ if (foundItem) {
336
+ displayResult(foundItem, searchTerm);
337
+ } else {
338
+ noResults.classList.remove('hidden');
339
+ }
340
+ }, 800);
341
+ }
342
+
343
+ // Display search result
344
+ function displayResult(item, searchTerm) {
345
+ // Highlight search term in the name
346
+ const highlightedName = highlightMatch(item.name, searchTerm);
347
+
348
+ resultContent.innerHTML = `
349
+ <div class="grid grid-cols-1 gap-6">
350
+ <div class="space-y-4">
351
+ <div>
352
+ <h3 class="text-2xl font-bold text-red-700">${highlightedName}</h3>
353
+ <p class="text-lg text-gray-600">Best #: <span class="font-medium">${item.id}</span></p>
354
+ </div>
355
+
356
+ <div class="bg-gray-50 p-4 rounded-lg">
357
+ <h4 class="text-lg font-semibold text-gray-800 mb-3">Pricing Information</h4>
358
+
359
+ <div class="overflow-x-auto">
360
+ <table class="min-w-full divide-y divide-gray-200">
361
+ <thead class="bg-gray-100">
362
+ <tr>
363
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Price Type</th>
364
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Price</th>
365
+ </tr>
366
+ </thead>
367
+ <tbody class="bg-white divide-y divide-gray-200">
368
+ <tr>
369
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Trade Price</td>
370
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.trade}</td>
371
+ </tr>
372
+ <tr>
373
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">GSA Price</td>
374
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.GSA}</td>
375
+ </tr>
376
+ <tr>
377
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Min Plus Price</td>
378
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.minPlus}</td>
379
+ </tr>
380
+ <tr>
381
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">List Price</td>
382
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">$${item.list}</td>
383
+ </tr>
384
+ </tbody>
385
+ </table>
386
+ </div>
387
+ </div>
388
+
389
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
390
+ <div class="bg-gray-50 p-4 rounded-lg">
391
+ <h4 class="text-lg font-semibold text-gray-800 mb-3">Additional Information</h4>
392
+ <div class="space-y-2">
393
+ <p class="text-sm"><span class="font-medium text-gray-700">Commission:</span> ${item.commission}%</p>
394
+ <p class="text-sm"><span class="font-medium text-gray-700">Generic:</span> ${item.generic || 'N/A'}</p>
395
+ </div>
396
+ </div>
397
+
398
+ <div class="bg-gray-50 p-4 rounded-lg">
399
+ <h4 class="text-lg font-semibold text-gray-800 mb-3">Categories</h4>
400
+ <div class="space-y-2">
401
+ <p class="text-sm"><span class="font-medium text-gray-700">New Categories:</span> ${item.newCat.replace(/,/g, ', ').substring(1)}</p>
402
+ <p class="text-sm"><span class="font-medium text-gray-700">Old Categories:</span> ${item.oldCat.replace(/,/g, ', ').substring(1)}</p>
403
+ </div>
404
+ </div>
405
+ </div>
406
+ </div>
407
+ </div>
408
+ `;
409
+
410
+ results.classList.remove('hidden');
411
+ }
412
+ </script>
413
+ <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>
414
+ </html>
prompts.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ add password protection that hides this code until password is entered.
2
+ add password protection that hides this code until password is entered.
3
+ this password protection can not block off all elements on the screen. it just needs to hide this element along
4
+ The password pop up can not block the entire page with a backsplace. it just needs to hide the module until the correct password is entered
5
+ this needs to be in a container where a header or footer for example is not blocked by this password pop up.
6
+ Just change all the purples to Red