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

374 lines
6.6 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 {
max-width: 1400px;
margin: 0 auto;
padding: 0 20px 20px;
}
.posts-section h2 {
margin-bottom: 30px;
color: #333;
font-size: 24px;
padding-top: 20px;
}
2026-01-28 12:02:55 +03:00
/* Сетка постов */
2025-12-11 01:12:45 +03:00
.posts-grid {
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-01-28 12:02:55 +03:00
/* Карточка поста - базовые стили */
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;
padding-bottom: 100%; /* Aspect ratio hack для надежности */
2025-12-11 01:12:45 +03:00
}
2026-01-28 12:02:55 +03:00
/* Большие карточки (десктоп) */
2025-12-11 01:12:45 +03:00
@media (min-width: 1200px) {
.post-card-large {
2026-01-28 12:02:55 +03:00
grid-column: span 2;
aspect-ratio: 2 / 1;
padding-bottom: 50%;
2025-12-11 01:12:45 +03:00
}
}
2026-01-28 12:02:55 +03:00
/* Hover эффекты */
2025-12-11 01:12:45 +03:00
.post-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
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-card-link {
2026-01-28 12:02:55 +03:00
position: absolute;
inset: 0;
2025-12-11 01:12:45 +03:00
display: block;
text-decoration: none;
color: inherit;
}
2026-01-28 12:02:55 +03:00
/* Контейнер изображения */
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-03-08 19:09:23 +03:00
2025-12-11 01:12:45 +03:00
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;
}
2026-03-08 19:09:23 +03:00
2025-12-11 01:12:45 +03:00
.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;
}
2026-03-08 19:09:23 +03:00
.category-badge-white{
background-color: white;
color: black;
}
2025-12-11 01:12:45 +03:00
.author-name {
font-size: 12px;
color: rgba(255, 255, 255, 0.85);
margin-top: 3px;
font-weight: 400;
}
2026-01-28 14:46:51 +03:00
/* Убедитесь что индикаторы не занимают лишнее место */
#infinity-scroll-sentinel {
height: 1px;
width: 100%;
visibility: hidden;
pointer-events: none;
}
.loading-indicator {
text-align: center;
padding: 40px 0;
color: #666;
min-height: auto; /* ← Важно! */
}
.no-more-posts {
text-align: center;
padding: 30px 0;
color: #666;
font-size: 16px;
border-top: 1px solid #eee;
margin-top: 20px;
min-height: auto; /* ← Важно! */
}
2026-01-28 12:02:55 +03:00
/* Улучшения для больших карточек */
2025-12-11 01:12:45 +03:00
@media (min-width: 1200px) {
2026-01-28 12:02:55 +03:00
.post-card-large .post-category-badge {
font-size: 12px;
padding: 6px 12px;
}
.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-01-28 12:02:55 +03:00
/* Ноутбуки: 3 колонки */
2025-12-11 01:12:45 +03:00
@media (min-width: 992px) and (max-width: 1199px) {
.posts-grid {
2026-01-28 12:02:55 +03:00
grid-template-columns: repeat(3, 1fr);
2025-12-11 01:12:45 +03:00
}
.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-01-28 12:02:55 +03:00
/* Планшеты: 2 колонки */
2025-12-11 01:12:45 +03:00
@media (min-width: 768px) and (max-width: 991px) {
.posts-grid {
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
}
.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-01-28 12:02:55 +03:00
/* Мобильные: 1 колонка */
2025-12-11 01:12:45 +03:00
@media (max-width: 767px) {
.posts-grid {
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
}
.post-card {
2026-01-28 12:02:55 +03:00
aspect-ratio: 2 / 1;
padding-bottom: 50%;
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;
}
.post-category-badge {
top: 12px;
right: 12px;
font-size: 10px;
padding: 4px 8px;
}
}
2026-01-28 12:02:55 +03:00
/* Очень маленькие экраны */
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;
}
.post-category-badge {
top: 10px;
right: 10px;
padding: 3px 6px;
font-size: 9px;
}
}
2026-01-28 12:02:55 +03:00
/* Вспомогательные классы */
.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;
}
/* Состояния загрузки */
.loading-indicator {
text-align: center;
padding: 40px 0;
color: #666;
}
.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;
}
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
}
@media (max-width: 767px) {
.loading-spinner {
width: 30px;
height: 30px;
}
.no-more-posts {
padding: 20px 0;
}
}