mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 04:29:45 +00:00
80 lines
3.0 KiB
SCSS
80 lines
3.0 KiB
SCSS
$news-card-gap: 1em;
|
|
|
|
#news-list {
|
|
.row {
|
|
display: flex;
|
|
flex-wrap: wrap; // Чтобы карточки корректно переносились
|
|
gap: $news-card-gap;
|
|
justify-content: space-between; // Равномерное распределение карточек
|
|
|
|
.card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
position: relative;
|
|
border: none;
|
|
margin-bottom: 1em; // Отступ снизу
|
|
|
|
@media (max-width: 768px) {
|
|
width: 100%; // 1 карточка в ряд на мобильных
|
|
height: 215px; // Меньшая высота для мобильных
|
|
}
|
|
|
|
.pic {
|
|
aspect-ratio: 1 / 1;
|
|
position: relative;
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: 8px; // Округляем углы изображения
|
|
overflow: hidden; // Обрезаем лишнее
|
|
|
|
&::before {
|
|
content: "";
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 40%;
|
|
/* Градиент покрывает 40% карточки */
|
|
background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
|
|
border-radius: 8px;
|
|
pointer-events: none;
|
|
/* Не мешает взаимодействию */
|
|
z-index: 0;
|
|
/* Градиент уходит в фон */
|
|
}
|
|
|
|
.image {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
object-position: top; // Устанавливаем позицию обрезки сверху
|
|
border-radius: 8px; // Округление углов изображения
|
|
pointer-events: none;
|
|
}
|
|
|
|
.label {
|
|
position: absolute;
|
|
width: 100%;
|
|
min-height: 15%;
|
|
padding: clamp(12px, 3vw, 22px) clamp(6px, 1.5vw, 16px);
|
|
left: 0;
|
|
bottom: 0;
|
|
border-radius: 0 0 8px 8px;
|
|
font-size: clamp(10px, 1.5vw, 20px);
|
|
font-weight: 600;
|
|
line-height: clamp(12px, 2vw, 24px);
|
|
color: white;
|
|
|
|
//background: rgba(0, 0, 0, 0.6);
|
|
//background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
|
|
@media (max-width: 768px) {
|
|
padding: 22px 16px;
|
|
font-size: 20px;
|
|
line-height: 24px;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |