1
0

YT Thumb: Design Fixes & Download-Button entfernt

This commit is contained in:
Akamaru
2025-04-28 20:57:28 +02:00
parent 5009f7cccb
commit 4d002f30a9

View File

@@ -16,7 +16,7 @@
font-family: 'Segoe UI', Arial, sans-serif; font-family: 'Segoe UI', Arial, sans-serif;
text-align: center; text-align: center;
margin: 0; margin: 0;
padding: 20px 20px 0 20px; padding: 20px 20px 60px 20px; /* Erhöhtes Padding unten für Footer */
background-color: #f5f5f5; background-color: #f5f5f5;
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
@@ -70,10 +70,11 @@
.thumbnail-container { .thumbnail-container {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 30px; gap: 50px; /* Erhöhter Abstand zwischen den Thumbnails */
padding: 20px; padding: 20px;
max-width: 1200px; max-width: 1200px;
margin: 0 auto; margin: 0 auto;
margin-bottom: 60px; /* Zusätzlicher Abstand zum Footer */
flex: 1; flex: 1;
} }
@@ -83,22 +84,36 @@
padding: 15px; padding: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease; transition: transform 0.3s ease;
display: flex;
flex-direction: column;
height: 100%;
} }
.thumbnail:hover { .thumbnail:hover {
transform: translateY(-5px); transform: translateY(-5px);
} }
.thumbnail-image {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
margin-bottom: 10px;
}
img { img {
width: 100%; width: 100%;
height: auto; height: auto;
border-radius: 8px; border-radius: 8px;
margin-bottom: 10px; object-fit: contain;
}
.thumbnail-info {
margin-top: auto;
} }
.button-group { .button-group {
display: flex; display: flex;
gap: 10px;
justify-content: center; justify-content: center;
margin-top: 10px; margin-top: 10px;
} }
@@ -107,6 +122,7 @@
padding: 8px 15px; padding: 8px 15px;
font-size: 14px; font-size: 14px;
background-color: #444; background-color: #444;
width: 100%;
} }
.button-group button:hover { .button-group button:hover {
@@ -208,6 +224,11 @@
<div id="toast" class="toast"></div> <div id="toast" class="toast"></div>
<script> <script>
// Jahr für das Copyright aktualisieren
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('current-year').textContent = new Date().getFullYear();
});
function handleEnter(event) { function handleEnter(event) {
if (event.key === 'Enter') { if (event.key === 'Enter') {
fetchThumbnails(); fetchThumbnails();
@@ -240,11 +261,20 @@
const thumbDiv = document.createElement('div'); const thumbDiv = document.createElement('div');
thumbDiv.className = 'thumbnail'; thumbDiv.className = 'thumbnail';
const thumbImageDiv = document.createElement('div');
thumbImageDiv.className = 'thumbnail-image';
const img = new Image(); const img = new Image();
img.src = thumbUrl; img.src = thumbUrl;
img.alt = `Thumbnail ${size.label}`; img.alt = `Thumbnail ${size.label}`;
img.loading = 'lazy'; img.loading = 'lazy';
thumbImageDiv.appendChild(img);
thumbDiv.appendChild(thumbImageDiv);
const thumbInfoDiv = document.createElement('div');
thumbInfoDiv.className = 'thumbnail-info';
const label = document.createElement('p'); const label = document.createElement('p');
label.className = 'label'; label.className = 'label';
label.textContent = size.label; label.textContent = size.label;
@@ -261,21 +291,12 @@
} }
}); });
const downloadButton = createButton('⬇️ Herunterladen', () => {
const link = document.createElement('a');
link.href = thumbUrl;
link.download = `thumbnail_${size.code}.jpg`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
});
buttonGroup.appendChild(copyButton); buttonGroup.appendChild(copyButton);
buttonGroup.appendChild(downloadButton);
thumbDiv.appendChild(img); thumbInfoDiv.appendChild(label);
thumbDiv.appendChild(label); thumbInfoDiv.appendChild(buttonGroup);
thumbDiv.appendChild(buttonGroup); thumbDiv.appendChild(thumbInfoDiv);
container.appendChild(thumbDiv); container.appendChild(thumbDiv);
}); });
} }
@@ -318,9 +339,6 @@
toast.classList.remove('visible'); toast.classList.remove('visible');
}, 3000); }, 3000);
} }
// Jahr für das Copyright aktualisieren
document.getElementById('current-year').textContent = new Date().getFullYear();
</script> </script>
<footer> <footer>