Redesign typography, add image rounding and smooth loading

- Global headings: drop ALL CAPS, use sentence case + weight 700
- Post cards: refined date (small/uppercase/muted), cleaner title hierarchy
- Single post: date metadata style, subtitle no-italic, body line-height 1.75
- Logo frame (#header .logo): border-radius 12px
- All images: border-radius 8px (posts), 6px (gallery)
- Smooth lazy-load: CSS fadeIn animation + JS fallback (image-fade.js)
- Cache-busting: typography CSS with Hugo timestamp query string
- Trip card: replace broken gallery link with direct Elbrus S3 image URL

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kirik
2026-04-09 23:38:04 +02:00
parent 5c430e4a4e
commit 1696f47fe9
5 changed files with 428 additions and 240 deletions
+15
View File
@@ -0,0 +1,15 @@
{{ $jQuery := resources.Get "js/jquery.min.js" }}
{{ $scrollex := resources.Get "js/jquery.scrollex.min.js" }}
{{ $scrolly := resources.Get "js/jquery.scrolly.min.js" }}
{{ $browser := resources.Get "js/browser.min.js" }}
{{ $breakpoints := resources.Get "js/breakpoints.min.js" }}
{{ $util := resources.Get "js/util.js" }}
{{ $main := resources.Get "js/main.js" }}
{{ $js := slice $jQuery $scrollex $scrolly $browser $breakpoints $util $main | resources.Concat "assets/js/bundle.js" }}
<!-- Scripts -->
<script src='{{ $js.RelPermalink }}' defer></script>
<!-- Плавное появление lazy-loaded изображений -->
<script src="/js/image-fade.js" defer></script>
+370 -238
View File
@@ -1,238 +1,370 @@
/* Деликатные улучшения типографики только для контента постов */ /*
* PTP Typography — единая система типографики
/* Улучшения только для основного контента статей */ *
#main article p { * Тема использует: body = Georgia (serif), headings = Helvetica (sans-serif)
line-height: 1.7; * Проблема: заголовки ALL CAPS + 900 weight + letter-spacing → агрессивно для travel-блога.
text-align: left; * Решение: убираем uppercase, снижаем weight, создаём ясную иерархию через размер.
margin-bottom: 1.25rem; */
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased; /* =================================================================
} 1. ГЛОБАЛЬНЫЕ ЗАГОЛОВКИ — убираем uppercase, смягчаем
================================================================= */
/* Заголовки только в статьях */
#main article h1, h1, h2, h3, h4, h5, h6 {
#main article h2, text-transform: none;
#main article h3 { font-weight: 700;
text-transform: none; letter-spacing: 0.02em;
font-weight: 700; line-height: 1.3;
text-rendering: optimizeLegibility; }
}
/* =================================================================
#main article h1 { 2. INTRO (главный экран "Пока ты спал")
font-size: 2.5rem; ================================================================= */
line-height: 1.2;
margin-bottom: 1.5rem; /* Логотип "Пока ты спал" — скруглённые углы на рамке */
} #header .logo {
border-radius: 12px !important;
#main article h2 { }
font-size: 2rem;
line-height: 1.25; /* Заголовок intro — оставляем uppercase (это логотип/бренд) */
margin-bottom: 1.25rem; #intro h1 {
} text-transform: uppercase;
font-weight: 900;
#main article h3 { letter-spacing: 0.1em;
font-size: 1.6rem; }
margin-bottom: 1rem;
} /* =================================================================
3. НАВИГАЦИЯ — оставляем uppercase (стандарт для nav)
/* Ссылки в статьях - только подсветка при наведении */ ================================================================= */
#main article a {
text-decoration: none; #nav ul.links a,
transition: color 0.3s ease; #nav .links a {
} text-transform: uppercase;
font-weight: 700;
#main article a:hover { letter-spacing: 0.06em;
color: #5b9bd5; font-size: 0.85rem;
} }
/* Списки в статьях */ /* =================================================================
#main article ul, 4. КАРТОЧКИ ПОСТОВ (главная)
#main article ol { ================================================================= */
line-height: 1.6;
margin-bottom: 1.5rem; #main > .posts > article {
} padding: 2rem !important;
text-align: center !important;
#main article li { transition: box-shadow 0.2s ease;
margin-bottom: 0.4rem; }
line-height: 1.6;
} /* Header карточки */
#main > .posts > article header {
/* Цитаты в статьях */ min-height: 5.5rem;
#main article blockquote { padding-top: 1.2rem;
line-height: 1.6; }
padding: 1.25rem 1.5rem;
margin: 1.5rem 0; /* Дата — metadata: маленькая, uppercase, приглушённая */
background: rgba(24, 191, 239, 0.03); #main > .posts > article header .date {
border-radius: 0 6px 6px 0; font-size: 0.7rem;
font-style: italic; letter-spacing: 0.12em;
} text-transform: uppercase;
opacity: 0.5;
/* Код в статьях */ margin-bottom: 0.5rem;
#main article code { font-weight: 400;
background: rgba(0, 0, 0, 0.05); }
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 3px; /* Заголовок карточки — sentence case, не uppercase */
padding: 0.2em 0.4em; #main > .posts > article header h2 {
font-size: 0.9em; font-size: 1.2rem;
} font-weight: 700;
line-height: 1.35;
#main article pre { text-transform: none;
background: #f8f9fa; letter-spacing: 0.01em;
border: 1px solid rgba(0, 0, 0, 0.1); display: -webkit-box;
border-radius: 6px; -webkit-box-orient: vertical;
padding: 1.25rem; -webkit-line-clamp: 2;
margin: 1.5rem 0; overflow: hidden;
line-height: 1.4; margin-bottom: 0;
} text-align: center;
}
#main article pre code {
background: none; #main > .posts > article header h2 a {
border: none; text-decoration: none;
padding: 0; }
}
/* Описание под карточкой */
/* Улучшения для контента страниц (не меню и карточки) */ #main > .posts > article > p {
#main section > p { display: -webkit-box;
line-height: 1.7; -webkit-box-orient: vertical;
text-align: left; -webkit-line-clamp: 2;
margin-bottom: 1.25rem; overflow: hidden;
} text-align: center;
font-size: 0.85rem;
/* Ограничиваем ширину только для статей */ color: #666;
#main article { margin-bottom: 1rem;
max-width: 720px; line-height: 1.55;
margin: 0 auto; font-weight: 300;
} }
/* Улучшения контрастности только для контента */ /* Фото карточки */
#main article { #main > .posts > article .image.main {
color: #2c3e50; margin: 1rem 0 !important;
} }
#main article h1, #main > .posts > article .image.main img {
#main article h2, border-radius: 8px;
#main article h3, }
#main article h4,
#main article h5, /* Скрываем "Подробнее" — карточка кликабельна по заголовку */
#main article h6 { #main > .posts > article .actions {
color: #1a252f; display: none !important;
} }
/* Карточки постов */ /* =================================================================
#main > .posts > article { 5. ПЕРВЫЙ ПОСТ (закреплённый, "О чём этот сайт")
padding: 2rem !important; ================================================================= */
text-align: center !important;
transition: box-shadow 0.2s ease; #main > section.posts:first-of-type article {
} text-align: center !important;
}
#main > .posts > article:hover {
} #main > section.posts:first-of-type article header h2 {
text-align: center !important;
/* Фиксированная высота хедера — фото на одном уровне в ряду */ font-size: 1.5rem;
#main > .posts > article header { font-weight: 700;
min-height: 5.5rem; -webkit-line-clamp: unset !important;
} overflow: visible !important;
}
/* Заголовок карточки */
#main > .posts > article header h2 { #main > section.posts:first-of-type article header h2 a {
font-size: 1.3rem; color: inherit;
line-height: 1.35; }
display: -webkit-box;
-webkit-box-orient: vertical; #main > section.posts:first-of-type article .image.main {
-webkit-line-clamp: 2; margin: 1rem auto !important;
overflow: hidden; display: block !important;
margin-bottom: 0; }
text-align: center;
} #main > section.posts:first-of-type article > p {
text-align: center !important;
#main > .posts > article header h2 a { }
text-decoration: none;
} /* =================================================================
6. ВНУТРИ ПОСТА (single page)
/* Убираем огромный отступ у фото (тема: 4rem 0) */ ================================================================= */
#main > .posts > article .image.main {
margin: 1rem 0 !important; /* Подзаголовок поста ("на рассвете") — убираем курсив темы */
} #main > .post header.major > p,
header.major > h1 + p {
/* Описание — обрезаем до 2 строк */ font-style: normal;
#main > .posts > article > p { opacity: 0.7;
display: -webkit-box; font-size: 1.1rem;
-webkit-box-orient: vertical; }
-webkit-line-clamp: 2;
overflow: hidden; /* Дата — metadata стиль */
text-align: center; #main > .post header.major > .date {
font-size: 0.88rem; font-size: 0.8rem;
color: #666; letter-spacing: 0.1em;
margin-bottom: 1rem; text-transform: uppercase;
line-height: 1.5; opacity: 0.45;
} margin-top: -0.5rem;
margin-bottom: 1.8rem;
/* Скрываем кнопку «Подробнее» — карточка и так кликабельна по заголовку */ font-weight: 400;
#main > .posts > article .actions { }
display: none !important;
} /* Контент */
#main article {
@media screen and (max-width: 980px) { max-width: 720px;
#main > .posts > article { margin: 0 auto;
padding: 1.5rem !important; color: #2c3e50;
} }
}
#main article p {
/* Первый (закреплённый) пост — центрировать на всех экранах */ line-height: 1.75;
#main > section.posts:first-of-type article { text-align: left;
text-align: center !important; margin-bottom: 1.25rem;
} text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
#main > section.posts:first-of-type article header h2 { }
text-align: center !important;
-webkit-line-clamp: unset !important; #main article h1,
overflow: visible !important; #main article h2,
} #main article h3,
#main article h4,
#main > section.posts:first-of-type article header h2 a { #main article h5,
color: inherit; #main article h6 {
} color: #1a252f;
text-transform: none;
#main > section.posts:first-of-type article .image.main { font-weight: 700;
margin: 1rem auto !important; letter-spacing: 0.01em;
display: block !important; }
}
#main article h1 {
#main > section.posts:first-of-type article > p { font-size: 2.2rem;
text-align: center !important; line-height: 1.2;
} margin-bottom: 1.5rem;
}
/* Мобильный: дополнительные корректировки */
@media screen and (max-width: 736px) { #main article h2 {
#main > section.posts:first-of-type article { font-size: 1.6rem;
padding: 1.5rem 1.25rem !important; line-height: 1.3;
} margin-bottom: 1.25rem;
}
#main > section.posts:first-of-type article header h2 {
font-size: 1.45rem !important; #main article h3 {
} font-size: 1.3rem;
margin-bottom: 1rem;
#main > section.posts:first-of-type article .image.main { }
margin: 0.75rem auto !important;
} /* Ссылки */
} #main article a {
text-decoration: none;
/* Адаптивность для мобильных */ transition: color 0.3s ease;
@media (max-width: 768px) { }
#main article h1 {
font-size: 2rem; #main article a:hover {
} color: #18bfef;
}
#main article h2 {
font-size: 1.7rem; /* Списки */
} #main article ul,
#main article ol {
#main article h3 { line-height: 1.65;
font-size: 1.4rem; margin-bottom: 1.5rem;
} }
#main article { #main article li {
max-width: 95%; margin-bottom: 0.3rem;
padding: 0 0.5rem; }
}
} /* Цитаты */
#main article blockquote {
line-height: 1.65;
padding: 1.25rem 1.5rem;
margin: 1.5rem 0;
background: rgba(24, 191, 239, 0.03);
border-radius: 0 6px 6px 0;
font-style: italic;
}
/* Код */
#main article code {
background: rgba(0, 0, 0, 0.05);
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 3px;
padding: 0.2em 0.4em;
font-size: 0.9em;
}
#main article pre {
background: #f8f9fa;
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 6px;
padding: 1.25rem;
margin: 1.5rem 0;
line-height: 1.4;
}
#main article pre code {
background: none;
border: none;
padding: 0;
}
/* Страничный контент (не посты) */
#main section > p {
line-height: 1.7;
text-align: left;
margin-bottom: 1.25rem;
}
/* =================================================================
7. ФОТО/ВИДЕО — скругление + плавная загрузка
================================================================= */
/* Карточки */
#main > .posts > article .image.main img {
border-radius: 8px;
}
/* Внутри поста — все img */
#main .post .image.main img,
#main .post .image img,
#main .post p > img,
#main .post p img,
section.post img {
border-radius: 8px;
}
#main .post iframe,
section.post iframe {
border-radius: 8px;
}
/* Галерея */
.gallery .box .img img,
.gallery .box img,
.gallery img {
border-radius: 6px;
}
/* Фото в теле поста — layout */
#main > .post p > img {
display: block;
max-width: 100%;
height: auto;
margin: 1rem auto;
}
/* Плавная загрузка */
@keyframes imgFadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
#main img,
.gallery img {
background: #f0f0f0;
}
img[loading="lazy"] {
animation: imgFadeIn 0.5s ease;
}
/* =================================================================
8. МОБИЛЬНАЯ АДАПТАЦИЯ
================================================================= */
@media (max-width: 980px) {
#main > .posts > article {
padding: 1.5rem !important;
text-align: center !important;
}
#main > .posts > article header,
#main > .posts > article header h2,
#main > .posts > article > p {
text-align: center !important;
}
}
@media (max-width: 736px) {
#main > section.posts:first-of-type article {
padding: 2rem 1.25rem !important;
}
#main > section.posts:first-of-type article header h2 {
font-size: 1.4rem !important;
}
#main > section.posts:first-of-type article .image.main {
margin: 1rem auto !important;
}
#main article h1 { font-size: 1.8rem; }
#main article h2 { font-size: 1.4rem; }
#main article h3 { font-size: 1.2rem; }
#main article {
max-width: 95%;
padding: 0 0.5rem;
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
"title": "Расписание ближайших дронослётов", "title": "Расписание ближайших дронослётов",
"period": "После 9 апреля 2026 года", "period": "После 9 апреля 2026 года",
"description": "В ближайшее время (март и начало апреля 2026 года) не планируется проведение открытых дронослётов (это для всех желающих по заявкам с сайта).\n\nВозможные даты проведения открытых дронослётов - не раньше 9 апреля 2026 года, следите за расписанием на сайте", "description": "В ближайшее время (март и начало апреля 2026 года) не планируется проведение открытых дронослётов (это для всех желающих по заявкам с сайта).\n\nВозможные даты проведения открытых дронослётов - не раньше 9 апреля 2026 года, следите за расписанием на сайте",
"image": "https://sleeptrip.ru/gallery/#&gid=1&pid=50", "image": "https://s3.regru.cloud/sleeptrip-dev/images/Elbrus-20230128-1.jpg",
"meta": [], "meta": [],
"active": true, "active": true,
"order": 1 "order": 1
+41
View File
@@ -0,0 +1,41 @@
// Плавное появление lazy-loaded изображений
// Работает с img[loading="lazy"] — добавляет класс .loaded после загрузки
(function () {
function onImageLoad(img) {
img.classList.add('loaded');
}
// Обработать все lazy-loaded изображения
document.querySelectorAll('img[loading="lazy"]').forEach(function (img) {
if (img.complete && img.naturalHeight > 0) {
// Уже загружено (из кэша)
onImageLoad(img);
} else {
img.addEventListener('load', function () {
onImageLoad(img);
});
// На случай ошибки — всё равно показать (без анимации)
img.addEventListener('error', function () {
onImageLoad(img);
});
}
});
// Для динамически добавляемых изображений (MutationObserver)
if ('MutationObserver' in window) {
new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
mutation.addedNodes.forEach(function (node) {
if (node.nodeName === 'IMG' && node.getAttribute('loading') === 'lazy') {
if (node.complete && node.naturalHeight > 0) {
onImageLoad(node);
} else {
node.addEventListener('load', function () { onImageLoad(node); });
node.addEventListener('error', function () { onImageLoad(node); });
}
}
});
});
}).observe(document.body, { childList: true, subtree: true });
}
})();
@@ -48,7 +48,7 @@
<link rel="stylesheet" href="/css/footer-nav.css"> <link rel="stylesheet" href="/css/footer-nav.css">
<link rel="stylesheet" href="/css/mobile-pagination.css"> <link rel="stylesheet" href="/css/mobile-pagination.css">
<link rel="stylesheet" href="/css/back-to-top.css"> <link rel="stylesheet" href="/css/back-to-top.css">
<link rel="stylesheet" href="/css/typography-improvements.css"> <link rel="stylesheet" href="/css/typography-improvements.css?v={{ now.Unix }}">
<link rel="stylesheet" href="/css/about-site.css"> <link rel="stylesheet" href="/css/about-site.css">
<link rel="stylesheet" href="/css/copyright-visible.css"> <link rel="stylesheet" href="/css/copyright-visible.css">
<link rel="stylesheet" href="/css/nav-background.css"> <link rel="stylesheet" href="/css/nav-background.css">