@ -0,0 +1,18 @@ |
||||
<?php defined("ABSPATH") or exit; return array ( |
||||
'tokens' => |
||||
array ( |
||||
'wordpress' => 'v4.local.nalowbOW6cLbDpvTkpTnMOVG_1PGHdZKveVTUIbgUv2hUvQGr5zQ-B97k1oykPdIiLx0D0EZ0xlOdhwqgV_DcPsmh3eOrZ9mLJOlmxL0Ciq1Lkhewhj3h1H4FQuiSmfg1oylejDCLtbzfWil8GNxrzGOiBoiiY2XALTxBT0ZDcCZNAGmKQTElV9Lzw5TxDYEm9ELTLCaFj3rTN3Vq8bMQy8aHK-Mgq2QvaD3YYEJiTxcgTl97df6rJQnGtYiG9dvhVFhShNdUj1sWh9vIzoXiUbZbByLwe5ZUwaDzE3G7xosGlTyQJ3WIle3ywsfnjgNxRQwOz--XcEYGUJ_nhR3oJscW7SJXdi-ziE5dnDi6k2XpaIbTbppIUvdeyzRDpC2VajiSvb3jg5kcxHL_3bFo-7D4Rjmtr2ZEr8uS4-xwt8uhLiSBLcRsLSGSCq0yMlNmgsxxUdySDu2Q5P5pDX3_5hBdg-4DuBH.eyJlbmRwb2ludCI6Imh0dHBzOlwvXC9hcGkuY2Rlay5ydVwvY21zIn0', |
||||
'@cdek-it/order' => 'v4.local.-h0jllL5iFSEWHkSBGY1TfzpFIQGYeCif9pGrZorJtWeZ1mUew3VjChFhXL60cVcN5LCXw9d_ui-XG1kIzjrx-UzDfK4fS-l4OznAhLWp7ZT1M3-X-uQiVJk5lzCJ2rNGQ-TJudeOlqL4kDKcqaPLgDzq5MQEqvloGAvviatPL-Y9ifTI183xVxcL6O7J700dFcQEhhSIcYfVnQVG2L1d93gxaUUH-OIMk1hxF1LCdnNIy6F6Zjt9yswXDEfEGWfE8OJysQQJhTj1IIOcf4_AZ-gGrSaXMMcG-J6GfDIjoU-uFrXhpI10grwgmY5Xka3-SPj2fyVV_e5WVuOew5HK0oDyHWqnlE37dWbQTBNPMqUNL50fQxviTzDYHplbM_CUq8YlNx2O_7FMt7b2w2sZMHLZBaWtH4zmOj8T2v-rY_MLeVwPuAfZPKnHqZMoGBL312Zh-tCyqVIp8gZ2jXJvKXnzMgumJv_uxA6Sdgk.eyJlbmRwb2ludCI6Imh0dHBzOlwvXC9hcGkuY2Rlay5ydVwvY21zIn0', |
||||
'@cdek-it/settings' => 'v4.local.Dbb69cuN8PIE7d1_5w3bD5OZI0Z5_K9w_UbnCJGJlM5jLLWkdkKf4d_svhJySz-NMm8xVJsEMEnCOSRVZZZIlcRaOlNqi7bsIDYXmpcnVCKL5v8cUWn9nKRSNvKUuiSqU_1aJl2pi7ZvxpII6STV4xxkcMXdtfYF9AZAOD0b6gtd7v8OdXjBzeKwbsilj7bToUv4mrmAlgMhd_MG3rKRP5-INo0B-rkwK78Ul88YjCgf0ooPyRICdQzLAgD7x42FJ3vYI9UA8g3wffx5kJxbRWrKUEfwZ1zJp-NQKAcyK5KGLIu9OUoFcQN4U_KdnnZqdqwwkovB0JIbqz-HKQcdi1Xrq5wKk5lIF-HdJteYn2t8Refd9soVGmN67O_V2K1b09Jw4v973C4rOxvw4WZNXHTm9a0mTI0pTk3Y5Dv1tJuN23zH73G_kNN_TSLUenE1iTGPdSnGXxIcfBG-sBoS1Au62QbzUY7lhftD6Bq6T6-6.eyJlbmRwb2ludCI6Imh0dHBzOlwvXC9hcGkuY2Rlay5ydVwvY21zIn0', |
||||
), |
||||
'endpoints' => |
||||
array ( |
||||
'wordpress' => 'https://api.cdek.ru/cms', |
||||
'@cdek-it/order' => 'https://api.cdek.ru/cms', |
||||
'@cdek-it/settings' => 'https://api.cdek.ru/cms', |
||||
), |
||||
'keyring' => |
||||
array ( |
||||
'k4.pid.jwGFnADDct9ZphWj1tZslqzRDXQIgEjvyVx8LI6MJR7d' => 'TDOjk4smnqY5AYE-aGdmFJIescdcJb26nThfAK3AVPU', |
||||
), |
||||
); |
@ -0,0 +1,6 @@ |
||||
<?php |
||||
|
||||
include_module('author'); |
||||
include_component('author', 'author-archive'); |
||||
|
||||
?> |
@ -0,0 +1,211 @@ |
||||
<?php |
||||
if (!defined('ABSPATH')) { |
||||
exit; |
||||
} |
||||
|
||||
function count_nested_replies($comment_id) { |
||||
$count = 0; |
||||
$replies = get_comments(array( |
||||
'post_id' => get_the_ID(), |
||||
'status' => 'approve', |
||||
'parent' => $comment_id, |
||||
'order' => 'ASC' |
||||
)); |
||||
|
||||
if ($replies) { |
||||
$count += count($replies); |
||||
foreach ($replies as $reply) { |
||||
$count += count_nested_replies($reply->comment_ID); |
||||
} |
||||
} |
||||
|
||||
return $count; |
||||
} |
||||
|
||||
if (post_password_required()) { |
||||
return; |
||||
} |
||||
|
||||
if (!is_user_logged_in()) { |
||||
?> |
||||
<div class="comment-block"> |
||||
<p class="comment-block_text"> |
||||
<a href="#modal"><?php pll_e('Войдите'); ?></a>, <?php pll_e('чтобы оставлять комментарии'); ?> |
||||
</p> |
||||
</div> |
||||
<?php |
||||
} |
||||
|
||||
$top_level_comments = get_comments(array( |
||||
'post_id' => get_the_ID(), |
||||
'status' => 'approve', |
||||
'parent' => 0, |
||||
'order' => 'ASC' |
||||
)); |
||||
|
||||
if ($top_level_comments) { |
||||
echo '<div class="comment-block_wrapper">'; |
||||
|
||||
foreach ($top_level_comments as $comment) { |
||||
?> |
||||
<div class="comment-block" id="comment-<?php echo $comment->comment_ID; ?>">
|
||||
<div class="comment-user"> |
||||
<?php echo get_avatar($comment, 50); ?> |
||||
<div class="comment-user_text"> |
||||
<h6><?php echo get_comment_author($comment); ?></h6>
|
||||
<span><?php echo get_comment_date('d F Y', $comment); ?></span>
|
||||
</div> |
||||
</div> |
||||
<p><?php echo get_comment_text($comment); ?></p>
|
||||
<div class="comment-btns"> |
||||
<button class="reply-to-comment" data-comment-id="<?php echo $comment->comment_ID; ?>" data-post-id="<?php echo get_the_ID(); ?>" data-reply-to="<?php echo esc_attr(get_comment_author($comment)); ?>">
|
||||
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||
<path d="M9.5 3H3.25C2.00736 3 1 4.00736 1 5.25V5.25C1 6.49264 2.00736 7.5 3.25 7.5H3.5" stroke="#666666"></path> |
||||
<path d="M7 0.5L9.5 3L7 5.5" stroke="#666666"></path> |
||||
</svg> |
||||
<?php pll_e('Ответить'); ?> |
||||
</button> |
||||
<button class="comment-like-btn<?php echo is_user_liked_comment($comment->comment_ID) ? ' active' : ''; ?>" data-comment-id="<?php echo $comment->comment_ID; ?>">
|
||||
<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||
<path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" <?php echo is_user_liked_comment($comment->comment_ID) ? 'stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"' : 'stroke="#666666"'; ?>></path>
|
||||
</svg> |
||||
<?php echo get_comment_likes_count($comment->comment_ID); ?> |
||||
</button> |
||||
<?php |
||||
comment_reply_link(array( |
||||
'reply_text' => pll__('Ответить'), |
||||
'depth' => 1, |
||||
'max_depth' => get_option('thread_comments_depth'), |
||||
'before' => '<span style="display:none;">', |
||||
'after' => '</span>', |
||||
), $comment->comment_ID, get_the_ID()); |
||||
?> |
||||
</div> |
||||
<div class="reply-form-container" id="reply-form-<?php echo $comment->comment_ID; ?>" style="display: none;"></div>
|
||||
</div> |
||||
<?php |
||||
|
||||
$all_nested_replies = get_all_nested_replies($comment->comment_ID); |
||||
|
||||
if (!empty($all_nested_replies)) { |
||||
$total_reply_count = count($all_nested_replies); |
||||
?> |
||||
<button class="answer-btn"> |
||||
<svg width="15" height="10" viewBox="0 0 15 10" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||
<path d="M14 1.41406L7.5 7.91406L1 1.41406" stroke="#76CE75" stroke-width="2"></path> |
||||
</svg> |
||||
<?php echo $total_reply_count; ?> |
||||
<span> |
||||
<?php echo ($total_reply_count == 1) ? pll__('ответ') : pll__('ответа'); ?> |
||||
</span> |
||||
</button> |
||||
<?php |
||||
|
||||
foreach ($all_nested_replies as $reply) { |
||||
?> |
||||
<div class="comment-block answer-block" id="comment-<?php echo $reply->comment_ID; ?>">
|
||||
<div class="comment-user"> |
||||
<?php echo get_avatar($reply, 50); ?> |
||||
<div class="comment-user_text"> |
||||
<h6><?php echo get_comment_author($reply); ?></h6>
|
||||
<span><?php echo get_comment_date('d F Y', $reply); ?></span>
|
||||
</div> |
||||
</div> |
||||
<p><?php echo get_comment_text($reply); ?></p>
|
||||
<div class="comment-btns"> |
||||
<button class="reply-to-comment" data-comment-id="<?php echo $reply->comment_ID; ?>" data-post-id="<?php echo get_the_ID(); ?>" data-reply-to="<?php echo esc_attr(get_comment_author($reply)); ?>">
|
||||
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||
<path d="M9.5 3H3.25C2.00736 3 1 4.00736 1 5.25V5.25C1 6.49264 2.00736 7.5 3.25 7.5H3.5" stroke="#666666"></path> |
||||
<path d="M7 0.5L9.5 3L7 5.5" stroke="#666666"></path> |
||||
</svg> |
||||
<?php pll_e('Ответить'); ?> |
||||
</button> |
||||
<button class="comment-like-btn<?php echo is_user_liked_comment($reply->comment_ID) ? ' active' : ''; ?>" data-comment-id="<?php echo $reply->comment_ID; ?>">
|
||||
<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||
<path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" <?php echo is_user_liked_comment($reply->comment_ID) ? 'stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"' : 'stroke="#666666"'; ?>></path>
|
||||
</svg> |
||||
<?php echo get_comment_likes_count($reply->comment_ID); ?> |
||||
</button> |
||||
<?php |
||||
comment_reply_link(array( |
||||
'reply_text' => pll__('Ответить'), |
||||
'depth' => 2, |
||||
'max_depth' => get_option('thread_comments_depth'), |
||||
'before' => '<span style="display:none;">', |
||||
'after' => '</span>', |
||||
), $reply->comment_ID, get_the_ID()); |
||||
?> |
||||
</div> |
||||
<div class="reply-form-container" id="reply-form-<?php echo $reply->comment_ID; ?>" style="display: none;"></div>
|
||||
</div> |
||||
<?php |
||||
} |
||||
} |
||||
} |
||||
|
||||
echo '</div>'; |
||||
} |
||||
|
||||
function get_all_nested_replies($comment_id) { |
||||
$all_replies = array(); |
||||
|
||||
$direct_replies = get_comments(array( |
||||
'post_id' => get_the_ID(), |
||||
'status' => 'approve', |
||||
'parent' => $comment_id, |
||||
'order' => 'ASC' |
||||
)); |
||||
|
||||
$all_replies = array_merge($all_replies, $direct_replies); |
||||
|
||||
foreach ($direct_replies as $reply) { |
||||
$deeper_replies = get_all_nested_replies_recursive($reply->comment_ID); |
||||
$all_replies = array_merge($all_replies, $deeper_replies); |
||||
} |
||||
|
||||
return $all_replies; |
||||
} |
||||
|
||||
function get_all_nested_replies_recursive($comment_id) { |
||||
$replies = get_comments(array( |
||||
'post_id' => get_the_ID(), |
||||
'status' => 'approve', |
||||
'parent' => $comment_id, |
||||
'order' => 'ASC' |
||||
)); |
||||
|
||||
$all_replies = $replies; |
||||
|
||||
foreach ($replies as $reply) { |
||||
$deeper_replies = get_all_nested_replies_recursive($reply->comment_ID); |
||||
$all_replies = array_merge($all_replies, $deeper_replies); |
||||
} |
||||
|
||||
return $all_replies; |
||||
} |
||||
|
||||
if (is_user_logged_in()) { |
||||
$commenter = wp_get_current_commenter(); |
||||
$args = array( |
||||
'fields' => array( |
||||
'author' => '', |
||||
'email' => '', |
||||
'url' => '', |
||||
'cookies' => '', |
||||
), |
||||
'comment_field' => '<div class="comment-form-comment"><textarea id="comment" name="comment" placeholder="' . pll__('Ваш комментарий') . '" required></textarea></div>', |
||||
'title_reply' => pll__('Оставить комментарий'), |
||||
'title_reply_to' => pll__('Ответить %s'), |
||||
'class_submit' => 'comment-submit-btn', |
||||
'submit_button' => '<button name="%1$s" type="submit" id="%2$s" class="%3$s">%4$s</button>', |
||||
'submit_field' => '<div class="form-submit">%1$s %2$s</div>', |
||||
'cancel_reply_link' => pll__('Отменить'), |
||||
'id_form' => 'commentform', |
||||
'id_submit' => 'submit', |
||||
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">', |
||||
'title_reply_after' => '</h3>', |
||||
); |
||||
|
||||
comment_form($args); |
||||
} |
||||
?> |
@ -0,0 +1,21 @@ |
||||
<?php |
||||
|
||||
add_filter('woocommerce_currency_symbol', 'change_aed_currency_symbol', 10, 2); |
||||
|
||||
function change_aed_currency_symbol($currency_symbol, $currency) { |
||||
if ($currency == 'AED') { |
||||
$currency_symbol = 'AED'; |
||||
} |
||||
return $currency_symbol; |
||||
} |
||||
|
||||
add_filter('timber/context', function($context) { |
||||
// Передаем все нужные константы в контекст Twig |
||||
$context['CONSTANTS'] = [ |
||||
'DOMAIN' => defined('SITE_DOMAIN') ? SITE_DOMAIN : null, |
||||
]; |
||||
|
||||
return $context; |
||||
}); |
||||
|
||||
|
@ -0,0 +1,728 @@ |
||||
|
||||
|
||||
/* Where home */ |
||||
.where-home { |
||||
padding: 162px 0 37px; |
||||
color: var(--background); |
||||
} |
||||
|
||||
.authors h1{ |
||||
font-size: 82px; |
||||
font-weight: bold; |
||||
line-height: 96px; |
||||
color:#fff; |
||||
margin-bottom: 41px; |
||||
text-transform: uppercase; |
||||
} |
||||
|
||||
.where-home h1 { |
||||
font-size: 82px; |
||||
font-weight: bold; |
||||
line-height: 96px; |
||||
margin-bottom: 41px; |
||||
text-transform: uppercase; |
||||
} |
||||
|
||||
.where-home p { |
||||
max-width: 928px; |
||||
color: #FFF; |
||||
font-size: 36px; |
||||
font-weight: bold; |
||||
line-height: 40px; |
||||
text-transform: uppercase; |
||||
} |
||||
/* Where home end */ |
||||
|
||||
/* Find us */ |
||||
.find-us { |
||||
color: var(--background); |
||||
padding-bottom: 24px; |
||||
} |
||||
|
||||
.find-us h2 { |
||||
padding: 10px 0; |
||||
font-size: 36px; |
||||
font-weight: bold; |
||||
line-height: 40px; |
||||
text-transform: uppercase; |
||||
margin-bottom: 24px; |
||||
} |
||||
|
||||
.find-us ul { |
||||
display: grid; |
||||
grid-template-columns: repeat(2, minmax(0, 1fr)); |
||||
gap: 36px; |
||||
} |
||||
|
||||
.find-us h3 { |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
line-height: 28px; |
||||
margin-bottom: 8px; |
||||
text-transform: uppercase; |
||||
} |
||||
|
||||
.find-us p { |
||||
font-size: 24px; |
||||
font-weight: 500; |
||||
line-height: 32px; |
||||
} |
||||
/* Find us end */ |
||||
|
||||
/* Location */ |
||||
.location { |
||||
padding-bottom: 35px; |
||||
} |
||||
|
||||
.location h2 { |
||||
padding: 10px 0; |
||||
margin-bottom: 37px; |
||||
text-align: right; |
||||
font-size: 36px; |
||||
font-weight: bold; |
||||
line-height: 40px; |
||||
text-transform: uppercase; |
||||
color: var(--main_white); |
||||
} |
||||
|
||||
.location iframe { |
||||
height: 783px; |
||||
width: 100%; |
||||
border-radius: 64px; |
||||
} |
||||
/* Location end */ |
||||
|
||||
/* Sell form */ |
||||
.sell-form { |
||||
padding-bottom: 31px; |
||||
} |
||||
|
||||
.sell-form__container { |
||||
background: var(--main_white); |
||||
border-radius: 64px; |
||||
padding: 64px 105px 38px; |
||||
color: var(--grey-black); |
||||
display: flex; |
||||
flex-direction: column; |
||||
gap: 48px; |
||||
} |
||||
|
||||
.sell-form h2 { |
||||
font-size: 36px; |
||||
font-weight: bold; |
||||
line-height: 40px; |
||||
text-transform: uppercase; |
||||
} |
||||
|
||||
.sell-form p { |
||||
text-transform: uppercase; |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
line-height: 28px; |
||||
} |
||||
|
||||
.sell-form form { |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
gap: 16px; |
||||
} |
||||
|
||||
.sell-form form button { |
||||
background: var(--main_black); |
||||
padding: 11px 70px; |
||||
color: var(--main_white); |
||||
text-transform: uppercase; |
||||
border-radius: 16px; |
||||
font-size: 20px; |
||||
font-weight: 600; |
||||
line-height: 24px; |
||||
border: 1px solid var(--main_black); |
||||
} |
||||
|
||||
.sell-form form button:hover { |
||||
background: var(--main_white); |
||||
color: var(--main_black); |
||||
} |
||||
/* Sell form end */ |
||||
|
||||
/* Breadcrumb */ |
||||
.breadcrumb { |
||||
padding: 20px 0 24px; |
||||
} |
||||
|
||||
.breadcrumb .container { |
||||
color: var(--main_white); |
||||
font-size: 14px; |
||||
font-weight: 500; |
||||
line-height: 16px; |
||||
} |
||||
|
||||
.breadcrumb a { |
||||
display: inline; |
||||
} |
||||
/* Breadcrumb end */ |
||||
|
||||
/* Authors */ |
||||
.authors { |
||||
padding-bottom: 120px; |
||||
} |
||||
|
||||
.authors h2 { |
||||
font-weight: bold; |
||||
font-size: 64px; |
||||
line-height: 120%; |
||||
color: white; |
||||
text-transform: uppercase; |
||||
margin-bottom: 36px; |
||||
} |
||||
|
||||
.authors ul { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
align-items: stretch; |
||||
justify-content: center; |
||||
gap: 24px; |
||||
} |
||||
|
||||
.authors li { |
||||
background: #F5F5F5; |
||||
border-radius: 48px; |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
text-align: center; |
||||
width: calc(100% / 3 - 16px); |
||||
} |
||||
|
||||
.authors a { |
||||
padding: 52px 17px 57px; |
||||
width: 100%; |
||||
height: 100%; |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
} |
||||
|
||||
.authors .main-img { |
||||
width: 200px; |
||||
height: 200px; |
||||
border-radius: 50%; |
||||
overflow: hidden; |
||||
flex-shrink: 0; |
||||
margin-bottom: 31px; |
||||
} |
||||
|
||||
.authors .main-img img { |
||||
width: 100%; |
||||
height: 100%; |
||||
object-fit: cover; |
||||
} |
||||
|
||||
.authors-name { |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
text-transform: uppercase; |
||||
line-height: 28px; |
||||
color: #121212; |
||||
margin-bottom: 5px; |
||||
} |
||||
|
||||
.authors-type { |
||||
color: #121212; |
||||
font-size: 24px; |
||||
font-weight: 500; |
||||
line-height: 32px; |
||||
margin-bottom: 31px; |
||||
} |
||||
|
||||
.authors p { |
||||
color: #666666; |
||||
font-weight: 500; |
||||
font-size: 20px; |
||||
line-height: 24px; |
||||
} |
||||
/* Authors end */ |
||||
|
||||
/* author-head */ |
||||
.author-head { |
||||
padding-bottom: 36px; |
||||
} |
||||
|
||||
.author-head-content { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 31px; |
||||
margin-bottom: 17.5px; |
||||
} |
||||
|
||||
.author-head .main-img { |
||||
width: 278px; |
||||
height: 278px; |
||||
flex-shrink: 0; |
||||
border-radius: 48px; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.author-head .main-img img { |
||||
width: 100%; |
||||
height: 100%; |
||||
object-fit: cover; |
||||
} |
||||
|
||||
.author-name { |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
line-height: 28px; |
||||
color: white; |
||||
margin-bottom: 5px; |
||||
text-transform: uppercase; |
||||
} |
||||
|
||||
.author-type { |
||||
font-size: 24px; |
||||
font-weight: 500; |
||||
line-height: 32px; |
||||
color: white; |
||||
margin-bottom: 5px; |
||||
} |
||||
|
||||
.author-description { |
||||
font-size: 24px; |
||||
font-weight: 500; |
||||
line-height: 32px; |
||||
color: white; |
||||
margin-bottom: 45px; |
||||
} |
||||
|
||||
.author-head p { |
||||
font-size: 20px; |
||||
font-weight: 500; |
||||
line-height: 24px; |
||||
color: white; |
||||
} |
||||
|
||||
.author-head h2 { |
||||
font-size: 64px; |
||||
font-weight: bold; |
||||
line-height: 120%; |
||||
color: white; |
||||
} |
||||
/* author-head end */ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.home-title { |
||||
font-size: 82px; |
||||
font-weight: bold; |
||||
line-height: 96px; |
||||
color: var(--main_white); |
||||
margin-bottom: 16px; |
||||
} |
||||
|
||||
.home-description { |
||||
font-size: 32px; |
||||
font-weight: bold; |
||||
line-height: 40px; |
||||
color: var(--main_white); |
||||
text-transform: uppercase; |
||||
margin-bottom: 68px; |
||||
} |
||||
|
||||
.home-swp { |
||||
position: relative; |
||||
} |
||||
|
||||
.home-swp__btn { |
||||
position: absolute; |
||||
bottom: 22px; |
||||
left: 50%; |
||||
transform: translateX(-50%); |
||||
z-index: 2; |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 24px; |
||||
} |
||||
|
||||
.home-swp__btn button { |
||||
border: 1px solid var(--main_black); |
||||
background: var(--main_white); |
||||
width: 56px; |
||||
height: 56px; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
border-radius: 20px; |
||||
} |
||||
|
||||
.home-swp .swiper-slide:not(.swiper-slide-active) { |
||||
height: 0; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.home-card { |
||||
border-radius: 60px; |
||||
overflow: hidden; |
||||
display: flex; |
||||
align-items: flex-start; |
||||
gap: 24px; |
||||
position: relative; |
||||
} |
||||
|
||||
.home-card.bg-yellow { |
||||
background: var(--orange_80); |
||||
} |
||||
|
||||
.home-card.bg-green { |
||||
background: var(--green_90); |
||||
} |
||||
|
||||
.home-card.bg-violet { |
||||
background: var(--violet_90); |
||||
} |
||||
|
||||
.home-card__img { |
||||
width: 395px; |
||||
border-radius: 60px; |
||||
overflow: hidden; |
||||
height: 393px; |
||||
flex-shrink: 0; |
||||
} |
||||
|
||||
.home-card__img img { |
||||
width: 100%; |
||||
height: 100%; |
||||
object-fit: cover; |
||||
} |
||||
|
||||
.home-card__content { |
||||
padding: 32px 79px 0 0; |
||||
} |
||||
|
||||
.home-card__content-title { |
||||
font-size: 36px; |
||||
font-weight: bold; |
||||
line-height: 40px; |
||||
text-transform: uppercase; |
||||
max-width: 660px; |
||||
margin-bottom: 10px; |
||||
color: var(--interface_title); |
||||
} |
||||
|
||||
.home-card__content-description { |
||||
color: var(--interface_title); |
||||
margin-bottom: 10px; |
||||
font-size: 20px; |
||||
font-weight: 500; |
||||
line-height: 24px; |
||||
display: -webkit-box; |
||||
-webkit-line-clamp: 3; |
||||
-webkit-box-orient: vertical; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
} |
||||
|
||||
.home-card__content-body { |
||||
display: flex; |
||||
align-items: center; |
||||
flex-wrap: wrap; |
||||
gap: 12px; |
||||
} |
||||
|
||||
.home-card__content-body__alerts { |
||||
display: flex; |
||||
align-items: center; |
||||
flex-wrap: wrap; |
||||
gap: 12px; |
||||
} |
||||
|
||||
.home-card__content-body__alerts li { |
||||
background: var(--interface_hover); |
||||
color: var(--background); |
||||
border-radius: 16px; |
||||
padding: 6px 8px; |
||||
font-size: 16px; |
||||
font-weight: 500; |
||||
line-height: 20px; |
||||
} |
||||
|
||||
.home-card__content-body__day { |
||||
color: var(--interface_hover); |
||||
font-size: 14px; |
||||
font-weight: 500; |
||||
line-height: 16px; |
||||
} |
||||
|
||||
.home-card__content-body__time { |
||||
font-size: 14px; |
||||
font-weight: 500; |
||||
line-height: 16px; |
||||
color: var(--interface_hover); |
||||
} |
||||
|
||||
.home-card__content-body__data { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 12px; |
||||
} |
||||
|
||||
.home-card__content-body__data>div { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 4px; |
||||
font-size: 14px; |
||||
font-weight: 500; |
||||
line-height: 16px; |
||||
color: var(--interface_hover); |
||||
} |
||||
|
||||
.home-card__content-body__data>div .main-img { |
||||
width: 32px; |
||||
height: 32px; |
||||
border-radius: 50%; |
||||
object-fit: cover; |
||||
} |
||||
|
||||
.home-card__content-body__link { |
||||
border: 1px solid #000000; |
||||
border-radius: 28px; |
||||
background: var(--main_white); |
||||
position: absolute; |
||||
right: 37px; |
||||
bottom: 26px; |
||||
padding: 8.5px 16px 12.5px; |
||||
font-style: 20px; |
||||
font-weight: 500; |
||||
line-height: 24px; |
||||
} |
||||
/* Home end */ |
||||
|
||||
|
||||
/* Anons */ |
||||
.anons { |
||||
background: var(--main_white); |
||||
border-radius: 60px; |
||||
padding: 51px 0; |
||||
} |
||||
|
||||
.anons-theme__title { |
||||
color: var(--main_black); |
||||
font-size: 24px; |
||||
font-weight: bold; |
||||
line-height: 28px; |
||||
text-transform: uppercase; |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.anons-theme { |
||||
margin-bottom: 60px; |
||||
} |
||||
|
||||
.anons-theme ul { |
||||
max-width: 1022px; |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
gap: 12px; |
||||
} |
||||
|
||||
.anons-theme ul a { |
||||
font-size: 20px; |
||||
font-weight: 600; |
||||
line-height: 24px; |
||||
color: var(--main_black); |
||||
padding: 4px 24px; |
||||
border: 1px solid #000; |
||||
border-radius: 20px; |
||||
} |
||||
|
||||
.anons-theme ul a:hover, |
||||
.anons-theme ul a.active { |
||||
background: var(--main_black); |
||||
color: var(--main_white); |
||||
} |
||||
|
||||
.anons-best { |
||||
margin-bottom: 60px; |
||||
} |
||||
|
||||
.anons-best__title { |
||||
font-size: 36px; |
||||
line-height: 40px; |
||||
font-weight: bold; |
||||
color: var(--main_black); |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.anons-best__card-wrap { |
||||
display: grid; |
||||
grid-template-columns: repeat(3, minmax(0, 1fr)); |
||||
gap: 24px; |
||||
} |
||||
|
||||
.anons-best__card { |
||||
padding-top: 293px; |
||||
border-radius: 48px; |
||||
overflow: hidden; |
||||
position: relative; |
||||
z-index: 1; |
||||
} |
||||
|
||||
.anons-best__card.light { |
||||
padding-top: 0; |
||||
border-radius: 0; |
||||
} |
||||
|
||||
.anons-best__card .main-img { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
height: 360px; |
||||
z-index: -1; |
||||
} |
||||
|
||||
.anons-best__card .main-img img { |
||||
width: 100%; |
||||
height: 100%; |
||||
object-fit: cover; |
||||
} |
||||
|
||||
.anons-best__card.light .main-img { |
||||
position: static; |
||||
height: 265px; |
||||
} |
||||
.anons-best__card.light .main-img img { |
||||
border-radius: 30px; |
||||
} |
||||
|
||||
.anons-best__card-alerts { |
||||
position: absolute; |
||||
top: 21px; |
||||
left: 17px; |
||||
width: calc(100% - 34px); |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
gap: 7px; |
||||
z-index: 1; |
||||
} |
||||
|
||||
.anons-best__card-alerts li { |
||||
padding: 6px 8px; |
||||
font-size: 16px; |
||||
line-height: 20px; |
||||
font-weight: 500; |
||||
color: var(--background); |
||||
background: var(--main_black); |
||||
border-radius: 30px; |
||||
} |
||||
|
||||
.anons-best__card-body { |
||||
background: var(--accent-1); |
||||
padding: 30px 17px 22px; |
||||
border-radius: 48px 48px 0 0; |
||||
color: var(--main_white); |
||||
position: relative; |
||||
height: 100%; |
||||
} |
||||
|
||||
.anons-best__card.light .anons-best__card-body { |
||||
background: transparent; |
||||
color: var(--main_black); |
||||
padding: 12px 0 34px; |
||||
} |
||||
|
||||
.anons-best__card-body__title { |
||||
font-size: 28px; |
||||
font-weight: bold; |
||||
line-height: 32px; |
||||
text-transform: uppercase; |
||||
margin-bottom: 14px; |
||||
} |
||||
|
||||
.anons-best__card.light .anons-best__card-body__title { |
||||
font-size: 26px; |
||||
} |
||||
|
||||
.anons-best__card-body__datas { |
||||
display: flex; |
||||
align-items: center; |
||||
flex-wrap: wrap; |
||||
gap: 6px 10px; |
||||
max-width: 264px; |
||||
} |
||||
|
||||
.anons-best__card.light .anons-best__card-body__datas { |
||||
color: var(--placeholder); |
||||
} |
||||
|
||||
.anons-best__card-body__datas p { |
||||
font-size: 14px; |
||||
line-height: 16px; |
||||
font-weight: 500; |
||||
} |
||||
|
||||
.anons-best__card-body__datas ul { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 10px; |
||||
} |
||||
|
||||
.anons-best__card-body__datas ul li { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 4px; |
||||
font-size: 14px; |
||||
line-height: 16px; |
||||
font-weight: 500; |
||||
} |
||||
|
||||
.anons-best__card-body__datas ul .logo img { |
||||
width: 24px; |
||||
height: 24px; |
||||
border-radius: 50%; |
||||
object-fit: cover; |
||||
} |
||||
|
||||
.anons-article { |
||||
margin-bottom: 40px; |
||||
} |
||||
|
||||
.anons-article__title { |
||||
font-size: 36px; |
||||
line-height: 40px; |
||||
font-weight: bold; |
||||
color: var(--main_black); |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.anons-article__card-wrap { |
||||
display: grid; |
||||
grid-template-columns: repeat(3, minmax(0, 1fr)); |
||||
gap: 40px 25px; |
||||
} |
||||
|
||||
.anons-article__more-link { |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
} |
||||
|
||||
.anons-article__more-link a { |
||||
background: var(--accent-3); |
||||
color: var(--main_white); |
||||
border-radius: 20px; |
||||
border: 1px solid var(--main_white); |
||||
padding: 16px 24px; |
||||
font-size: 20px; |
||||
font-weight: 600; |
||||
line-height: 24px; |
||||
text-transform: uppercase; |
||||
} |
||||
/* Anons end */ |
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,120 @@ |
||||
/* Стили для мобильных устройств */ |
||||
@media only screen and (max-width: 576px) { |
||||
.anons-best__title { |
||||
font-size: 26px; |
||||
line-height: 32px; |
||||
margin-bottom: 12px; |
||||
} |
||||
|
||||
.anons-best__card { |
||||
padding-top: 205px; |
||||
} |
||||
|
||||
.anons-best__card .main-img { |
||||
height: 300px; |
||||
} |
||||
|
||||
.anons-best__card-body { |
||||
padding: 20px 17px; |
||||
} |
||||
|
||||
.anons-best__card-body__title { |
||||
font-size: 20px; |
||||
line-height: 24px; |
||||
margin-bottom: 16px; |
||||
} |
||||
|
||||
.anons-best__card.light .main-img { |
||||
height: 197px; |
||||
} |
||||
|
||||
.anons-best__card.light .anons-best__card-body__title { |
||||
font-size: 20px; |
||||
line-height: 24px; |
||||
} |
||||
|
||||
|
||||
|
||||
.authors { |
||||
padding-bottom: 138px; |
||||
} |
||||
|
||||
.authors h2 { |
||||
font-size: 32px; |
||||
line-height: 38px; |
||||
margin-bottom: 15px; |
||||
} |
||||
|
||||
.authors li { |
||||
border-radius: 24px; |
||||
width: 100%; |
||||
} |
||||
|
||||
.authors a { |
||||
padding: 32px 17px 52px; |
||||
} |
||||
|
||||
.authors .main-img { |
||||
width: 180px; |
||||
height: 180px; |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.authors-name { |
||||
font-size: 20px; |
||||
line-height: 24px; |
||||
} |
||||
|
||||
.authors-type { |
||||
font-size: 18px; |
||||
line-height: 24px; |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.authors p { |
||||
font-size: 16px; |
||||
line-height: 20px; |
||||
} |
||||
|
||||
.author-head { |
||||
padding-bottom: 15px; |
||||
} |
||||
|
||||
.author-head-content { |
||||
margin-bottom: 23px; |
||||
} |
||||
|
||||
.author-head .main-img { |
||||
width: 100%; |
||||
} |
||||
|
||||
.author-head h2 { |
||||
font-size: 32px; |
||||
line-height: 38px; |
||||
} |
||||
|
||||
.author-name { |
||||
font-size: 20px; |
||||
line-height: 24px; |
||||
} |
||||
|
||||
.author-type { |
||||
font-size: 18px; |
||||
line-height: 24px; |
||||
} |
||||
|
||||
.author-description { |
||||
font-size: 18px; |
||||
line-height: 24px; |
||||
margin-bottom: 24px; |
||||
} |
||||
|
||||
.author-head p { |
||||
font-size: 16px; |
||||
line-height: 20px; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,44 @@ |
||||
/* Стили для планшетов */ |
||||
@media only screen and (max-width: 992px) { |
||||
|
||||
.authors h2 { |
||||
font-size: 48px; |
||||
margin-bottom: 24px; |
||||
} |
||||
|
||||
.authors li { |
||||
border-radius: 32px; |
||||
width: calc(50% - 12px); |
||||
} |
||||
|
||||
.authors .main-img { |
||||
margin-bottom: 24px; |
||||
} |
||||
|
||||
.author { |
||||
padding-bottom: 24px; |
||||
} |
||||
|
||||
.author h2 { |
||||
font-size: 48px; |
||||
} |
||||
|
||||
.author-head-content { |
||||
flex-direction: column; |
||||
align-items: flex-start; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
/* Стили для планшетов */ |
||||
@media only screen and (max-width: 992px) { |
||||
|
||||
.author { |
||||
padding: 188px 0 36px; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
After Width: | Height: | Size: 225 B |
After Width: | Height: | Size: 216 KiB |
After Width: | Height: | Size: 167 KiB |
After Width: | Height: | Size: 261 KiB |
After Width: | Height: | Size: 261 KiB |
After Width: | Height: | Size: 247 KiB |
After Width: | Height: | Size: 429 KiB |
After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 676 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 439 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 460 B |
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,46 @@ |
||||
jQuery(document).ready(function ($) { |
||||
$('#ajax-load-author').on('submit', function (e) { |
||||
e.preventDefault(); |
||||
var form = $(this); |
||||
var currentPage = parseInt($('#page_num').val()); |
||||
var totalPosts = parseInt(form.data('total')); |
||||
var postsPerPage = 9; |
||||
|
||||
console.log('Current page before load:', currentPage); |
||||
console.log('Total posts:', totalPosts); |
||||
console.log('Posts loaded before request:', postsPerPage); |
||||
|
||||
var data = { |
||||
action: 'get_author_posts', |
||||
page_num: currentPage, |
||||
author_id: form.data('author') |
||||
}; |
||||
|
||||
console.log('Sending AJAX request with data:', data); |
||||
|
||||
$.ajax({ |
||||
url: '/wp-admin/admin-ajax.php', |
||||
type: 'POST', |
||||
data: data, |
||||
success: function (response) { |
||||
console.log('AJAX response received'); |
||||
$(".anons-article__card-wrap").append(response); |
||||
|
||||
$('#page_num').val(currentPage + 1); |
||||
console.log('New page number:', currentPage + 1); |
||||
|
||||
// Считаем общее количество загруженных постов
|
||||
var currentlyDisplayed = $('.anons-article__card-wrap .anons-best__card').length; |
||||
console.log('Actually displayed posts:', currentlyDisplayed); |
||||
|
||||
if (currentlyDisplayed >= totalPosts) { |
||||
console.log('Hiding load more button - all posts loaded'); |
||||
form.hide(); |
||||
} |
||||
}, |
||||
error: function (error) { |
||||
console.error('AJAX error:', error); |
||||
} |
||||
}); |
||||
}); |
||||
});
|
@ -0,0 +1,48 @@ |
||||
// const homeSwp = new Swiper('.home-swp .swiper', {
|
||||
// slidesPerView: 1,
|
||||
// spaceBetween: 0,
|
||||
// effect: 'fade',
|
||||
// loop: true,
|
||||
// navigation: {
|
||||
// nextEl: '.home-swp__btn-next',
|
||||
// prevEl: '.home-swp__btn-prev',
|
||||
// }
|
||||
// })
|
||||
|
||||
// const textsSwp = new Swiper('.texts-swp .swiper', {
|
||||
// slidesPerView: 1,
|
||||
// spaceBetween: 0,
|
||||
// loop: true,
|
||||
// effect: 'fade',
|
||||
// navigation: {
|
||||
// nextEl: '.texts-swp__next',
|
||||
// prevEl: '.texts-swp__prev'
|
||||
// },
|
||||
// pagination: {
|
||||
// el: ".texts-swp__pagination",
|
||||
// clickable: true,
|
||||
// }
|
||||
// })
|
||||
|
||||
// comment
|
||||
// let answerbtns = document.querySelectorAll('.answer-btn');
|
||||
// let answerbtnicons = document.querySelectorAll('.answer-btn svg');
|
||||
// let answerblocks = document.querySelectorAll('.answer-block');
|
||||
|
||||
// answerbtns.forEach((answerbtn, index) => {
|
||||
// answerbtn.addEventListener('click', () => {
|
||||
// let answerbtnicon = answerbtnicons[index];
|
||||
// let answerblock = answerblocks[index];
|
||||
|
||||
// answerblock.classList.toggle('active');
|
||||
// answerbtnicon.classList.toggle('active');
|
||||
|
||||
// let buttonText = answerbtn.querySelector('span');
|
||||
// if (buttonText.textContent === 'Ответ') {
|
||||
// buttonText.textContent = 'Свернуть';
|
||||
// } else {
|
||||
// buttonText.textContent = 'ответ';
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// comment
|
@ -0,0 +1,54 @@ |
||||
<?php |
||||
|
||||
include_component('blog', 'featured-slider'); |
||||
include_module('forms'); |
||||
include_component('forms', 'discount'); |
||||
|
||||
$context = Timber::context(); |
||||
|
||||
$context['blog_title'] = get_field('blog_title', 'options'); |
||||
$context['blog_desc'] = get_field('blog_desc', 'options'); |
||||
$context['post_count'] = wp_count_posts()->publish; |
||||
$context['total_pages'] = ceil($context['post_count'] / get_option('posts_per_page')); |
||||
|
||||
$context['sub_title'] = get_field('sub_title', 383); |
||||
$context['sub_text'] = get_field('sub_text', 383); |
||||
|
||||
$authors = Timber::get_posts([ |
||||
'post_type' => 'blog_author', |
||||
'posts_per_page' => -1, |
||||
'orderby' => 'menu_order', |
||||
'order' => 'ASC', |
||||
]); |
||||
|
||||
$authors_arr = iterator_to_array($authors); |
||||
foreach ($authors_arr as $author) { |
||||
$author_id = $author->ID; |
||||
$query = new WP_Query([ |
||||
'post_type' => 'post', |
||||
'posts_per_page' => -1, |
||||
'meta_query' => [ |
||||
[ |
||||
'key' => 'post_author', |
||||
'value' => $author_id, |
||||
'compare' => '=' |
||||
] |
||||
] |
||||
]); |
||||
$author->post_count = $query->found_posts; |
||||
$author->position = get_field('post', $author_id); |
||||
$author->posts = Timber::get_posts([ |
||||
'post_type' => 'post', |
||||
'posts_per_page' => -1, |
||||
'meta_query' => [ |
||||
[ |
||||
'key' => 'post_author', |
||||
'value' => $author_id, |
||||
'compare' => '=' |
||||
] |
||||
] |
||||
]); |
||||
} |
||||
$context['authors'] = $authors_arr; |
||||
|
||||
Timber::render('blog_author/author-archive.twig', $context); |
@ -0,0 +1,41 @@ |
||||
<?php |
||||
|
||||
$context = Timber::get_context(); |
||||
|
||||
$author = Timber::get_post(); |
||||
$author_id = $author->ID; |
||||
|
||||
|
||||
$author->position = get_field('post', $author_id); |
||||
|
||||
$count_query = new WP_Query([ |
||||
'post_type' => 'post', |
||||
'post_status' => 'publish', |
||||
'posts_per_page' => -1, |
||||
'meta_query' => [ |
||||
[ |
||||
'key' => 'post_author', |
||||
'value' => $author_id, |
||||
'compare' => '=' |
||||
] |
||||
] |
||||
]); |
||||
$author->post_count = $count_query->found_posts; |
||||
|
||||
$author->posts = Timber::get_posts([ |
||||
'post_type' => 'post', |
||||
'post_status' => 'publish', |
||||
'posts_per_page' => 9, |
||||
'meta_query' => [ |
||||
[ |
||||
'key' => 'post_author', |
||||
'value' => $author_id, |
||||
'compare' => '=' |
||||
] |
||||
] |
||||
]); |
||||
|
||||
$context['author'] = $author; |
||||
$context['total_pages'] = ceil($author->post_count / 9); |
||||
|
||||
Timber::render('blog_author/author-single.twig', $context); |
@ -0,0 +1,35 @@ |
||||
<?php |
||||
|
||||
include_module('author'); |
||||
|
||||
function get_author_posts() { |
||||
$author_id = isset($_POST['author_id']) ? sanitize_text_field($_POST['author_id']) : ''; |
||||
|
||||
$all_posts = Timber::get_posts([ |
||||
'post_type' => 'post', |
||||
'post_status' => 'publish', |
||||
'posts_per_page' => -1, |
||||
'meta_query' => [ |
||||
[ |
||||
'key' => 'post_author', |
||||
'value' => $author_id, |
||||
'compare' => '=' |
||||
] |
||||
] |
||||
]); |
||||
|
||||
if ($all_posts instanceof \Timber\PostQuery || $all_posts instanceof \Timber\PostCollection) { |
||||
$all_posts = $all_posts->get_posts(); |
||||
} |
||||
|
||||
$remaining_posts = array_slice($all_posts, 9); |
||||
|
||||
$context = Timber::context(); |
||||
$context['posts'] = $remaining_posts; |
||||
|
||||
Timber::render('blog_author/author-posts-list.twig', $context); |
||||
wp_die(); |
||||
} |
||||
|
||||
add_action('wp_ajax_get_author_posts', 'get_author_posts'); |
||||
add_action('wp_ajax_nopriv_get_author_posts', 'get_author_posts'); |
@ -0,0 +1,198 @@ |
||||
// comment
|
||||
let answerbtns = document.querySelectorAll('.answer-btn'); |
||||
let answerbtnicons = document.querySelectorAll('.answer-btn svg'); |
||||
|
||||
// При загрузке страницы проверяем активные кнопки
|
||||
document.addEventListener('DOMContentLoaded', function() { |
||||
// Для каждой кнопки ответов
|
||||
answerbtns.forEach((answerbtn) => { |
||||
// Находим родительский контейнер, чтобы искать ответы только для этого комментария
|
||||
const buttonParent = answerbtn.parentElement; |
||||
|
||||
// Находим все блоки ответов для этого комментария (после текущей кнопки)
|
||||
const answerBlocks = getRelatedAnswerBlocks(answerbtn); |
||||
if (answerBlocks.length === 0) return; |
||||
|
||||
// Проверяем, должны ли быть ответы развернуты (если у кнопки или любого ответа есть класс active)
|
||||
const shouldBeActive = answerbtn.querySelector('svg').classList.contains('active') ||
|
||||
Array.from(answerBlocks).some(block => block.classList.contains('active')); |
||||
|
||||
if (shouldBeActive) { |
||||
// Активируем все ответы только для этого комментария
|
||||
answerBlocks.forEach(block => { |
||||
block.classList.add('active'); |
||||
}); |
||||
|
||||
// Обновляем состояние кнопки
|
||||
answerbtn.querySelector('svg').classList.add('active'); |
||||
|
||||
// Обновляем текст кнопки
|
||||
let buttonText = answerbtn.querySelector('span'); |
||||
if (buttonText) { |
||||
buttonText.textContent = 'Свернуть'; |
||||
} |
||||
} else { |
||||
// Скрываем все ответы
|
||||
answerBlocks.forEach(block => { |
||||
block.classList.remove('active'); |
||||
}); |
||||
|
||||
// Обновляем состояние кнопки
|
||||
answerbtn.querySelector('svg').classList.remove('active'); |
||||
|
||||
// Обновляем текст кнопки в зависимости от количества ответов
|
||||
let buttonText = answerbtn.querySelector('span'); |
||||
if (buttonText) { |
||||
const count = answerBlocks.length; |
||||
buttonText.textContent = count === 1 ? 'ответ' : 'ответа'; |
||||
} |
||||
} |
||||
}); |
||||
}); |
||||
|
||||
// Функция для получения блоков ответов, связанных с данной кнопкой
|
||||
function getRelatedAnswerBlocks(answerBtn) { |
||||
// Получаем следующий блок комментариев (если он есть)
|
||||
let currentElement = answerBtn; |
||||
let answerBlocks = []; |
||||
|
||||
// Собираем все блоки ответов до следующего основного комментария или кнопки ответов
|
||||
while ((currentElement = currentElement.nextElementSibling) !== null) { |
||||
if (currentElement.classList.contains('comment-block') && !currentElement.classList.contains('answer-block')) { |
||||
// Достигли следующего основного комментария, прерываем сбор
|
||||
break; |
||||
} else if (currentElement.classList.contains('answer-btn')) { |
||||
// Достигли следующей кнопки ответов, прерываем сбор
|
||||
break; |
||||
} else if (currentElement.classList.contains('answer-block')) { |
||||
// Это блок ответа, добавляем в коллекцию
|
||||
answerBlocks.push(currentElement); |
||||
} |
||||
} |
||||
|
||||
return answerBlocks; |
||||
} |
||||
|
||||
// Обработчики нажатия на кнопки ответов
|
||||
answerbtns.forEach((answerbtn) => { |
||||
answerbtn.addEventListener('click', () => { |
||||
// Получаем все блоки ответов для этого комментария
|
||||
const answerBlocks = getRelatedAnswerBlocks(answerbtn); |
||||
if (answerBlocks.length === 0) return; |
||||
|
||||
// Определяем, развернуты ли ответы сейчас
|
||||
const isCurrentlyActive = answerbtn.querySelector('svg').classList.contains('active'); |
||||
|
||||
// Переключаем состояние
|
||||
if (isCurrentlyActive) { |
||||
// Скрываем все ответы
|
||||
answerBlocks.forEach(block => { |
||||
block.classList.remove('active'); |
||||
}); |
||||
|
||||
// Обновляем состояние кнопки
|
||||
answerbtn.querySelector('svg').classList.remove('active'); |
||||
|
||||
// Обновляем текст кнопки
|
||||
let buttonText = answerbtn.querySelector('span'); |
||||
if (buttonText) { |
||||
const count = answerBlocks.length; |
||||
buttonText.textContent = count === 1 ? 'ответ' : 'ответа'; |
||||
} |
||||
} else { |
||||
// Показываем все ответы
|
||||
answerBlocks.forEach(block => { |
||||
block.classList.add('active'); |
||||
}); |
||||
|
||||
// Обновляем состояние кнопки
|
||||
answerbtn.querySelector('svg').classList.add('active'); |
||||
|
||||
// Обновляем текст кнопки
|
||||
let buttonText = answerbtn.querySelector('span'); |
||||
if (buttonText) { |
||||
buttonText.textContent = 'Свернуть'; |
||||
} |
||||
} |
||||
}); |
||||
}); |
||||
|
||||
// Обработка нажатия на кнопку "Ответить" на комментарий
|
||||
document.addEventListener('DOMContentLoaded', function() { |
||||
// Получаем все кнопки "Ответить" на странице
|
||||
const replyButtons = document.querySelectorAll('.reply-to-comment'); |
||||
|
||||
// Добавляем обработчик на каждую кнопку
|
||||
replyButtons.forEach(button => { |
||||
button.addEventListener('click', function() { |
||||
// Получаем ID комментария, на который отвечаем
|
||||
const commentId = this.getAttribute('data-comment-id'); |
||||
const postId = this.getAttribute('data-post-id'); |
||||
const replyToName = this.getAttribute('data-reply-to'); |
||||
|
||||
// Получаем контейнер для формы ответа
|
||||
const replyFormContainer = document.getElementById('reply-form-' + commentId); |
||||
|
||||
// Если форма уже открыта, скрываем её
|
||||
if (replyFormContainer.style.display !== 'none') { |
||||
replyFormContainer.style.display = 'none'; |
||||
return; |
||||
} |
||||
|
||||
// Скрываем все открытые формы ответов
|
||||
document.querySelectorAll('.reply-form-container').forEach(container => { |
||||
container.style.display = 'none'; |
||||
}); |
||||
|
||||
// Клонируем основную форму комментариев
|
||||
const originalForm = document.getElementById('commentform'); |
||||
if (originalForm) { |
||||
const clonedForm = originalForm.cloneNode(true); |
||||
|
||||
// Изменяем атрибуты формы для ответа
|
||||
clonedForm.id = 'commentform-reply-' + commentId; |
||||
|
||||
// Добавляем скрытое поле с ID родительского комментария
|
||||
const hiddenInput = document.createElement('input'); |
||||
hiddenInput.type = 'hidden'; |
||||
hiddenInput.name = 'comment_parent'; |
||||
hiddenInput.value = commentId; |
||||
clonedForm.appendChild(hiddenInput); |
||||
|
||||
// Изменяем заголовок формы
|
||||
const formTitle = clonedForm.querySelector('.comment-reply-title'); |
||||
if (formTitle) { |
||||
formTitle.textContent = 'Ответить ' + replyToName; |
||||
} |
||||
|
||||
// Добавляем кнопку отмены
|
||||
const cancelButton = document.createElement('button'); |
||||
cancelButton.type = 'button'; |
||||
cancelButton.className = 'cancel-reply-btn'; |
||||
cancelButton.textContent = 'Отменить'; |
||||
cancelButton.addEventListener('click', function() { |
||||
replyFormContainer.style.display = 'none'; |
||||
}); |
||||
|
||||
// Добавляем кнопку отмены в форму
|
||||
const submitContainer = clonedForm.querySelector('.form-submit'); |
||||
if (submitContainer) { |
||||
submitContainer.appendChild(cancelButton); |
||||
} |
||||
|
||||
// Очищаем контейнер и добавляем клонированную форму
|
||||
replyFormContainer.innerHTML = ''; |
||||
replyFormContainer.appendChild(clonedForm); |
||||
|
||||
// Показываем форму
|
||||
replyFormContainer.style.display = 'block'; |
||||
|
||||
// Фокусируемся на текстовой области
|
||||
const textarea = clonedForm.querySelector('textarea'); |
||||
if (textarea) { |
||||
textarea.focus(); |
||||
} |
||||
} |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,200 @@ |
||||
/* Editorial */ |
||||
.editorial { |
||||
padding-bottom: 68px; |
||||
} |
||||
|
||||
.editorial-head { |
||||
position: relative; |
||||
z-index: 1; |
||||
max-width: 841px; |
||||
margin-bottom: 37px; |
||||
} |
||||
|
||||
.editorial-head__title { |
||||
font-size: 82px; |
||||
line-height: 96px; |
||||
font-weight: bold; |
||||
color: var(--main_white); |
||||
text-transform: uppercase; |
||||
} |
||||
|
||||
.editorial-head__img { |
||||
position: absolute; |
||||
z-index: -1; |
||||
top: -14px; |
||||
right: -20px; |
||||
width: 221px; |
||||
} |
||||
|
||||
.editorial-head__star { |
||||
position: absolute; |
||||
top: 8.26px; |
||||
right: -13.5px; |
||||
transform: translateX(100%); |
||||
width: 87.5px; |
||||
} |
||||
|
||||
.editorial-card__wrap { |
||||
display: grid; |
||||
grid-template-columns: repeat(2, minmax(0, 1fr)); |
||||
gap: 31px 25px; |
||||
position: relative; |
||||
z-index: 1; |
||||
} |
||||
|
||||
.editorial-card { |
||||
border: 2px solid var(--creme-white); |
||||
border-radius: 30px; |
||||
display: flex; |
||||
align-items: stretch; |
||||
overflow: hidden; |
||||
background: var(--linear); |
||||
backdrop-filter: blur(28px); |
||||
} |
||||
|
||||
.editorial-card .main-img { |
||||
min-height: 282px; |
||||
width: 207px; |
||||
border-radius: 29px; |
||||
overflow: hidden; |
||||
flex-shrink: 0; |
||||
} |
||||
|
||||
.editorial-card:hover .main-img img{ |
||||
width: 120%; |
||||
height: 120%; |
||||
} |
||||
|
||||
.editorial-card .main-img img { |
||||
width: 100%; |
||||
height: 100%; |
||||
object-fit: cover; |
||||
transition: all .5s; |
||||
} |
||||
|
||||
.editorial-card__content { |
||||
padding: 42px 19px 19px 35px; |
||||
} |
||||
|
||||
.editorial-card__content-alerts { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
align-items: center; |
||||
gap: 7px; |
||||
margin-bottom: 17px; |
||||
} |
||||
|
||||
.editorial-card__content-alerts a { |
||||
background: var(--main_black); |
||||
border-radius: 16px; |
||||
padding: 6px 8px; |
||||
font-size: 16px; |
||||
font-weight: 500; |
||||
line-height: 20px; |
||||
color: var(--background); |
||||
} |
||||
|
||||
.editorial-card__content-title { |
||||
font-size: 28px; |
||||
font-weight: bold; |
||||
line-height: 32px; |
||||
color: var(--grey-black); |
||||
text-transform: uppercase; |
||||
margin-bottom: 17px; |
||||
} |
||||
|
||||
.editorial-card__content-data { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
gap: 5px 16px; |
||||
color: var(--interface_hover); |
||||
font-size: 16px; |
||||
font-weight: 500; |
||||
line-height: 20px; |
||||
} |
||||
|
||||
.editorial-card__content-data ul { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 16px; |
||||
} |
||||
|
||||
.editorial-card__content-data li { |
||||
display: flex; |
||||
align-items: center; |
||||
gap: 5px; |
||||
} |
||||
|
||||
.editorial-card__content-data .logo img { |
||||
width: 24px; |
||||
height: 24px; |
||||
border-radius: 50%; |
||||
object-fit: cover; |
||||
} |
||||
/* Editorial end */ |
||||
|
||||
@media (max-width: 1200px) { |
||||
.editorial-card__wrap { |
||||
grid-template-columns: repeat(1, minmax(0, 1fr)); |
||||
} |
||||
} |
||||
|
||||
@media (max-width: 992px) { |
||||
.editorial { |
||||
padding-bottom: 36px; |
||||
} |
||||
|
||||
.editorial-head { |
||||
margin-bottom: 36px; |
||||
max-width: 313px; |
||||
} |
||||
|
||||
.editorial-head__title { |
||||
font-size: 32px; |
||||
line-height: 38px; |
||||
} |
||||
|
||||
.editorial-head__img { |
||||
width: 100px; |
||||
top: -14px; |
||||
right: -22.5px; |
||||
} |
||||
|
||||
.editorial-head__star { |
||||
display: none; |
||||
} |
||||
} |
||||
|
||||
@media (max-width: 576px) { |
||||
.editorial-card { |
||||
flex-direction: column; |
||||
border-radius: 30px; |
||||
position: relative; |
||||
} |
||||
|
||||
.editorial-card .main-img { |
||||
width: 100%; |
||||
height: 203px; |
||||
} |
||||
|
||||
.editorial-card__content { |
||||
padding: 17px 13px 24px; |
||||
} |
||||
|
||||
.editorial-card__content-alerts { |
||||
position: absolute; |
||||
top: 13px; |
||||
left: 8px; |
||||
width: calc(100% - 16px); |
||||
} |
||||
|
||||
.editorial-card__content-title { |
||||
font-size: 20px; |
||||
line-height: 24px; |
||||
margin-bottom: 17px; |
||||
} |
||||
|
||||
.editorial-card__content-data { |
||||
gap: 5px 16px; |
||||
} |
||||
} |
After Width: | Height: | Size: 439 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 246 B |
@ -0,0 +1,147 @@ |
||||
jQuery(document).ready(function ($) { |
||||
$(".comment-btn button").on("click", function () { |
||||
var postId = $(this).data("post-id"); |
||||
var $button = $(this); |
||||
|
||||
$.ajax({ |
||||
url: "/wp-admin/admin-ajax.php", |
||||
type: "POST", |
||||
data: { |
||||
action: "add_post_like", |
||||
post_id: postId, |
||||
}, |
||||
success: function (response) { |
||||
if (response.error) { |
||||
alert(response.error); |
||||
window.location.href = "/wp-login.php"; |
||||
return; |
||||
} |
||||
|
||||
$(".comment-btn span").text(response.count); |
||||
|
||||
if (response.is_liked) { |
||||
$button.addClass("active"); |
||||
|
||||
$button.find("svg path").attr({ |
||||
fill: "rgba(255, 0, 0, 0.7)", |
||||
stroke: "#ff0000", |
||||
}); |
||||
} else { |
||||
$button.removeClass("active"); |
||||
|
||||
$button.find("svg path").attr({ |
||||
fill: "rgb(18, 18, 18)", |
||||
stroke: "#666666", |
||||
}); |
||||
} |
||||
}, |
||||
error: function (error) { |
||||
if (error.responseJSON && error.responseJSON.data) { |
||||
alert(error.responseJSON.data); |
||||
window.location.href = "/wp-login.php"; |
||||
} |
||||
}, |
||||
}); |
||||
}); |
||||
|
||||
$(document).on("click", ".comment-like-btn", function () { |
||||
var commentId = $(this).data("comment-id"); |
||||
var $button = $(this); |
||||
|
||||
$.ajax({ |
||||
url: "/wp-admin/admin-ajax.php", |
||||
type: "POST", |
||||
data: { |
||||
action: "add_comment_like", |
||||
comment_id: commentId, |
||||
}, |
||||
success: function (response) { |
||||
if (response.error) { |
||||
alert(response.error); |
||||
window.location.href = "/wp-login.php"; |
||||
return; |
||||
} |
||||
|
||||
if (response.is_liked) { |
||||
$button |
||||
.empty() |
||||
.append( |
||||
$( |
||||
'<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"></path></svg>' |
||||
) |
||||
) |
||||
.append(response.count); |
||||
$button.addClass("active"); |
||||
} else { |
||||
$button |
||||
.empty() |
||||
.append( |
||||
$( |
||||
'<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" stroke="#666666" fill="none"></path></svg>' |
||||
) |
||||
) |
||||
.append(response.count); |
||||
$button.removeClass("active"); |
||||
} |
||||
}, |
||||
error: function (error) { |
||||
if (error.responseJSON && error.responseJSON.data) { |
||||
alert(error.responseJSON.data); |
||||
window.location.href = "/wp-login.php"; |
||||
} |
||||
}, |
||||
}); |
||||
}); |
||||
|
||||
function checkLikedPosts() { |
||||
if (!document.body.classList.contains("logged-in")) { |
||||
return; |
||||
} |
||||
|
||||
$.ajax({ |
||||
url: "/wp-admin/admin-ajax.php", |
||||
type: "POST", |
||||
data: { |
||||
action: "check_user_likes", |
||||
}, |
||||
success: function (response) { |
||||
if (response.error) { |
||||
return; |
||||
} |
||||
|
||||
try { |
||||
var data = JSON.parse(response); |
||||
|
||||
if (data.posts && data.posts.length > 0) { |
||||
for (var i = 0; i < data.posts.length; i++) { |
||||
var $button = $('.comment-btn button[data-post-id="' + data.posts[i] + '"]'); |
||||
$button.addClass("active"); |
||||
$button.find("svg path").attr({ |
||||
fill: "rgba(255, 0, 0, 0.7)", |
||||
stroke: "#ff0000", |
||||
}); |
||||
} |
||||
} |
||||
|
||||
if (data.comments && data.comments.length > 0) { |
||||
for (var j = 0; j < data.comments.length; j++) { |
||||
var $commentButton = $('.comment-like-btn[data-comment-id="' + data.comments[j] + '"]'); |
||||
$commentButton.addClass("active"); |
||||
|
||||
$commentButton.find("svg path").attr({ |
||||
fill: "rgba(255, 0, 0, 0.7)", |
||||
stroke: "#ff0000", |
||||
}); |
||||
} |
||||
} |
||||
} catch (e) {} |
||||
}, |
||||
error: function (error) {}, |
||||
}); |
||||
} |
||||
|
||||
if (document.body.classList.contains("logged-in")) { |
||||
checkLikedPosts(); |
||||
} |
||||
}); |
||||
|
@ -1,151 +0,0 @@ |
||||
'use strict'; |
||||
|
||||
// function
|
||||
function modalOpen(buttonElement, contentElement){ |
||||
let modal = document.querySelector('.modal'), |
||||
aside = document.querySelector('.modal__aside'), |
||||
elements = document.querySelectorAll(buttonElement), |
||||
device = window.screen.width; |
||||
|
||||
elements.forEach(e => { |
||||
let thisContentElement = document.querySelector(contentElement); |
||||
|
||||
e.onclick = function () { |
||||
modal.classList.add('active'); |
||||
thisContentElement.classList.add('active'); |
||||
|
||||
let width = thisContentElement.clientWidth; |
||||
|
||||
setTimeout(() => { |
||||
if (device <= 720) { |
||||
aside.style.width = `${device}px`; |
||||
thisContentElement.style.opacity = 1; |
||||
thisContentElement.style.filter = 'blur(0px)'; |
||||
}else{ |
||||
aside.style.width = `${width}px`; |
||||
thisContentElement.style.opacity = 1; |
||||
thisContentElement.style.filter = 'blur(0px)'; |
||||
} |
||||
}, 10); |
||||
} |
||||
}) |
||||
} |
||||
|
||||
function modalClose(buttonElement) { |
||||
let modal = document.querySelector('.modal'), |
||||
aside = document.querySelector('.modal__aside'), |
||||
asideItems = document.querySelectorAll('.modal__item'), |
||||
elements = document.querySelectorAll(buttonElement); |
||||
|
||||
elements.forEach(e => { |
||||
e.onclick = function () {
|
||||
aside.style.width = '0px'; |
||||
|
||||
asideItems.forEach(e => { |
||||
if (e.classList.contains('active')) { |
||||
e.style.filter = 'blur(10px)'; |
||||
} |
||||
}); |
||||
|
||||
setTimeout(() => { |
||||
asideItems.forEach(e => { |
||||
if (e.classList.contains('active')) { |
||||
e.classList.remove('active'); |
||||
} |
||||
}); |
||||
|
||||
modal.classList.remove('active'); |
||||
}, 300); |
||||
} |
||||
}) |
||||
} |
||||
|
||||
function toggleOpenX(mainElement, buttonElement ,heightElement, contentElement, close) { |
||||
let elements = document.querySelectorAll(mainElement); |
||||
|
||||
elements.forEach(e => { |
||||
let thisMainElement = e, |
||||
thisButtonElement = e.querySelector(buttonElement), |
||||
thisHeightElement = e.querySelector(heightElement), |
||||
thisContentElement = e.querySelector(contentElement);
|
||||
|
||||
thisButtonElement.onclick = function (e) { |
||||
let height = thisHeightElement.clientHeight; |
||||
|
||||
if (close == true && !thisMainElement.classList.contains('active')) { |
||||
elements.forEach(e => { |
||||
if (e.classList.contains('active')) { |
||||
e.classList.remove('active'); |
||||
e.querySelector(contentElement).style.height = null |
||||
}
|
||||
}) |
||||
} |
||||
|
||||
if (!thisMainElement.classList.contains('active')) { |
||||
thisContentElement.style.height = `${height}px`; |
||||
thisMainElement.classList.add('active'); |
||||
}else{ |
||||
thisContentElement.style.height = null; |
||||
thisMainElement.classList.remove('active'); |
||||
} |
||||
} |
||||
|
||||
}); |
||||
} |
||||
var menu_opened = false; |
||||
function toggleHeader(button, content, blockheight, removeBlock, removeClass) { |
||||
let thisButton = document.querySelector(button),
|
||||
thisContent = document.querySelector(content), |
||||
thisRemoveBlock = document.querySelector(removeBlock) || '', |
||||
thisBlockheight = document.querySelector(blockheight); |
||||
|
||||
thisButton.onclick = function () { |
||||
let height = thisBlockheight.clientHeight; |
||||
|
||||
if (!thisContent.classList.contains('open')) { |
||||
thisContent.style.height = `${height}px`; |
||||
thisContent.classList .add('open'); |
||||
|
||||
if (removeBlock) { |
||||
thisRemoveBlock.classList.remove(removeClass); |
||||
} |
||||
}else{ |
||||
thisContent.style.height = null; |
||||
thisContent.classList.remove('open'); |
||||
|
||||
if (removeBlock) { |
||||
if (window.Y <= 25) { |
||||
thisRemoveBlock.classList.add(removeClass); |
||||
} |
||||
} |
||||
} |
||||
menu_opened = !menu_opened; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
if (document.querySelector('.header').classList.contains('white')) { |
||||
window.addEventListener("scroll", function (e) { |
||||
let header = document.querySelector('.header'); |
||||
let scroll = window.scrollY; |
||||
if(!menu_opened){ |
||||
if (scroll >= 25) { |
||||
header.classList.remove('white') |
||||
}else{ |
||||
|
||||
header.classList.add('white') |
||||
|
||||
} |
||||
} |
||||
|
||||
}); |
||||
} |
||||
|
||||
toggleOpenX('.lang', '.lang__open', '.lang__list', '.lang__content', false); |
||||
toggleHeader('#pc-menu','.header__menu-block','.header__pc-menu', '.white', 'white'); |
||||
toggleHeader('#phone-menu','.header__menu-block','.header__phone-menu', '.white', 'white'); |
||||
// scroll
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
Before Width: | Height: | Size: 481 B After Width: | Height: | Size: 481 B |
After Width: | Height: | Size: 2.7 KiB |