Шаблон:Main page/navigation/styles.css: различия между версиями
Материал из Aavikko
Дополнительные действия
KoTiKo43 (обсуждение | вклад) Обновление css для навигации заглавной страницы Метка: отменено |
KoTiKo43 (обсуждение | вклад) Фикс слишком широго применения css Метка: отменено |
||
| Строка 1: | Строка 1: | ||
/* ============================================ | /* ============================================ | ||
Главная страница — навигация по секциям | Главная страница — навигация по секциям | ||
ВСЕ правила обёрнуты в .home-nav-sections, | |||
чтобы не затрагивать featured/editing/onthewiki | |||
============================================ */ | ============================================ */ | ||
| Строка 8: | Строка 10: | ||
/* Заголовки секций */ | /* Заголовки секций */ | ||
.home-section-title { | .home-nav-sections .home-section-title { | ||
font-family: 'Segoe UI', 'Inter', system-ui, sans-serif; | font-family: 'Segoe UI', 'Inter', system-ui, sans-serif; | ||
font-size: 1.6rem; | font-size: 1.6rem; | ||
| Строка 21: | Строка 23: | ||
} | } | ||
.home-section-title::before { | .home-nav-sections .home-section-title::before { | ||
content: '◆'; | content: '◆'; | ||
color: #ff6600; | color: #ff6600; | ||
| Строка 33: | Строка 35: | ||
/* ============================================ | /* ============================================ | ||
Сетка карточек | Сетка карточек (только в навигации) | ||
============================================ */ | ============================================ */ | ||
.home-grid { | .home-nav-sections .home-grid { | ||
display: grid; | display: grid; | ||
grid-template-columns: repeat(4, 1fr); | grid-template-columns: repeat(4, 1fr); | ||
| Строка 43: | Строка 45: | ||
} | } | ||
@media (max-width: 1200px) { | @media (max-width: 1200px) { | ||
.home-grid { | .home-nav-sections .home-grid { | ||
grid-template-columns: repeat(3, 1fr); | grid-template-columns: repeat(3, 1fr); | ||
} | } | ||
} | } | ||
@media (max-width: 900px) { | @media (max-width: 900px) { | ||
.home-grid { | .home-nav-sections .home-grid { | ||
grid-template-columns: repeat(2, 1fr); | grid-template-columns: repeat(2, 1fr); | ||
} | } | ||
} | } | ||
@media (max-width: 600px) { | @media (max-width: 600px) { | ||
.home-grid { | .home-nav-sections .home-grid { | ||
grid-template-columns: 1fr; | grid-template-columns: 1fr; | ||
gap: 12px; | gap: 12px; | ||
| Строка 66: | Строка 65: | ||
/* ============================================ | /* ============================================ | ||
Карточка | Карточка навигации | ||
============================================ */ | ============================================ */ | ||
.home-card { | .home-nav-sections .home-card { | ||
position: relative; | position: relative; | ||
display: flex; | display: flex; | ||
| Строка 80: | Строка 79: | ||
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; | transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; | ||
cursor: pointer; | cursor: pointer; | ||
} | |||
/* Трюк для соотношения 16:10 (замена aspect-ratio) */ | |||
.home-nav-sections .home-card::before { | |||
content: ''; | |||
display: block; | |||
padding-top: 62.5%; /* 10/16 = 0.625 → 16:10 */ | |||
} | } | ||
/* Hover-эффект */ | /* Hover-эффект */ | ||
.home-card:hover { | .home-nav-sections .home-card:hover { | ||
transform: translateY(-4px); | transform: translateY(-4px); | ||
box-shadow: 0 8px 24px rgba(25, 129, 213, 0.35), 0 0 0 1px #1981d5; | box-shadow: 0 8px 24px rgba(25, 129, 213, 0.35), 0 0 0 1px #1981d5; | ||
| Строка 91: | Строка 97: | ||
/* Фоновое изображение */ | /* Фоновое изображение */ | ||
.home-card__background { | .home-nav-sections .home-card__background { | ||
position: absolute; | position: absolute; | ||
top: 0; right: 0; bottom: 0; left: 0; | top: 0; right: 0; bottom: 0; left: 0; | ||
| Строка 97: | Строка 103: | ||
} | } | ||
.home-card__background img { | .home-nav-sections .home-card__background img { | ||
width: 100%; | width: 100%; | ||
height: 100%; | height: 100%; | ||
| Строка 104: | Строка 110: | ||
} | } | ||
.home-card:hover .home-card__background img { | .home-nav-sections .home-card:hover .home-card__background img { | ||
transform: scale(1.05); | transform: scale(1.05); | ||
} | } | ||
/* Затемнение фона для читаемости текста */ | /* Затемнение фона для читаемости текста */ | ||
.home-card__background::after { | .home-nav-sections .home-card__background::after { | ||
content: ''; | content: ''; | ||
position: absolute; | position: absolute; | ||
| Строка 122: | Строка 128: | ||
} | } | ||
.home-card:hover .home-card__background::after { | .home-nav-sections .home-card:hover .home-card__background::after { | ||
opacity: 0.85; | opacity: 0.85; | ||
} | } | ||
/* Текст-подпись */ | /* Текст-подпись */ | ||
.home-card__foreground { | .home-nav-sections .home-card__foreground { | ||
position: | position: absolute; | ||
bottom: 0; | |||
left: 0; | |||
right: 0; | |||
z-index: 2; | z-index: 2; | ||
padding: 12px 16px; | padding: 12px 16px; | ||
color: #ffffff; | color: #ffffff; | ||
| Строка 143: | Строка 151: | ||
} | } | ||
.home-card__foreground span { | .home-nav-sections .home-card__foreground span { | ||
display: inline-block; | display: inline-block; | ||
} | } | ||
.home-card:hover .home-card__foreground { | .home-nav-sections .home-card:hover .home-card__foreground { | ||
color: #ff9933; | color: #ff9933; | ||
} | } | ||
| Строка 167: | Строка 163: | ||
============================================ */ | ============================================ */ | ||
.home-card { | .home-nav-sections .home-card { | ||
animation: fadeInUp 0.4s ease backwards; | animation: fadeInUp 0.4s ease backwards; | ||
} | } | ||
.home-grid .home-card:nth-child(1) { animation-delay: 0.05s; } | .home-nav-sections .home-grid .home-card:nth-child(1) { animation-delay: 0.05s; } | ||
.home-grid .home-card:nth-child(2) { animation-delay: 0.10s; } | .home-nav-sections .home-grid .home-card:nth-child(2) { animation-delay: 0.10s; } | ||
.home-grid .home-card:nth-child(3) { animation-delay: 0.15s; } | .home-nav-sections .home-grid .home-card:nth-child(3) { animation-delay: 0.15s; } | ||
.home-grid .home-card:nth-child(4) { animation-delay: 0.20s; } | .home-nav-sections .home-grid .home-card:nth-child(4) { animation-delay: 0.20s; } | ||
.home-grid .home-card:nth-child(5) { animation-delay: 0.25s; } | .home-nav-sections .home-grid .home-card:nth-child(5) { animation-delay: 0.25s; } | ||
.home-grid .home-card:nth-child(6) { animation-delay: 0.30s; } | .home-nav-sections .home-grid .home-card:nth-child(6) { animation-delay: 0.30s; } | ||
@keyframes fadeInUp { | @keyframes fadeInUp { | ||
| Строка 191: | Строка 187: | ||
/* Уважение к prefers-reduced-motion */ | /* Уважение к prefers-reduced-motion */ | ||
@media (prefers-reduced-motion: reduce) { | @media (prefers-reduced-motion: reduce) { | ||
.home-card, | .home-nav-sections .home-card, | ||
.home-card:hover, | .home-nav-sections .home-card:hover, | ||
.home-card__background img, | .home-nav-sections .home-card__background img, | ||
.home-card__background::after { | .home-nav-sections .home-card__background::after { | ||
animation: none !important; | animation: none !important; | ||
transition: none !important; | transition: none !important; | ||
| Строка 206: | Строка 202: | ||
@media (prefers-color-scheme: light) { | @media (prefers-color-scheme: light) { | ||
.home-card { | .home-nav-sections .home-card { | ||
background-color: #f8f9fa; | background-color: #f8f9fa; | ||
border-color: #dee2e6; | border-color: #dee2e6; | ||
} | } | ||
.home-section-title { | .home-nav-sections .home-section-title { | ||
color: #1a1a1a; | color: #1a1a1a; | ||
} | } | ||
.home-card__background::after { | .home-nav-sections .home-card__background::after { | ||
background: linear-gradient( | background: linear-gradient( | ||
to bottom, | to bottom, | ||
Версия от 03:22, 24 августа 2026
/* ============================================
Главная страница — навигация по секциям
ВСЕ правила обёрнуты в .home-nav-sections,
чтобы не затрагивать featured/editing/onthewiki
============================================ */
.home-nav-sections {
margin-top: 1.5rem;
}
/* Заголовки секций */
.home-nav-sections .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-nav-sections .home-section-title::before {
content: '◆';
color: #ff6600;
font-size: 1.2rem;
}
/* Первая секция — без верхнего отступа */
.home-nav-sections .home-section-title:first-child {
margin-top: 0;
}
/* ============================================
Сетка карточек (только в навигации)
============================================ */
.home-nav-sections .home-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16px;
margin: 1rem 0 2rem 0;
}
@media (max-width: 1200px) {
.home-nav-sections .home-grid {
grid-template-columns: repeat(3, 1fr);
}
}
@media (max-width: 900px) {
.home-nav-sections .home-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 600px) {
.home-nav-sections .home-grid {
grid-template-columns: 1fr;
gap: 12px;
}
}
/* ============================================
Карточка навигации
============================================ */
.home-nav-sections .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;
}
/* Трюк для соотношения 16:10 (замена aspect-ratio) */
.home-nav-sections .home-card::before {
content: '';
display: block;
padding-top: 62.5%; /* 10/16 = 0.625 → 16:10 */
}
/* Hover-эффект */
.home-nav-sections .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-nav-sections .home-card__background {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
overflow: hidden;
}
.home-nav-sections .home-card__background img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
.home-nav-sections .home-card:hover .home-card__background img {
transform: scale(1.05);
}
/* Затемнение фона для читаемости текста */
.home-nav-sections .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-nav-sections .home-card:hover .home-card__background::after {
opacity: 0.85;
}
/* Текст-подпись */
.home-nav-sections .home-card__foreground {
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 2;
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-nav-sections .home-card__foreground span {
display: inline-block;
}
.home-nav-sections .home-card:hover .home-card__foreground {
color: #ff9933;
}
/* ============================================
Анимация появления (опционально)
============================================ */
.home-nav-sections .home-card {
animation: fadeInUp 0.4s ease backwards;
}
.home-nav-sections .home-grid .home-card:nth-child(1) { animation-delay: 0.05s; }
.home-nav-sections .home-grid .home-card:nth-child(2) { animation-delay: 0.10s; }
.home-nav-sections .home-grid .home-card:nth-child(3) { animation-delay: 0.15s; }
.home-nav-sections .home-grid .home-card:nth-child(4) { animation-delay: 0.20s; }
.home-nav-sections .home-grid .home-card:nth-child(5) { animation-delay: 0.25s; }
.home-nav-sections .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-nav-sections .home-card,
.home-nav-sections .home-card:hover,
.home-nav-sections .home-card__background img,
.home-nav-sections .home-card__background::after {
animation: none !important;
transition: none !important;
transform: none !important;
}
}
/* ============================================
Поддержка светлой темы Citizen
============================================ */
@media (prefers-color-scheme: light) {
.home-nav-sections .home-card {
background-color: #f8f9fa;
border-color: #dee2e6;
}
.home-nav-sections .home-section-title {
color: #1a1a1a;
}
.home-nav-sections .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%
);
}
}