Шаблон:Main page/navigation/styles.css: различия между версиями
Материал из Aavikko
Дополнительные действия
DeRecnad (обсуждение | вклад) мНет описания правки |
KoTiKo43 (обсуждение | вклад) Обновление css для навигации заглавной страницы Метка: отменено |
||
| Строка 1: | Строка 1: | ||
/* ============================================ | |||
Главная страница — навигация по секциям | |||
============================================ */ | |||
.home- | .home-nav-sections { | ||
margin-top: 1.5rem; | |||
} | } | ||
.home- | /* Заголовки секций */ | ||
.home-section-title { | |||
font-family: 'Segoe UI', 'Inter', system-ui, sans-serif; | |||
font-size: 1.6rem; | |||
font-weight: 700; | |||
color: #ffffff; | |||
margin: 2rem 0 1rem 0; | |||
padding-bottom: 0.5rem; | |||
border-bottom: 2px solid #1981d5; | |||
display: flex; | |||
align-items: center; | |||
gap: 0.6rem; | |||
} | } | ||
.home- | .home-section-title::before { | ||
content: '◆'; | |||
color: #ff6600; | |||
font-size: 1.2rem; | |||
} | } | ||
.home- | /* Первая секция — без верхнего отступа */ | ||
.home-nav-sections .home-section-title:first-child { | |||
margin-top: 0; | |||
} | } | ||
/* ============================================ | |||
Сетка карточек | |||
============================================ */ | |||
.home- | .home-grid { | ||
display: grid; | |||
grid-template-columns: repeat(4, 1fr); | |||
gap: 16px; | |||
margin: 1rem 0 2rem 0; | |||
} | } | ||
.home- | /* При ширине < 1200px — 3 колонки */ | ||
@media (max-width: 1200px) { | |||
.home-grid { | |||
grid-template-columns: repeat(3, 1fr); | |||
} | |||
} | } | ||
.home- | /* При ширине < 900px — 2 колонки */ | ||
@media (max-width: 900px) { | |||
.home-grid { | |||
grid-template-columns: repeat(2, 1fr); | |||
} | |||
} | } | ||
.home- | /* При ширине < 600px — 1 колонка (мобильные) */ | ||
@media (max-width: 600px) { | |||
.home-grid { | |||
grid-template-columns: 1fr; | |||
gap: 12px; | |||
} | |||
} | } | ||
/* ============================================ | |||
Карточка | |||
============================================ */ | |||
.home- | .home-card { | ||
position: relative; | |||
display: flex; | |||
flex-direction: column; | |||
background-color: #1B232A; | |||
border: 1px solid #2a3641; | |||
border-radius: 8px; | |||
overflow: hidden; | |||
aspect-ratio: 16 / 10; | |||
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; | |||
cursor: pointer; | |||
} | } | ||
.home- | /* Hover-эффект */ | ||
.home-card:hover { | |||
transform: translateY(-4px); | |||
box-shadow: 0 8px 24px rgba(25, 129, 213, 0.35), 0 0 0 1px #1981d5; | |||
border-color: #1981d5; | |||
z-index: 5; | |||
} | } | ||
/* Фоновое изображение */ | |||
.home-card__background { | .home-card__background { | ||
position: absolute; | |||
top: 0; right: 0; bottom: 0; left: 0; | |||
overflow: hidden; | |||
} | } | ||
.home-card__background img { | .home-card__background img { | ||
width: 100%; | |||
height: 100%; | |||
object-fit: cover; | |||
transition: transform 0.3s ease; | |||
} | } | ||
.home-card__background img { | .home-card:hover .home-card__background img { | ||
transform: scale(1.05); | |||
} | } | ||
.home- | /* Затемнение фона для читаемости текста */ | ||
.home-card__background::after { | |||
content: ''; | |||
position: absolute; | |||
top: 0; right: 0; bottom: 0; left: 0; | |||
background: linear-gradient( | |||
to bottom, | |||
rgba(27, 35, 42, 0.1) 0%, | |||
rgba(27, 35, 42, 0.6) 60%, | |||
rgba(27, 35, 42, 0.9) 100% | |||
); | |||
transition: opacity 0.2s ease; | |||
} | } | ||
.home- | .home-card:hover .home-card__background::after { | ||
opacity: 0.85; | |||
} | } | ||
.home-card__foreground | /* Текст-подпись */ | ||
.home-card__foreground { | |||
position: relative; | |||
z-index: 2; | |||
margin-top: auto; | |||
padding: 12px 16px; | |||
color: #ffffff; | |||
font-family: 'Segoe UI', 'Inter', system-ui, sans-serif; | |||
font-size: 1rem; | |||
font-weight: 600; | |||
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); | |||
line-height: 1.3; | |||
display: flex; | |||
align-items: center; | |||
justify-content: flex-start; | |||
} | } | ||
.home- | .home-card__foreground span { | ||
display: inline-block; | |||
} | } | ||
.home-card | .home-card:hover .home-card__foreground { | ||
color: #ff9933; | |||
} | } | ||
/* ============================================ | |||
Featured блок — стили (если используется) | |||
============================================ */ | |||
#home-content { | #home-content { | ||
margin-top: 2rem; | |||
} | } | ||
#home-content .home-grid { | |||
grid-template-columns: 1fr; | |||
} | } | ||
/* ============================================ | |||
Анимация появления (опционально) | |||
============================================ */ | |||
.home-card { | |||
animation: fadeInUp 0.4s ease backwards; | |||
} | } | ||
.home-grid .home-card:nth-child(1) { animation-delay: 0.05s; } | |||
.home-grid .home-card:nth-child(2) { animation-delay: 0.10s; } | |||
} | .home-grid .home-card:nth-child(3) { animation-delay: 0.15s; } | ||
.home-grid .home-card:nth-child(4) { animation-delay: 0.20s; } | |||
.home-grid .home-card:nth-child(5) { animation-delay: 0.25s; } | |||
.home-grid .home-card:nth-child(6) { animation-delay: 0.30s; } | |||
@keyframes fadeInUp { | |||
from { | |||
opacity: 0; | |||
transform: translateY(10px); | |||
} | |||
to { | |||
opacity: 1; | |||
transform: translateY(0); | |||
} | |||
} | } | ||
.home- | /* Уважение к prefers-reduced-motion */ | ||
@media (prefers-reduced-motion: reduce) { | |||
.home-card, | |||
.home-card:hover, | |||
.home-card__background img, | |||
.home-card__background::after { | |||
animation: none !important; | |||
transition: none !important; | |||
transform: none !important; | |||
} | |||
} | } | ||
/* ============================================ | |||
Поддержка светлой темы Citizen | |||
============================================ */ | |||
# | @media (prefers-color-scheme: light) { | ||
.home-card { | |||
background-color: #f8f9fa; | |||
border-color: #dee2e6; | |||
} | |||
.home-section-title { | |||
color: #1a1a1a; | |||
} | |||
.home-card__background::after { | |||
background: linear-gradient( | |||
to bottom, | |||
rgba(248, 249, 250, 0.1) 0%, | |||
rgba(248, 249, 250, 0.6) 60%, | |||
rgba(248, 249, 250, 0.9) 100% | |||
); | |||
} | |||
} | } | ||
Версия от 03:09, 24 августа 2026
/* ============================================
Главная страница — навигация по секциям
============================================ */
.home-nav-sections {
margin-top: 1.5rem;
}
/* Заголовки секций */
.home-section-title {
font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
font-size: 1.6rem;
font-weight: 700;
color: #ffffff;
margin: 2rem 0 1rem 0;
padding-bottom: 0.5rem;
border-bottom: 2px solid #1981d5;
display: flex;
align-items: center;
gap: 0.6rem;
}
.home-section-title::before {
content: '◆';
color: #ff6600;
font-size: 1.2rem;
}
/* Первая секция — без верхнего отступа */
.home-nav-sections .home-section-title:first-child {
margin-top: 0;
}
/* ============================================
Сетка карточек
============================================ */
.home-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16px;
margin: 1rem 0 2rem 0;
}
/* При ширине < 1200px — 3 колонки */
@media (max-width: 1200px) {
.home-grid {
grid-template-columns: repeat(3, 1fr);
}
}
/* При ширине < 900px — 2 колонки */
@media (max-width: 900px) {
.home-grid {
grid-template-columns: repeat(2, 1fr);
}
}
/* При ширине < 600px — 1 колонка (мобильные) */
@media (max-width: 600px) {
.home-grid {
grid-template-columns: 1fr;
gap: 12px;
}
}
/* ============================================
Карточка
============================================ */
.home-card {
position: relative;
display: flex;
flex-direction: column;
background-color: #1B232A;
border: 1px solid #2a3641;
border-radius: 8px;
overflow: hidden;
aspect-ratio: 16 / 10;
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
cursor: pointer;
}
/* Hover-эффект */
.home-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(25, 129, 213, 0.35), 0 0 0 1px #1981d5;
border-color: #1981d5;
z-index: 5;
}
/* Фоновое изображение */
.home-card__background {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
overflow: hidden;
}
.home-card__background img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
.home-card:hover .home-card__background img {
transform: scale(1.05);
}
/* Затемнение фона для читаемости текста */
.home-card__background::after {
content: '';
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
background: linear-gradient(
to bottom,
rgba(27, 35, 42, 0.1) 0%,
rgba(27, 35, 42, 0.6) 60%,
rgba(27, 35, 42, 0.9) 100%
);
transition: opacity 0.2s ease;
}
.home-card:hover .home-card__background::after {
opacity: 0.85;
}
/* Текст-подпись */
.home-card__foreground {
position: relative;
z-index: 2;
margin-top: auto;
padding: 12px 16px;
color: #ffffff;
font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
font-size: 1rem;
font-weight: 600;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
line-height: 1.3;
display: flex;
align-items: center;
justify-content: flex-start;
}
.home-card__foreground span {
display: inline-block;
}
.home-card:hover .home-card__foreground {
color: #ff9933;
}
/* ============================================
Featured блок — стили (если используется)
============================================ */
#home-content {
margin-top: 2rem;
}
#home-content .home-grid {
grid-template-columns: 1fr;
}
/* ============================================
Анимация появления (опционально)
============================================ */
.home-card {
animation: fadeInUp 0.4s ease backwards;
}
.home-grid .home-card:nth-child(1) { animation-delay: 0.05s; }
.home-grid .home-card:nth-child(2) { animation-delay: 0.10s; }
.home-grid .home-card:nth-child(3) { animation-delay: 0.15s; }
.home-grid .home-card:nth-child(4) { animation-delay: 0.20s; }
.home-grid .home-card:nth-child(5) { animation-delay: 0.25s; }
.home-grid .home-card:nth-child(6) { animation-delay: 0.30s; }
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Уважение к prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
.home-card,
.home-card:hover,
.home-card__background img,
.home-card__background::after {
animation: none !important;
transition: none !important;
transform: none !important;
}
}
/* ============================================
Поддержка светлой темы Citizen
============================================ */
@media (prefers-color-scheme: light) {
.home-card {
background-color: #f8f9fa;
border-color: #dee2e6;
}
.home-section-title {
color: #1a1a1a;
}
.home-card__background::after {
background: linear-gradient(
to bottom,
rgba(248, 249, 250, 0.1) 0%,
rgba(248, 249, 250, 0.6) 60%,
rgba(248, 249, 250, 0.9) 100%
);
}
}