Update main.py
Browse files
main.py
CHANGED
@@ -100,18 +100,10 @@ def proxy(path):
|
|
100 |
# Replace the text with empty string
|
101 |
element.replace_with('')
|
102 |
|
103 |
-
# Filter out README content
|
104 |
for element in soup.find_all(string=re.compile('README', re.IGNORECASE)):
|
105 |
element.replace_with('')
|
106 |
|
107 |
-
# Remove zoom links (+/-) and "Image not loaded?" link
|
108 |
-
for link in soup.find_all('a'):
|
109 |
-
href = link.get('href', '')
|
110 |
-
if 'zoom=' in href or link.string == '+' or link.string == '-':
|
111 |
-
link.decompose()
|
112 |
-
elif link.string and 'Не загрузилось изображение?' in link.string:
|
113 |
-
link.decompose()
|
114 |
-
|
115 |
# Redirect part number links to Google search
|
116 |
# Look for links that contain part numbers (typically in the second column of the table)
|
117 |
part_number_links = soup.select('td:nth-child(2) a')
|
@@ -185,7 +177,7 @@ def proxy(path):
|
|
185 |
var isDragging = false;
|
186 |
var startX, startY, translateX = 0, translateY = 0;
|
187 |
|
188 |
-
// Add zoom controls
|
189 |
var zoomControls = document.createElement('div');
|
190 |
zoomControls.className = 'zoom-controls';
|
191 |
zoomControls.innerHTML = `
|
@@ -193,11 +185,7 @@ def proxy(path):
|
|
193 |
<button class="zoom-btn" onclick="changeZoom(-0.1)">-</button>
|
194 |
<button class="zoom-btn" onclick="resetZoom()">Reset</button>
|
195 |
`;
|
196 |
-
|
197 |
-
closeContainer.className = 'close-container';
|
198 |
-
closeContainer.appendChild(zoomControls);
|
199 |
-
closeContainer.appendChild(closeBtn);
|
200 |
-
modal.appendChild(closeContainer);
|
201 |
|
202 |
// Zoom functions
|
203 |
window.changeZoom = function(delta) {
|
@@ -494,45 +482,41 @@ def proxy(path):
|
|
494 |
transform: scale(1);
|
495 |
}
|
496 |
|
497 |
-
.close-container {
|
498 |
-
position: absolute;
|
499 |
-
top: 15px;
|
500 |
-
right: 25px;
|
501 |
-
display: flex;
|
502 |
-
align-items: center;
|
503 |
-
gap: 15px;
|
504 |
-
z-index: 1001;
|
505 |
-
}
|
506 |
-
|
507 |
.zoom-controls {
|
|
|
|
|
|
|
|
|
508 |
display: flex;
|
509 |
-
gap:
|
|
|
510 |
}
|
511 |
|
512 |
.zoom-btn {
|
513 |
background: rgba(255, 255, 255, 0.2);
|
514 |
border: 1px solid rgba(255, 255, 255, 0.4);
|
515 |
color: white;
|
516 |
-
padding:
|
517 |
border-radius: 4px;
|
518 |
cursor: pointer;
|
519 |
-
font-size:
|
520 |
transition: all 0.2s ease;
|
521 |
}
|
522 |
|
523 |
.zoom-btn:hover {
|
524 |
background: rgba(255, 255, 255, 0.3);
|
525 |
-
transform: translateY(-1px);
|
526 |
}
|
527 |
|
528 |
.close {
|
|
|
|
|
|
|
529 |
color: #f1f1f1;
|
530 |
-
font-size:
|
531 |
font-weight: bold;
|
532 |
cursor: pointer;
|
533 |
-
|
534 |
-
|
535 |
-
line-height: 1;
|
536 |
}
|
537 |
|
538 |
.close:hover {
|
|
|
100 |
# Replace the text with empty string
|
101 |
element.replace_with('')
|
102 |
|
103 |
+
# Filter out README content
|
104 |
for element in soup.find_all(string=re.compile('README', re.IGNORECASE)):
|
105 |
element.replace_with('')
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
# Redirect part number links to Google search
|
108 |
# Look for links that contain part numbers (typically in the second column of the table)
|
109 |
part_number_links = soup.select('td:nth-child(2) a')
|
|
|
177 |
var isDragging = false;
|
178 |
var startX, startY, translateX = 0, translateY = 0;
|
179 |
|
180 |
+
// Add zoom controls
|
181 |
var zoomControls = document.createElement('div');
|
182 |
zoomControls.className = 'zoom-controls';
|
183 |
zoomControls.innerHTML = `
|
|
|
185 |
<button class="zoom-btn" onclick="changeZoom(-0.1)">-</button>
|
186 |
<button class="zoom-btn" onclick="resetZoom()">Reset</button>
|
187 |
`;
|
188 |
+
modal.appendChild(zoomControls);
|
|
|
|
|
|
|
|
|
189 |
|
190 |
// Zoom functions
|
191 |
window.changeZoom = function(delta) {
|
|
|
482 |
transform: scale(1);
|
483 |
}
|
484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
.zoom-controls {
|
486 |
+
position: fixed;
|
487 |
+
bottom: 20px;
|
488 |
+
left: 50%;
|
489 |
+
transform: translateX(-50%);
|
490 |
display: flex;
|
491 |
+
gap: 10px;
|
492 |
+
z-index: 1001;
|
493 |
}
|
494 |
|
495 |
.zoom-btn {
|
496 |
background: rgba(255, 255, 255, 0.2);
|
497 |
border: 1px solid rgba(255, 255, 255, 0.4);
|
498 |
color: white;
|
499 |
+
padding: 8px 16px;
|
500 |
border-radius: 4px;
|
501 |
cursor: pointer;
|
502 |
+
font-size: 16px;
|
503 |
transition: all 0.2s ease;
|
504 |
}
|
505 |
|
506 |
.zoom-btn:hover {
|
507 |
background: rgba(255, 255, 255, 0.3);
|
|
|
508 |
}
|
509 |
|
510 |
.close {
|
511 |
+
position: absolute;
|
512 |
+
top: 15px;
|
513 |
+
right: 25px;
|
514 |
color: #f1f1f1;
|
515 |
+
font-size: 40px;
|
516 |
font-weight: bold;
|
517 |
cursor: pointer;
|
518 |
+
z-index: 1001;
|
519 |
+
transition: color 0.3s ease;
|
|
|
520 |
}
|
521 |
|
522 |
.close:hover {
|