task 17081 | сделал Блог (Хабовая страница)

This commit is contained in:
web_103.2 committed 2026-10-23 14:14:29 +03:00
1 parent 07a4f5b19d
commit e833705e6d
8 files changed
+517 -8

No files matched your search

@@ -7060,6 +7060,17 @@ h4 {
display: flex;
}
.blog-header__action .header-buttons__download-btn{
height: 62px;
min-width: 200px;
}
@media (max-width: 767.98px) {
.blog-header__action .header-buttons__download-btn{
height: 44px;
min-width: 140px;
}
}
/* Article intro adapted from the supplied layout. */
.article-intro,
.article-intro * {
@@ -8533,3 +8544,244 @@ h4 {
}
.work-directions {
--directions-background: #f5f5f9;
--directions-heading: #172d38;
--directions-accent: #ae001b;
width: 100%;
margin: 40px 0 40px;
color: var(--directions-heading);
font-family: "Onest", sans-serif;
-webkit-font-smoothing: antialiased;
}
.work-directions,
.work-directions *,
.work-directions *::before,
.work-directions *::after {
box-sizing: border-box;
}
.work-directions__grid {
display: grid;
grid-template-columns: minmax(0, 413fr) minmax(0, 414fr) minmax(0, 413fr);
gap: 20px;
margin: 0;
padding: 0;
list-style: none;
}
.work-directions__card {
position: relative;
isolation: isolate;
display: flex;
width: 100%;
min-width: 0;
aspect-ratio: 413 / 290;
min-height: 200px;
align-items: flex-end;
justify-content: center;
overflow: hidden;
padding: 32px 16px;
border-radius: 20px;
background: var(--directions-background);
color: inherit;
text-align: center;
text-decoration: none;
-webkit-tap-highlight-color: transparent;
}
.work-directions__card--taxi {
aspect-ratio: 414 / 290;
}
.work-directions__label {
position: relative;
font-size: 20px;
font-weight: 600;
line-height: 1.1;
letter-spacing: -0.01em;
}
.work-directions__vehicle {
position: absolute;
display: block;
overflow: hidden;
background: var(--directions-background);
transform: translateX(-50%);
transition: transform 240ms ease;
pointer-events: none;
}
.work-directions__vehicle img {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
mix-blend-mode: darken;
}
.work-directions__vehicle--scooter {
top: 20%;
left: calc(50% + 0.5px);
width: 55.205811%;
aspect-ratio: 228 / 152;
}
.work-directions__vehicle--taxi {
top: 20%;
left: calc(50% - 1px);
width: 83.091787%;
aspect-ratio: 344 / 151;
}
.work-directions__vehicle--van {
top: 13.448276%;
left: calc(50% - 6.5px);
width: 87.651332%;
aspect-ratio: 362 / 174;
}
.work-directions__arrow {
--arrow-scale: 1;
position: absolute;
z-index: 1;
top: 24px;
right: 24px;
display: block;
width: 51px;
height: 51px;
}
.work-directions__arrow {
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: #fff;
color: var(--directions-accent);
transition: color 180ms ease, background-color 180ms ease;
}
.work-directions__arrow svg {
display: block;
width: 13px;
height: 13px;
}
.work-directions__card:is(:hover, :focus-visible, :active, .is-active) .work-directions__arrow {
background: var(--directions-accent);
color: #fff;
}
.work-directions__card.is-active {
box-shadow: inset 0 0 0 1px var(--directions-accent);
}
@media (hover: hover) {
.work-directions__card:hover {
box-shadow: inset 0 0 0 1px rgb(174 0 27 / 20%);
}
.work-directions__card:hover .work-directions__vehicle {
transform: translateX(-50%) scale(1.04);
}
}
.work-directions__card:active {
box-shadow: inset 0 0 0 1px rgb(174 0 27 / 20%);
}
.work-directions__card:focus-visible {
outline: 2px solid var(--directions-accent);
outline-offset: 4px;
}
.work-directions__card:is(:active, :focus-visible) .work-directions__vehicle {
transform: translateX(-50%) scale(1.04);
}
@media (min-width: 768px) and (max-width: 1199px) {
.work-directions__grid {
gap: 16px;
}
.work-directions__card {
padding-bottom: 24px;
}
.work-directions__label {
font-size: 18px;
}
.work-directions__arrow {
top: 16px;
right: 16px;
}
}
@media (prefers-reduced-motion: reduce) {
.work-directions__vehicle,
.work-directions__arrow {
transition: none;
}
}
@media (max-width: 767.98px) {
.work-directions {
margin-top: 20px;
}
.work-directions__grid {
grid-template-columns: minmax(0, 163fr) minmax(0, 162fr);
gap: 10px;
}
.work-directions__cargo {
grid-column: 1 / -1;
}
.work-directions__card {
height: 155px;
min-height: 0;
aspect-ratio: auto;
padding: 16px;
}
.work-directions__label {
font-size: 14px;
}
.work-directions__vehicle--scooter {
top: 36px;
left: calc(50% + 0.5px);
width: min(106px, 70%);
aspect-ratio: 106 / 70;
}
.work-directions__vehicle--taxi {
top: 39px;
left: 50%;
width: min(138px, 85.185185%);
aspect-ratio: 138 / 61;
}
.work-directions__vehicle--van {
top: 22px;
left: 50%;
width: min(181px, 80%);
aspect-ratio: 181 / 87;
}
.work-directions__arrow {
--arrow-scale: 0.5882352941;
top: 12px;
right: 12px;
width: 30px;
height: 30px;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

@@ -0,0 +1,237 @@
.work-directions {
--directions-background: #f5f5f9;
--directions-heading: #172d38;
--directions-accent: #ae001b;
width: 100%;
margin: 0 0 40px;
color: var(--directions-heading);
font-family: "Onest", sans-serif;
-webkit-font-smoothing: antialiased;
}
.work-directions,
.work-directions *,
.work-directions *::before,
.work-directions *::after {
box-sizing: border-box;
}
.work-directions__grid {
display: grid;
grid-template-columns: minmax(0, 413fr) minmax(0, 414fr) minmax(0, 413fr);
gap: 20px;
margin: 0;
padding: 0;
list-style: none;
}
.work-directions__card {
position: relative;
isolation: isolate;
display: flex;
width: 100%;
min-width: 0;
aspect-ratio: 413 / 290;
min-height: 200px;
align-items: flex-end;
justify-content: center;
overflow: hidden;
padding: 32px 16px;
border-radius: 20px;
background: var(--directions-background);
color: inherit;
text-align: center;
text-decoration: none;
-webkit-tap-highlight-color: transparent;
}
.work-directions__card--taxi {
aspect-ratio: 414 / 290;
}
.work-directions__label {
position: relative;
font-size: 20px;
font-weight: 600;
line-height: 1.1;
letter-spacing: -0.01em;
}
.work-directions__vehicle {
position: absolute;
display: block;
overflow: hidden;
background: var(--directions-background);
transform: translateX(-50%);
transition: transform 240ms ease;
pointer-events: none;
}
.work-directions__vehicle img {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
mix-blend-mode: darken;
}
.work-directions__vehicle--scooter {
top: 20%;
left: calc(50% + 0.5px);
width: 55.205811%;
aspect-ratio: 228 / 152;
}
.work-directions__vehicle--taxi {
top: 20%;
left: calc(50% - 1px);
width: 83.091787%;
aspect-ratio: 344 / 151;
}
.work-directions__vehicle--van {
top: 13.448276%;
left: calc(50% - 6.5px);
width: 87.651332%;
aspect-ratio: 362 / 174;
}
.work-directions__arrow {
--arrow-scale: 1;
position: absolute;
z-index: 1;
top: 24px;
right: 24px;
display: block;
width: 51px;
height: 51px;
}
.work-directions__arrow {
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: #fff;
color: var(--directions-accent);
transition: color 180ms ease, background-color 180ms ease;
}
.work-directions__arrow svg {
display: block;
width: 13px;
height: 13px;
}
.work-directions__card:is(:hover, :focus-visible, :active, .is-active) .work-directions__arrow {
background: var(--directions-accent);
color: #fff;
}
.work-directions__card.is-active {
box-shadow: inset 0 0 0 1px var(--directions-accent);
}
@media (hover: hover) {
.work-directions__card:hover {
box-shadow: inset 0 0 0 1px rgb(174 0 27 / 20%);
}
.work-directions__card:hover .work-directions__vehicle {
transform: translateX(-50%) scale(1.04);
}
}
.work-directions__card:active {
box-shadow: inset 0 0 0 1px rgb(174 0 27 / 20%);
}
.work-directions__card:focus-visible {
outline: 2px solid var(--directions-accent);
outline-offset: 4px;
}
.work-directions__card:is(:active, :focus-visible) .work-directions__vehicle {
transform: translateX(-50%) scale(1.04);
}
@media (min-width: 768px) and (max-width: 1199px) {
.work-directions__grid {
gap: 16px;
}
.work-directions__card {
padding-bottom: 24px;
}
.work-directions__label {
font-size: 18px;
}
.work-directions__arrow {
top: 16px;
right: 16px;
}
}
@media (prefers-reduced-motion: reduce) {
.work-directions__vehicle,
.work-directions__arrow {
transition: none;
}
}
@media (max-width: 767.98px) {
.work-directions__grid {
grid-template-columns: minmax(0, 163fr) minmax(0, 162fr);
gap: 10px;
}
.work-directions__cargo {
grid-column: 1 / -1;
}
.work-directions__card {
height: 155px;
min-height: 0;
aspect-ratio: auto;
padding: 16px;
}
.work-directions__label {
font-size: 14px;
}
.work-directions__vehicle--scooter {
top: 36px;
left: calc(50% + 0.5px);
width: min(106px, 70%);
aspect-ratio: 106 / 70;
}
.work-directions__vehicle--taxi {
top: 39px;
left: 50%;
width: min(138px, 85.185185%);
aspect-ratio: 138 / 61;
}
.work-directions__vehicle--van {
top: 22px;
left: 50%;
width: min(181px, 80%);
aspect-ratio: 181 / 87;
}
.work-directions__arrow {
--arrow-scale: 0.5882352941;
top: 12px;
right: 12px;
width: 30px;
height: 30px;
}
}
@@ -3,6 +3,7 @@
@use "courier-services";
@use "delivery-orders";
@use "formats";
@use "work-directions";
*,
*::before,
@@ -65,11 +65,14 @@
}
if ($related_query->have_posts()) :
$title = $post_type === 'news' ? 'Другие новости' : 'Вам также может понравиться';
$blog_title = get_field('blog_title', $current_post_id);
$title = $blog_title
? 'Полезные материалы для ' . $blog_title . ' от Hantico'
: ($post_type === 'news' ? 'Другие новости' : 'Вам также может понравиться');
?>
<section class="articles articles--block articles--slider">
<div class="container">
<h2 class="articles-title articles-title--lg"><?php echo $title; ?></h2>
<h2 class="articles-title articles-title--lg"><?php echo esc_html($title); ?></h2>
<div class="related-slider">
<div class="related-slider__container swiper">
<div class="swiper-wrapper">
@@ -36,7 +36,7 @@ Template Name: Блог
</div>
<div class="blog-header__action">
<a href="/about/" class="blog-item__read-btn btn btn--md btn--transp-red ">О редакции</a>
<a href="/about/" class="header-buttons__download-btn btn btn--red">О редакции</a>
</div>
</div>
<?php endif; ?>
@@ -46,11 +46,27 @@ Template Name: Блог
$blog_url = $section_urls[$current_section];
?>
<div class="blog-links">
<?php foreach (['taxi' => 'Таксисты', 'courier' => 'Курьеры', 'cargo' => 'Грузоперевозчики'] as $section => $label) : ?>
<a href="<?php echo esc_url($section_urls[$section]); ?>" class="blog-item__read-btn btn btn--md btn--transp-red <?php if ($current_section === (string) $section) echo ' active'; ?>"<?php if ($current_section === (string) $section) echo ' aria-current="page"'; ?>><?php echo esc_html($label); ?></a>
<?php endforeach; ?>
</div>
<nav class="work-directions" aria-label="Разделы блога Hantico">
<ul class="work-directions__grid">
<?php
$directions = [
'courier' => ['label' => 'Курьерам', 'vehicle' => 'scooter'],
'taxi' => ['label' => 'Таксистам', 'vehicle' => 'taxi'],
'cargo' => ['label' => 'Грузоперевозчикам', 'vehicle' => 'van'],
];
foreach ($directions as $section => $direction) :
$is_current = $current_section === $section;
?>
<li<?php if ($section === 'cargo') echo ' class="work-directions__cargo"'; ?>>
<a class="work-directions__card work-directions__card--<?php echo esc_attr($section); ?><?php if ($is_current) echo ' is-active'; ?>" href="<?php echo esc_url($section_urls[$section]); ?>"<?php if ($is_current) echo ' aria-current="page"'; ?>>
<span class="work-directions__vehicle work-directions__vehicle--<?php echo esc_attr($direction['vehicle']); ?>" aria-hidden="true"><img src="<?php echo esc_url(get_theme_file_uri('assets/img/work-directions/' . $direction['vehicle'] . '.webp')); ?>" alt="" loading="lazy" decoding="async"></span>
<span class="work-directions__label"><?php echo esc_html($direction['label']); ?></span>
<span class="work-directions__arrow" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 13 13" fill="none" focusable="false"><path d="M12.5537 7.72367L10.6267 7.71891L10.6369 3.27442L1.36107 12.5326L0.00014086 11.1689L9.25079 1.93597L4.8608 1.92575L4.86557 0.000152722L12.5721 0.0178628L12.5537 7.72367Z" fill="currentColor"/></svg></span>
</a>
</li>
<?php endforeach; ?>
</ul>
</nav>
<div class="blog-slider">
<div class="blog-slider__container swiper swiper-fade">