2026-10-05 GLOBAL

This commit is contained in:
Dekart Deploy Bot 2026-10-06 20:55:29 +00:00
parent c6f7b6f138
commit 2419314057
3 changed files with 126 additions and 86 deletions

View File

@ -11544,6 +11544,7 @@ main > .pksh-section:first-child {
.teachers-card {
display: flex;
flex-direction: column;
height: 100%;
background: var(--color-bg-card, #FFFFFF);
border: 1px solid var(--color-border, #E2E8F0);
border-radius: var(--radius-lg, 24px);
@ -11558,9 +11559,10 @@ main > .pksh-section:first-child {
.teachers-card.is-hidden {
display: none;
}
/* Фото — широкий верхний акцент, единый кроп */
.teachers-card__media {
position: relative;
aspect-ratio: 1 / 1;
aspect-ratio: 5 / 4;
overflow: hidden;
background: var(--color-primary-light, #EFF6FF);
}
@ -11568,138 +11570,166 @@ main > .pksh-section:first-child {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center 28%;
display: block;
}
/* Бейдж — компактный, визуально лёгкий */
.teachers-card__badge {
position: absolute;
left: 12px;
bottom: 12px;
max-width: calc(100% - 24px);
padding: 6px 14px;
left: 10px;
bottom: 10px;
max-width: calc(100% - 20px);
padding: 4px 10px;
border-radius: var(--radius-pill, 100px);
background: rgba(255, 255, 255, .92);
background: rgba(255, 255, 255, .9);
color: var(--color-primary, #2563EB);
font-size: 0.8125rem;
font-weight: 700;
line-height: 1.3;
box-shadow: 0 2px 8px rgba(15, 23, 42, .1);
font-size: 0.75rem;
font-weight: 600;
line-height: 1.25;
box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}
.teachers-card__body {
display: flex;
flex-direction: column;
gap: var(--space-2, 8px);
padding: clamp(16px, 1.6vw, 20px);
flex: 1;
gap: 6px;
padding: clamp(14px, 1.4vw, 18px);
text-align: center;
}
/* Имя — главный элемент, максимум 2 строки */
.teachers-card__name {
font-family: var(--font-display, inherit);
font-size: clamp(1.0625rem, 1.05vw, 1.1875rem);
font-size: clamp(1.0625rem, 1vw, 1.1875rem);
font-weight: 700;
line-height: 1.25;
line-height: 1.24;
margin: 0;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
overflow-wrap: anywhere;
text-wrap: balance;
}
/* Специализация — 2-й уровень, максимум 2 строки */
.teachers-card__direction {
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.3;
color: var(--color-primary, #2563EB);
}
.teachers-card__tenure {
font-size: 0.875rem;
color: var(--color-text, #1E293B);
}
.teachers-card__about {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 0.9375rem;
}
/* Характеристика — вторичный текст, максимум 2 строки */
.teachers-card__about {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 0.875rem;
line-height: 1.5;
color: var(--color-text-muted, #475569);
margin: 0;
text-wrap: pretty;
}
.teachers-card__rating {
/* Метаданные: стаж · рейтинг · отзывы — компактная строка, прижата к низу */
.teachers-card__meta {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 8px;
gap: 4px 10px;
margin-top: auto;
padding-top: var(--space-2, 8px);
padding-top: 6px;
font-size: 0.8125rem;
line-height: 1.3;
color: var(--color-text-muted, #475569);
}
.teachers-card__tenure {
font-size: 0.8125rem;
color: var(--color-text, #1E293B);
}
.teachers-card__tenure strong {
font-weight: 700;
}
.teachers-card__rating {
display: inline-flex;
align-items: center;
gap: 4px;
}
.teachers-card__stars {
display: inline-flex;
gap: 2px;
gap: 1px;
color: var(--color-border, #CBD5E1);
}
.teachers-card__star {
width: 13px;
height: 13px;
}
.teachers-card__star.is-filled {
color: #F59E0B;
}
.teachers-card__rating-num {
font-size: 0.875rem;
font-size: 0.8125rem;
font-weight: 700;
color: var(--color-text-muted, #475569);
}
.teachers-card__reviews {
font-size: 0.8125rem;
font-weight: 600;
color: var(--color-primary, #2563EB);
text-decoration: none;
border-bottom: 1px solid transparent;
transition: border-color .2s, color .2s;
}
.teachers-card__reviews:hover {
border-bottom-color: currentColor;
}
/* CTA-зона прижата к низу карточки */
.teachers-card__actions {
display: flex;
flex-direction: column;
gap: 10px;
margin-top: var(--space-2, 8px);
}
.teachers-card__reviews {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 6px 14px;
border-radius: var(--radius-pill, 100px);
background: var(--color-primary-light, #EFF6FF);
font-size: 0.8125rem;
font-weight: 700;
color: var(--color-primary, #2563EB);
text-decoration: none;
transition: background .2s, color .2s;
}
.teachers-card__reviews:hover {
background: var(--color-primary, #2563EB);
color: #FFFFFF;
gap: 8px;
margin-top: 10px;
}
.teachers-card__btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 10px 16px;
padding: 9px 16px;
border: none;
border-radius: var(--radius-pill, 100px);
background: var(--color-primary, #2563EB);
color: #FFFFFF;
font-size: 0.875rem;
font-weight: 700;
line-height: 1.25;
line-height: 1.2;
text-decoration: none;
cursor: pointer;
transition: background .2s;
transition: background .2s, transform .2s;
}
.teachers-card__btn:hover {
background: var(--color-primary-dark, #1D4ED8);
transform: translateY(-1px);
color: #FFFFFF;
}
.teachers-card__link {
display: inline-block;
text-align: center;
font-size: 0.875rem;
font-size: 0.8125rem;
font-weight: 600;
color: var(--color-primary, #2563EB);
color: var(--color-text-muted, #475569);
text-decoration: none;
transition: color .2s;
}
.teachers-card__link:hover {
color: var(--color-primary-dark, #1D4ED8);
text-decoration: underline;
color: var(--color-primary, #2563EB);
}
@media (prefers-reduced-motion: reduce) {
.teachers-card { transition: none; }
.teachers-card:hover { transform: none; }
.teachers-card,
.teachers-card__btn { transition: none; }
.teachers-card:hover,
.teachers-card__btn:hover { transform: none; }
}
.teachers-cards__card {
background: var(--color-bg);

File diff suppressed because one or more lines are too long

View File

@ -29,6 +29,23 @@ if ($start_year && absint($start_year) > 1900) {
$tenure = max(0, (int) $current_year - (int) $start_year);
}
$t_desc = trim((string) carbon_get_post_meta($tid, 'teacher_description'));
$rating_num = (float) $rating;
$teacher_rc = isset($teacher_review_counts[ $tid ]) ? (int) $teacher_review_counts[ $tid ] : 0;
$rc_word = '';
if ($teacher_rc > 0) {
$rc_mod10 = $teacher_rc % 10;
$rc_mod100 = $teacher_rc % 100;
if ($rc_mod10 === 1 && $rc_mod100 !== 11) {
$rc_word = 'отзыв';
} elseif ($rc_mod10 >= 2 && $rc_mod10 <= 4 && ( $rc_mod100 < 12 || $rc_mod100 > 14 )) {
$rc_word = 'отзыва';
} else {
$rc_word = 'отзывов';
}
}
$cat_filter = ! empty($cat) ? $cat : 'all';
?>
<article class="teachers-card reveal" data-category="<?php echo esc_attr($cat_filter); ?>">
@ -37,7 +54,7 @@ $cat_filter = ! empty($cat) ? $cat : 'all';
<img class="teachers-card__photo" loading="lazy" decoding="async"
src="<?php echo esc_url($avatar_url); ?>"
alt="<?php echo esc_attr($alt_text); ?>"
width="480" height="480">
width="480" height="384">
<?php endif; ?>
<?php if ($badge) : ?>
<span class="teachers-card__badge"><?php echo esc_html($badge); ?></span>
@ -51,43 +68,36 @@ $cat_filter = ! empty($cat) ? $cat : 'all';
<div class="teachers-card__direction"><?php echo esc_html($direction); ?></div>
<?php endif; ?>
<?php $t_desc = trim((string) carbon_get_post_meta($tid, 'teacher_description')); ?>
<?php if ($t_desc !== '') : ?>
<p class="teachers-card__about"><?php echo esc_html(wp_strip_all_tags($t_desc)); ?></p>
<?php endif; ?>
<?php if ($tenure) : ?>
<div class="teachers-card__tenure">Стаж: <strong><?php echo esc_html($tenure); ?></strong> лет</div>
<?php endif; ?>
<?php if ($tenure || $rating_num > 0 || $teacher_rc > 0) : ?>
<div class="teachers-card__meta">
<?php if ($tenure) : ?>
<span class="teachers-card__tenure">Стаж: <strong><?php echo esc_html($tenure); ?></strong> лет</span>
<?php endif; ?>
<?php $rating_num = (float) $rating; ?>
<?php if ($rating_num > 0) : ?>
<div class="teachers-card__rating" aria-label="Оценка: <?php echo esc_attr($rating_num); ?> из 5">
<span class="teachers-card__stars" aria-hidden="true">
<?php for ($s = 1; $s <= 5; $s++) : ?>
<svg class="teachers-card__star<?php echo $s <= round($rating_num) ? ' is-filled' : ''; ?>" width="16" height="16" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M10 1l2.39 4.84 5.34.78-3.87 3.77.92 5.34L10 13.27l-4.78 2.51.92-5.34L2.27 6.6l5.34-.78L10 1z"/></svg>
<?php endfor; ?>
<?php if ($rating_num > 0) : ?>
<span class="teachers-card__rating" aria-label="Оценка: <?php echo esc_attr($rating_num); ?> из 5">
<span class="teachers-card__stars" aria-hidden="true">
<?php for ($s = 1; $s <= 5; $s++) : ?>
<svg class="teachers-card__star<?php echo $s <= round($rating_num) ? ' is-filled' : ''; ?>" width="13" height="13" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path d="M10 1l2.39 4.84 5.34.78-3.87 3.77.92 5.34L10 13.27l-4.78 2.51.92-5.34L2.27 6.6l5.34-.78L10 1z"/></svg>
<?php endfor; ?>
</span>
<span class="teachers-card__rating-num"><?php echo esc_html(rtrim(rtrim(number_format($rating_num, 1), '0'), '.')); ?></span>
</span>
<span class="teachers-card__rating-num"><?php echo esc_html(rtrim(rtrim(number_format($rating_num, 1), '0'), '.')); ?></span>
<?php endif; ?>
<?php if ($teacher_rc > 0) : ?>
<a class="teachers-card__reviews" href="<?php echo esc_url(get_permalink($tid)); ?>">
<?php echo esc_html($teacher_rc . ' ' . $rc_word); ?>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="teachers-card__actions">
<?php $teacher_rc = isset($teacher_review_counts[ $tid ]) ? (int) $teacher_review_counts[ $tid ] : 0; ?>
<?php if ($teacher_rc > 0) :
$rc_mod10 = $teacher_rc % 10;
$rc_mod100 = $teacher_rc % 100;
if ($rc_mod10 === 1 && $rc_mod100 !== 11) {
$rc_word = 'отзыв';
} elseif ($rc_mod10 >= 2 && $rc_mod10 <= 4 && ( $rc_mod100 < 12 || $rc_mod100 > 14 )) {
$rc_word = 'отзыва';
} else {
$rc_word = 'отзывов';
} ?>
<a class="teachers-card__reviews" href="<?php echo esc_url(get_permalink($tid)); ?>">
<?php echo esc_html($teacher_rc . ' ' . $rc_word); ?> →
</a>
<?php endif; ?>
<a class="teachers-card__btn btn-write open-bitrix-form" href="#" onclick="return false;">
Записаться к преподавателю
</a>