my_gallery/style.css
2026-02-21 09:44:33 +01:00

127 lines
1.8 KiB
CSS

body {
font-family: sans-serif;
margin: 0;
padding: 0;
background: #fafafa;
}
header {
padding: 10px 15px;
background: #333;
color: white;
}
.gallery {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 8px;
padding: 10px;
}
.thumb {
cursor: pointer;
overflow: hidden;
border-radius: 4px;
border: 1px solid #ddd;
background: white;
}
.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;
}
/* Info Button */
.modal-info-btn {
position: absolute;
bottom: -10px;
right: 40px;
background: #fff;
border-radius: 50%;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border: 1px solid #ccc;
font-size: 16px;
z-index: 1500;
}
/* Info Panel */
.info-panel {
position: fixed;
top: 0;
right: -320px;
width: 320px;
height: 100%;
background: #fff;
padding: 16px;
box-shadow: -2px 0 6px rgba(0,0,0,0.25);
transition: right 0.3s ease;
overflow-y: auto;
z-index: 2000;
}
.info-panel.open {
right: 0;
}
.info-panel h3 {
margin-top: 0;
}
.info-row {
margin-bottom: 10px;
}
.info-row b {
display: inline-block;
width: 110px;
}