Files
profile-front/src/styles/components/ContentGrid.css

349 lines
6.9 KiB
CSS
Raw Normal View History

2025-12-11 01:12:45 +03:00
/* styles/components/ContentGrid.css */
2026-01-28 12:02:55 +03:00
/* CSS переменные */
:root {
--grid-gap: 20px;
--grid-gap-tablet: 15px;
--border-radius: 10px;
--transition-speed: 0.3s;
--overlay-padding: 20px 15px 15px;
--overlay-padding-large: 25px 20px 20px;
}
2025-12-11 01:12:45 +03:00
.posts-section h2 {
margin-bottom: 30px;
color: #333;
font-size: 24px;
padding-top: 20px;
}
2026-03-08 23:57:41 +03:00
/* ===== СЕТКИ С РАЗНЫМ КОЛИЧЕСТВОМ КОЛОНОК ===== */
/* Сетка на 4 колонки (по умолчанию) */
.posts-grid-4 {
2026-01-28 12:02:55 +03:00
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--grid-gap);
2025-12-11 01:12:45 +03:00
width: 100%;
}
2026-03-08 23:57:41 +03:00
/* Сетка на 3 колонки */
.posts-grid-3 {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--grid-gap);
width: 100%;
}
/* Базовый класс для обратной совместимости */
.posts-grid {
display: grid;
gap: var(--grid-gap);
width: 100%;
}
/* ===== КАРТОЧКИ ПОСТОВ ===== */
2025-12-11 01:12:45 +03:00
.post-card {
background: white;
2026-01-28 12:02:55 +03:00
border-radius: var(--border-radius);
2025-12-11 01:12:45 +03:00
overflow: hidden;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
2026-01-28 12:02:55 +03:00
transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
2025-12-11 01:12:45 +03:00
aspect-ratio: 1 / 1;
position: relative;
2026-01-28 12:02:55 +03:00
display: flex;
flex-direction: column;
height: 0;
2026-03-08 23:57:41 +03:00
padding-bottom: 100%;
2025-12-11 01:12:45 +03:00
}
2026-01-28 12:02:55 +03:00
.post-card:hover .post-image {
transform: scale(1.05);
}
/* Контейнер изображения */
2025-12-11 01:12:45 +03:00
.post-image-container {
2026-01-28 12:02:55 +03:00
position: absolute;
inset: 0;
2025-12-11 01:12:45 +03:00
overflow: hidden;
}
2026-01-28 12:02:55 +03:00
/* Изображение */
2025-12-11 01:12:45 +03:00
.post-image {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
2026-01-28 12:02:55 +03:00
transition: transform var(--transition-speed) ease;
2025-12-11 01:12:45 +03:00
}
.post-image-placeholder {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
2026-01-28 12:02:55 +03:00
/* Оверлей с контентом */
2025-12-11 01:12:45 +03:00
.post-content-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
2026-01-28 12:02:55 +03:00
padding: var(--overlay-padding);
2025-12-11 01:12:45 +03:00
background: linear-gradient(
to top,
rgba(0, 0, 0, 0.9) 0%,
rgba(0, 0, 0, 0.7) 50%,
rgba(0, 0, 0, 0) 100%
);
color: white;
display: flex;
flex-direction: column;
gap: 8px;
}
.post-meta-overlay {
margin-bottom: 3px;
}
.post-date-overlay {
font-size: 12px;
color: rgba(255, 255, 255, 0.9);
font-weight: 400;
}
.post-title-overlay {
font-size: 16px;
line-height: 1.3;
font-weight: 600;
margin: 0;
color: white;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.author-name {
font-size: 12px;
color: rgba(255, 255, 255, 0.85);
margin-top: 3px;
font-weight: 400;
}
2026-03-08 23:57:41 +03:00
.author-link {
color: white;
text-decoration: none;
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
transition: border-color var(--transition-speed) ease;
2026-01-28 14:46:51 +03:00
}
2026-03-08 23:57:41 +03:00
.author-link:hover {
border-bottom-color: white;
2026-01-28 14:46:51 +03:00
}
2026-03-08 23:57:41 +03:00
/* ===== АДАПТИВНОСТЬ ДЛЯ РАЗНЫХ ЭКРАНОВ ===== */
2026-01-28 14:46:51 +03:00
2026-03-08 23:57:41 +03:00
/* Десктоп (1200px и больше) */
2025-12-11 01:12:45 +03:00
@media (min-width: 1200px) {
2026-03-08 23:57:41 +03:00
/* Для сетки 4 колонки - большие карточки на 2 колонки */
.posts-grid-4 .post-card-large {
grid-column: span 2;
2026-03-16 15:52:46 +03:00
aspect-ratio: 2 / 0.965;
padding-bottom: 48.3%;
2026-01-28 12:02:55 +03:00
}
2026-03-08 23:57:41 +03:00
/* Для сетки 3 колонки - большие карточки на 2 колонки */
.posts-grid-3 .post-card-large {
grid-column: span 2;
aspect-ratio: 2 / 1;
padding-bottom: 50%;
}
/* Улучшения для больших карточек */
2026-01-28 12:02:55 +03:00
.post-card-large .post-content-overlay {
padding: var(--overlay-padding-large);
gap: 10px;
}
.post-card-large .post-date-overlay {
font-size: 13px;
}
.post-card-large .post-title-overlay {
font-size: 18px;
line-height: 1.4;
}
2025-12-11 01:12:45 +03:00
.post-card-large .author-name {
font-size: 13px;
margin-top: 5px;
}
}
2026-03-08 23:57:41 +03:00
/* Ноутбуки (992px - 1199px) */
2025-12-11 01:12:45 +03:00
@media (min-width: 992px) and (max-width: 1199px) {
2026-03-08 23:57:41 +03:00
/* Все сетки переходят на 3 колонки */
.posts-grid-4,
.posts-grid-3 {
2026-01-28 12:02:55 +03:00
grid-template-columns: repeat(3, 1fr);
2025-12-11 01:12:45 +03:00
}
2026-03-08 23:57:41 +03:00
/* Большие карточки становятся обычными */
.posts-grid-4 .post-card-large,
.posts-grid-3 .post-card-large {
2026-01-28 12:02:55 +03:00
grid-column: span 1;
aspect-ratio: 1 / 1;
padding-bottom: 100%;
2025-12-11 01:12:45 +03:00
}
}
2026-03-08 23:57:41 +03:00
/* Планшеты (768px - 991px) */
2025-12-11 01:12:45 +03:00
@media (min-width: 768px) and (max-width: 991px) {
2026-03-08 23:57:41 +03:00
/* Все сетки переходят на 2 колонки */
.posts-grid-4,
.posts-grid-3 {
2026-01-28 12:02:55 +03:00
grid-template-columns: repeat(2, 1fr);
gap: var(--grid-gap-tablet);
2025-12-11 01:12:45 +03:00
}
2026-03-08 23:57:41 +03:00
/* Большие карточки становятся обычными */
.posts-grid-4 .post-card-large,
.posts-grid-3 .post-card-large {
2026-01-28 12:02:55 +03:00
grid-column: span 1;
aspect-ratio: 1 / 1;
padding-bottom: 100%;
2025-12-11 01:12:45 +03:00
}
.post-title-overlay {
font-size: 15px;
}
}
2026-03-08 23:57:41 +03:00
/* Мобильные (до 767px) */
2025-12-11 01:12:45 +03:00
@media (max-width: 767px) {
2026-03-08 23:57:41 +03:00
/* Все сетки переходят на 1 колонку */
.posts-grid-4,
.posts-grid-3 {
2026-01-28 12:02:55 +03:00
grid-template-columns: 1fr;
gap: var(--grid-gap-tablet);
2025-12-11 01:12:45 +03:00
}
2026-03-08 23:57:41 +03:00
.post-card,
2025-12-11 01:12:45 +03:00
.post-card-large {
2026-01-28 12:02:55 +03:00
aspect-ratio: 2 / 1;
padding-bottom: 50%;
2025-12-11 01:12:45 +03:00
}
.posts-section {
padding: 0 15px 15px;
}
.posts-section h2 {
padding-top: 15px;
}
.post-content-overlay {
padding: 15px 12px 12px;
}
.post-title-overlay {
font-size: 15px;
}
}
2026-03-08 23:57:41 +03:00
/* Очень маленькие экраны (до 480px) */
2025-12-11 01:12:45 +03:00
@media (max-width: 480px) {
2026-01-28 12:02:55 +03:00
.post-card,
2025-12-11 01:12:45 +03:00
.post-card-large {
2026-01-28 12:02:55 +03:00
aspect-ratio: 3 / 2;
padding-bottom: 66.67%;
2025-12-11 01:12:45 +03:00
}
.post-content-overlay {
padding: 12px 10px 10px;
gap: 5px;
}
.post-title-overlay {
font-size: 14px;
}
}
2026-03-08 23:57:41 +03:00
/* ===== ИНДИКАТОРЫ ЗАГРУЗКИ ===== */
#infinity-scroll-sentinel {
2026-01-28 12:02:55 +03:00
height: 1px;
2026-03-08 23:57:41 +03:00
width: 100%;
visibility: hidden;
pointer-events: none;
2026-01-28 12:02:55 +03:00
}
.loading-indicator {
text-align: center;
padding: 40px 0;
color: #666;
2026-03-08 23:57:41 +03:00
min-height: auto;
2026-01-28 12:02:55 +03:00
}
.loading-spinner {
display: inline-block;
width: 40px;
height: 40px;
border: 3px solid #f3f3f3;
border-top: 3px solid #2563eb;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 10px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.no-more-posts {
text-align: center;
padding: 30px 0;
color: #666;
font-size: 16px;
border-top: 1px solid #eee;
margin-top: 20px;
2026-03-08 23:57:41 +03:00
min-height: auto;
}
/* ===== ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ ===== */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
2026-01-28 12:02:55 +03:00
}
2025-12-11 01:12:45 +03:00
.no-posts {
text-align: center;
padding: 40px;
color: #666;
font-size: 18px;
2026-01-28 12:02:55 +03:00
}
2026-03-08 23:57:41 +03:00
/* Мобильные адаптации для индикаторов */
2026-01-28 12:02:55 +03:00
@media (max-width: 767px) {
.loading-spinner {
width: 30px;
height: 30px;
}
.no-more-posts {
padding: 20px 0;
}
2026-03-08 23:57:41 +03:00
}