Files
ptp/static/css/hugo-easy-gallery.css
T
2025-08-02 11:45:16 +02:00

141 lines
2.7 KiB
CSS

/*
Simple Gallery CSS - Small thumbnails in rows
*/
/* Основные стили галереи */
.gallery {
display: flex;
flex-wrap: wrap;
gap: 5px;
padding: 10px;
max-width: 1400px;
margin: 0 auto;
justify-content: center;
}
/* Контейнер изображения */
.gallery .box {
width: 300px;
height: 300px;
transition: transform 0.2s ease;
border: 3px solid white;
border-radius: 20px;
}
/* Эффект наведения */
.gallery .box:hover {
transform: scale(1.05);
}
/* Figure элемент */
.gallery figure {
width: 100%;
height: 100%;
margin: 0;
position: relative;
overflow: hidden;
border: none;
}
/* Изображение */
.gallery .img {
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
border-radius: 20px;
}
/* Скрываем обычные img теги */
.gallery img {
display: none;
}
/* Ссылка на полное изображение */
.gallery figure a {
display: block;
width: 100%;
height: 100%;
}
/* Подпись скрыта для компактности */
.gallery figcaption {
display: none;
}
/* Адаптивность */
@media (max-width: 768px) {
.gallery .box {
width: 100px;
height: 100px;
}
.gallery {
gap: 6px;
}
}
@media (max-width: 480px) {
.gallery .box {
width: 80px;
height: 80px;
border-radius: 6px;
}
.gallery {
gap: 4px;
padding: 8px;
}
}
/* Эффекты для подписей */
.gallery.caption-effect-fade figcaption {
background: rgba(0, 0, 0, 0.7);
transform: none;
opacity: 0;
transition: opacity 0.3s ease;
}
.gallery.caption-effect-fade .box:hover figcaption {
opacity: 1;
}
.gallery.caption-position-center figcaption {
top: 50%;
bottom: auto;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.7);
text-align: center;
padding: 16px;
}
.gallery.caption-position-center .box:hover figcaption {
transform: translateY(-50%);
}
.gallery.caption-position-none figcaption {
display: none;
}
/* Отдельные figure элементы (не в галерее) */
.box:not(.gallery .box) {
display: inline-block;
margin: 10px;
max-width: 300px;
}
.box:not(.gallery .box) figure {
position: relative;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.box:not(.gallery .box) .img {
position: relative;
width: 100%;
height: 200px;
background-size: cover;
background-position: center;
}