80 lines
1.7 KiB
HTML
80 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="it">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<title>Galleria foto</title>
|
||
<style>
|
||
body { font-family: sans-serif; margin: 0; padding: 0; }
|
||
.gallery {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||
gap: 8px;
|
||
padding: 8px;
|
||
}
|
||
.thumb {
|
||
cursor: pointer;
|
||
overflow: hidden;
|
||
border-radius: 4px;
|
||
border: 1px solid #ddd;
|
||
}
|
||
.thumb img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
display: block;
|
||
}
|
||
/* Modal */
|
||
.modal {
|
||
position: fixed;
|
||
inset: 0;
|
||
background: rgba(0,0,0,0.8);
|
||
display: none;
|
||
align-items: center;
|
||
justify-content: center;
|
||
z-index: 1000;
|
||
}
|
||
.modal.open {
|
||
display: flex;
|
||
}
|
||
.modal-content {
|
||
max-width: 90vw;
|
||
max-height: 90vh;
|
||
position: relative;
|
||
}
|
||
.modal-content img {
|
||
max-width: 100%;
|
||
max-height: 100%;
|
||
display: block;
|
||
}
|
||
.modal-close {
|
||
position: absolute;
|
||
top: -10px;
|
||
right: -10px;
|
||
background: #fff;
|
||
border-radius: 50%;
|
||
width: 28px;
|
||
height: 28px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
cursor: pointer;
|
||
font-weight: bold;
|
||
border: 1px solid #ccc;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<h1 style="margin: 8px;">Galleria foto</h1>
|
||
<div id="gallery" class="gallery"></div>
|
||
|
||
<!-- Modal -->
|
||
<div id="modal" class="modal">
|
||
<div class="modal-content">
|
||
<div class="modal-close" id="modalClose">×</div>
|
||
<img id="modalImage" src="" alt="">
|
||
</div>
|
||
</div>
|
||
|
||
<script src="app.js"></script>
|
||
</body>
|
||
</html>
|