This commit is contained in:
Adam Šrámek 2024-06-06 09:03:37 +02:00
parent c1112d8b21
commit 5f58589713
4 changed files with 89 additions and 1 deletions

8
scripty/galeria.js Normal file

@ -0,0 +1,8 @@
function downloadImage(imageUrl) {
const link = document.createElement('a');
link.href = imageUrl;
link.download = imageUrl.split('/').pop();
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}

@ -133,4 +133,7 @@
<option value="Akčná adventúra">Akčná adventúra</option> <option value="Akčná adventúra">Akčná adventúra</option>
<option value="RPG">RPG</option> <option value="RPG">RPG</option>
<option value="Stratégia">Stratégia</option> <option value="Stratégia">Stratégia</option>
<option value="Simulátor">Simul <option value="Simulátor">Simul</option>
</select>
</div>
</form>

38
stranky/galeria.html Normal file

@ -0,0 +1,38 @@
<div class="gallery">
<div class="gallery-item">
<img src="path/to/image1.jpg" alt="Image 1">
<button onclick="downloadImage('path/to/image1.jpg')">Download</button>
</div>
<div class="gallery-item">
<img src="path/to/image2.jpg" alt="Image 2">
<button onclick="downloadImage('path/to/image2.jpg')">Download</button>
</div>
<div class="gallery-item">
<img src="path/to/image2.jpg" alt="Image 2">
<button onclick="downloadImage('path/to/image2.jpg')">Download</button>
</div>
<div class="gallery-item">
<img src="path/to/image2.jpg" alt="Image 2">
<button onclick="downloadImage('path/to/image2.jpg')">Download</button>
</div>
<div class="gallery-item">
<img src="path/to/image2.jpg" alt="Image 2">
<button onclick="downloadImage('path/to/image2.jpg')">Download</button>
</div>
<div class="gallery-item">
<img src="path/to/image2.jpg" alt="Image 2">
<button onclick="downloadImage('path/to/image2.jpg')">Download</button>
</div>
<div class="gallery-item">
<img src="path/to/image2.jpg" alt="Image 2">
<button onclick="downloadImage('path/to/image2.jpg')">Download</button>
</div>
<div class="gallery-item">
<img src="path/to/image2.jpg" alt="Image 2">
<button onclick="downloadImage('path/to/image2.jpg')">Download</button>
</div>
<div class="gallery-item">
<img src="path/to/image2.jpg" alt="Image 2">
<button onclick="downloadImage('path/to/image2.jpg')">Download</button>
</div>
</div>

39
styly/galeria.css Normal file

@ -0,0 +1,39 @@
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
.gallery {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.gallery-item {
position: relative;
text-align: center;
}
.gallery-item img {
width: 100%;
height: auto;
display: block;
}
.gallery-item button {
margin-top: 5px;
padding: 5px 10px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.gallery-item button:hover {
background-color: #0056b3;
}