add comments and likes

task_4097
GP_DV 3 months ago
parent 0ffa6707e0
commit 6e7ed0ee35
  1. 6
      wp-content/themes/cosmopet/archive-blog_author.php
  2. 211
      wp-content/themes/cosmopet/comments.php
  3. 189
      wp-content/themes/cosmopet/functions.php
  4. 732
      wp-content/themes/cosmopet/modules/author/assets/css/gp-style-desktop.css
  5. 120
      wp-content/themes/cosmopet/modules/author/assets/css/gp-style-mobile.css
  6. 44
      wp-content/themes/cosmopet/modules/author/assets/css/gp-style-tablet.css
  7. 3
      wp-content/themes/cosmopet/modules/author/assets/img/arrow-down.svg
  8. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-1.png
  9. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-2.png
  10. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-3.png
  11. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-4.png
  12. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-5.png
  13. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/author-main-card.png
  14. 11
      wp-content/themes/cosmopet/modules/author/assets/img/bars.svg
  15. 3
      wp-content/themes/cosmopet/modules/author/assets/img/basket-icon.svg
  16. BIN
      wp-content/themes/cosmopet/modules/author/assets/img/favicon.ico
  17. 3
      wp-content/themes/cosmopet/modules/author/assets/img/footer-network-1.svg
  18. 3
      wp-content/themes/cosmopet/modules/author/assets/img/footer-network-2.svg
  19. 6
      wp-content/themes/cosmopet/modules/author/assets/img/footer-network-3.svg
  20. 3
      wp-content/themes/cosmopet/modules/author/assets/img/header-red.svg
  21. 3
      wp-content/themes/cosmopet/modules/author/assets/img/heart-grey.svg
  22. 3
      wp-content/themes/cosmopet/modules/author/assets/img/heart-white.svg
  23. 3
      wp-content/themes/cosmopet/modules/author/assets/img/heart.svg
  24. 18
      wp-content/themes/cosmopet/modules/author/assets/img/indent-icon-1.svg
  25. 11
      wp-content/themes/cosmopet/modules/author/assets/img/logo-green.svg
  26. 3
      wp-content/themes/cosmopet/modules/author/assets/img/logo.svg
  27. 3
      wp-content/themes/cosmopet/modules/author/assets/img/long-arrow.svg
  28. 4
      wp-content/themes/cosmopet/modules/author/assets/img/minus-icon.svg
  29. 11
      wp-content/themes/cosmopet/modules/author/assets/img/msg-green.svg
  30. 3
      wp-content/themes/cosmopet/modules/author/assets/img/msg-grey.svg
  31. 3
      wp-content/themes/cosmopet/modules/author/assets/img/msg-white.svg
  32. 3
      wp-content/themes/cosmopet/modules/author/assets/img/msg.svg
  33. 18
      wp-content/themes/cosmopet/modules/author/assets/img/plus-icon.svg
  34. 5
      wp-content/themes/cosmopet/modules/author/assets/img/swp-next.svg
  35. 5
      wp-content/themes/cosmopet/modules/author/assets/img/swp-prev.svg
  36. 4
      wp-content/themes/cosmopet/modules/author/assets/img/user-icon.svg
  37. 46
      wp-content/themes/cosmopet/modules/author/assets/js/author-posts-ajax.js
  38. 48
      wp-content/themes/cosmopet/modules/author/assets/js/main.js
  39. 54
      wp-content/themes/cosmopet/modules/author/components/author-archive/component-controller.php
  40. 41
      wp-content/themes/cosmopet/modules/author/components/author-single/component-controller.php
  41. 35
      wp-content/themes/cosmopet/modules/author/module-ajax-controller.php
  42. 59
      wp-content/themes/cosmopet/modules/blog/assets/css/gp-style-desktop.css
  43. 198
      wp-content/themes/cosmopet/modules/blog/assets/js/comments.js
  44. 3
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/header-red.svg
  45. 11
      wp-content/themes/cosmopet/modules/blog/components/editorial/assets/img/msg-green.svg
  46. 4
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/css/gp-style-desktop.css
  47. 3
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/img/heart-grey.svg
  48. 3
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/img/msg-grey.svg
  49. 3
      wp-content/themes/cosmopet/modules/blog/components/most-read/assets/img/heart-white.svg
  50. 3
      wp-content/themes/cosmopet/modules/blog/components/most-read/assets/img/msg-white.svg
  51. 3
      wp-content/themes/cosmopet/modules/blog/components/news-list/assets/img/heart-grey.svg
  52. 3
      wp-content/themes/cosmopet/modules/blog/components/news-list/assets/img/msg-grey.svg
  53. 0
      wp-content/themes/cosmopet/modules/blog/components/single/assets/js/comments.js
  54. 147
      wp-content/themes/cosmopet/modules/blog/components/single/assets/js/post-likes.js
  55. 2
      wp-content/themes/cosmopet/modules/blog/components/single/component-controller.php
  56. 67
      wp-content/themes/cosmopet/modules/blog/module-controller.php
  57. 4004
      wp-content/themes/cosmopet/modules/forms/components/discount/assets/css/discount-form.css
  58. 0
      wp-content/themes/cosmopet/modules/forms/components/discount/component-controller.php
  59. 6
      wp-content/themes/cosmopet/single-blog_author.php
  60. 133
      wp-content/themes/cosmopet/templates/blog/blog-single.twig
  61. 19
      wp-content/themes/cosmopet/templates/blog/editorial.twig
  62. 15
      wp-content/themes/cosmopet/templates/blog/featured-slider.twig
  63. 17
      wp-content/themes/cosmopet/templates/blog/most-read.twig
  64. 66
      wp-content/themes/cosmopet/templates/blog/news-list.twig
  65. 60
      wp-content/themes/cosmopet/templates/blog_author/author-archive.twig
  66. 36
      wp-content/themes/cosmopet/templates/blog_author/author-posts-list.twig
  67. 92
      wp-content/themes/cosmopet/templates/blog_author/author-single.twig
  68. 32
      wp-content/themes/cosmopet/templates/comment/comment.twig
  69. 36
      wp-content/themes/cosmopet/templates/forms/discount.twig
  70. 37
      wp-content/themes/cosmopet/templates/front-page/front-page.twig

@ -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);
}
?>

@ -42,6 +42,14 @@ function theme_add_woocommerce_support()
add_action('after_setup_theme', 'theme_add_woocommerce_support'); add_action('after_setup_theme', 'theme_add_woocommerce_support');
add_theme_support('post-thumbnails'); add_theme_support('post-thumbnails');
add_action('after_setup_theme', function() {
add_theme_support('comments');
update_option('default_comment_status', 'open');
});
//Подруключение всех ajax controller если запрос сделан по ajax //Подруключение всех ajax controller если запрос сделан по ajax
@ -144,7 +152,7 @@ add_action('wp_enqueue_scripts', function() use ($module_name, $module_dir) {
$css_files = scandir($css_dir); $css_files = scandir($css_dir);
// Приоритетные файлы // Приоритетные файлы
$priority_files = [ $priority_files = [
'normalize.css', 'normalize.css',
'gp-style-core.css', 'gp-style-core.css',
'gp-style-desktop.css', 'gp-style-desktop.css',
@ -415,6 +423,8 @@ requireShortcodes(get_template_directory() . '/modules');
require_once('modules/blog/module-ajax-controller.php'); require_once('modules/blog/module-ajax-controller.php');
require_once('modules/forms/module-ajax-controller.php'); require_once('modules/forms/module-ajax-controller.php');
require_once('modules/author/module-ajax-controller.php');
include_module('forms'); include_module('forms');
include_module('layout'); include_module('layout');
@ -573,3 +583,180 @@ register_sidebar( array(
'before_title' => '<h3 class="widget-title">', 'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>', 'after_title' => '</h3>',
) ); ) );
function add_comment_like() {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$wpdb->show_errors();
if (!is_user_logged_in()) {
wp_send_json_error('Необходимо авторизоваться');
die();
}
$comment_id = isset($_POST['comment_id']) ? intval($_POST['comment_id']) : 0;
$user_id = get_current_user_id();
if ($comment_id) {
$comment_exists = get_comment($comment_id);
if (!$comment_exists) {
echo '0';
die();
}
$existing_like = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE comment_id = %d AND user_id = %d",
$comment_id, $user_id
));
if (!$existing_like) {
$result = $wpdb->insert(
$table_name,
array(
'user_id' => $user_id,
'comment_id' => $comment_id,
'date_added' => current_time('mysql')
),
array('%d', '%d', '%s')
);
} else {
$result = $wpdb->delete(
$table_name,
array(
'user_id' => $user_id,
'comment_id' => $comment_id
),
array('%d', '%d')
);
}
$likes = get_comment_likes_count($comment_id);
wp_send_json(array(
'count' => $likes,
'is_liked' => !$existing_like
));
} else {
wp_send_json(array('count' => 0, 'is_liked' => false));
}
die();
}
add_action('wp_ajax_add_comment_like', 'add_comment_like');
function add_post_like() {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
if (!is_user_logged_in()) {
wp_send_json_error('Необходимо авторизоваться');
die();
}
$post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
$user_id = get_current_user_id();
if ($post_id) {
$existing_like = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE post_id = %d AND user_id = %d",
$post_id, $user_id
));
if (!$existing_like) {
$wpdb->insert(
$table_name,
array(
'user_id' => $user_id,
'post_id' => $post_id,
'date_added' => current_time('mysql')
),
array('%d', '%d', '%s')
);
} else {
$wpdb->delete(
$table_name,
array(
'user_id' => $user_id,
'post_id' => $post_id
),
array('%d', '%d')
);
}
$likes = get_post_likes_count($post_id);
wp_send_json(array(
'count' => $likes,
'is_liked' => !$existing_like
));
}
die();
}
add_action('wp_ajax_add_post_like', 'add_post_like');
function check_user_likes() {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
if (!is_user_logged_in()) {
wp_send_json_error('Необходимо авторизоваться');
die();
}
$user_id = get_current_user_id();
$liked_posts = $wpdb->get_col($wpdb->prepare(
"SELECT post_id FROM $table_name WHERE user_id = %d AND post_id > 0",
$user_id
));
$liked_comments = $wpdb->get_col($wpdb->prepare(
"SELECT comment_id FROM $table_name WHERE user_id = %d AND comment_id > 0",
$user_id
));
$response = array(
'posts' => $liked_posts,
'comments' => $liked_comments
);
echo json_encode($response);
die();
}
add_action('wp_ajax_check_user_likes', 'check_user_likes');
function get_post_likes_count($post_id) {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$count = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE post_id = %d",
$post_id
));
return $count ? $count : 0;
}
function get_comment_likes_count($comment_id) {
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$count = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE comment_id = %d",
$comment_id
));
return $count ? $count : 0;
}
function is_user_liked_post($post_id) {
if (!is_user_logged_in()) {
return false;
}
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$user_id = get_current_user_id();
$result = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE post_id = %d AND user_id = %d",
$post_id, $user_id
));
return $result > 0;
}
function is_user_liked_comment($comment_id) {
if (!is_user_logged_in()) {
return false;
}
global $wpdb;
$table_name = $wpdb->prefix . 'cosmopet_likes';
$user_id = get_current_user_id();
$result = $wpdb->get_var($wpdb->prepare(
"SELECT COUNT(*) FROM $table_name WHERE comment_id = %d AND user_id = %d",
$comment_id, $user_id
));
return $result > 0;
}
add_filter('comment_form_logged_in', '__return_empty_string');

@ -0,0 +1,732 @@
/* 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 */
.home {
padding: 140px 0 68px;
}
.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;
}
}

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.5 5.5L7.5 10.5L12.5 5.5" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

@ -0,0 +1,11 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_12806_2018)">
<path d="M4 8H20" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4 16H20" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_12806_2018">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 458 B

@ -0,0 +1,3 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9995 11.5385C19.3616 11.5385 18.7499 11.7816 18.2988 12.2144C17.8478 12.6471 17.5944 13.2341 17.5944 13.8462V15.1282H22.4045V13.8462C22.4045 13.2341 22.1511 12.6471 21.7001 12.2144C21.2491 11.7816 20.6373 11.5385 19.9995 11.5385ZM24.0079 15.1282V13.8462C24.0079 12.8261 23.5856 11.8478 22.8339 11.1265C22.0821 10.4052 21.0626 10 19.9995 10C18.9364 10 17.9168 10.4052 17.1651 11.1265C16.4133 11.8478 15.991 12.8261 15.991 13.8462V15.1282H13.9399M15.991 16.6667H13.9398C13.7471 16.6666 13.5566 16.7066 13.3816 16.7838C13.2065 16.861 13.051 16.9736 12.9255 17.1138C12.8 17.2541 12.7077 17.4188 12.6548 17.5965C12.6019 17.7742 12.5896 17.9608 12.6189 18.1435C12.6189 18.1434 12.6189 18.1435 12.6189 18.1435L13.9604 26.5045C14.0477 27.0493 14.3354 27.5463 14.7714 27.9052C15.2074 28.2642 15.7629 28.4615 16.3373 28.4615C16.3373 28.4615 16.3374 28.4615 16.3373 28.4615H23.6616C24.2362 28.4617 24.7921 28.2644 25.2283 27.9055C25.6645 27.5465 25.9523 27.0496 26.0396 26.5046L27.3811 18.1436C27.3811 18.1436 27.3811 18.1435 27.3811 18.1436C27.4104 17.9609 27.3981 17.7742 27.3452 17.5965C27.2923 17.4188 27.1999 17.2541 27.0745 17.1138C26.949 16.9736 26.7935 16.861 26.6184 16.7838C26.4433 16.7066 26.253 16.6666 26.0603 16.6667H24.0079V18.9744C24.0079 19.3992 23.649 19.7436 23.2062 19.7436C22.7635 19.7436 22.4045 19.3992 22.4045 18.9744V16.6667H17.5944V18.9744C17.5944 19.3992 17.2355 19.7436 16.7927 19.7436C16.3499 19.7436 15.991 19.3992 15.991 18.9744V16.6667ZM24.0079 15.1282H26.0601C26.0601 15.1282 26.0602 15.1282 26.0601 15.1282C26.4839 15.1282 26.9028 15.2161 27.2879 15.3859C27.673 15.5557 28.0153 15.8034 28.2913 16.112C28.5673 16.4206 28.7705 16.7829 28.8869 17.1739C29.0033 17.5649 29.0303 17.9755 28.9658 18.3774L27.6244 26.7385C27.6243 26.7385 27.6244 26.7384 27.6244 26.7385C27.4788 27.6467 26.9991 28.475 26.2722 29.0732C25.5453 29.6715 24.6192 30.0002 23.6616 30C23.6615 30 23.6616 30 23.6616 30H16.3373C15.3799 30 14.454 29.6711 13.7273 29.0728C13.0007 28.4746 12.5212 27.6466 12.3757 26.7386C12.3756 26.7385 12.3757 26.7386 12.3757 26.7386L11.0342 18.3776C10.9697 17.9756 10.9966 17.5649 11.1131 17.1739C11.2295 16.7829 11.4327 16.4206 11.7087 16.112C11.9847 15.8034 12.327 15.5557 12.7121 15.3859C13.0972 15.2161 13.5161 15.1282 13.9399 15.1282" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

@ -0,0 +1,3 @@
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25023 2.99272C0 5.24325 0 8.86108 0 16.101V17.3791C0 24.619 0 28.2411 2.25023 30.4917C4.50046 32.7422 8.11782 32.7422 15.361 32.7422H16.639C23.8779 32.7422 27.4995 32.7422 29.7498 30.4917C32 28.2411 32 24.6233 32 17.3791V16.101C32 8.86108 32 5.239 29.7498 2.98847C27.4995 0.742188 23.8779 0.742188 16.639 0.742188H15.361C8.11782 0.742188 4.50046 0.742188 2.25023 2.99272ZM5.40056 10.4789C5.57463 18.7974 9.73544 23.7995 17.0253 23.7995H17.4372V19.0394C20.1162 19.3069 22.1414 21.2645 22.9566 23.7995H26.7438C25.7036 20.0118 22.9694 17.9184 21.2626 17.1201C22.9694 16.135 25.3682 13.7316 25.9414 10.4789H22.5023C21.7551 13.1201 19.5431 15.5193 17.4372 15.7443V10.4789H13.9981V19.7061C11.8668 19.1711 9.17076 16.5851 9.05188 10.4789H5.40056Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 911 B

@ -0,0 +1,3 @@
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16 0.742188C7.16387 0.742188 0 7.90606 0 16.7422C0 25.5783 7.16387 32.7422 16 32.7422C24.8361 32.7422 32 25.5783 32 16.7422C32 7.90606 24.8361 0.742188 16 0.742188ZM23.8555 11.7048L21.2335 24.0815C21.0374 24.959 20.5213 25.1757 19.7884 24.7628L15.7832 21.8106L13.8529 23.6686C13.6361 23.8854 13.4606 24.0609 13.0477 24.0609L13.3265 19.9938L20.7381 13.2944C21.0581 13.0157 20.6658 12.8506 20.2426 13.1293L11.0761 18.8996L7.1329 17.6712C6.27613 17.4028 6.25548 16.8144 7.31871 16.4015L22.751 10.4454C23.4632 10.1873 24.0929 10.6209 23.8555 11.7048Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 676 B

@ -0,0 +1,6 @@
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.568 0.742188C15.3825 3.24847 15.3939 5.78891 14.9687 8.25368C14.1605 12.9294 11.5304 15.3105 6.79636 15.8649C4.54453 16.1288 2.2659 16.1683 0 16.3095C0 15.8187 0.160702 14.5311 0.188825 14.3684C1.18518 8.62865 4.32691 4.50931 9.62271 2.11485C11.0322 1.47874 15.0772 0.742188 15.568 0.742188Z" fill="white"/>
<path d="M0 17.1484C1.98668 17.287 3.98207 17.3527 5.9567 17.5897C7.26575 17.7464 8.59221 18.0209 9.82962 18.4669C12.4651 19.417 14.1652 21.387 14.6935 24.0901C15.2399 26.887 15.4375 29.7528 15.8051 32.7325C13.2814 32.8082 11.2063 32.2571 9.25913 31.3016C4.19768 28.8188 1.14634 24.7905 0.190834 19.2074C0.156685 19.0072 0 17.6399 0 17.1484Z" fill="white"/>
<path d="M19.7047 1.16135C26.3892 2.64115 31.7125 8.86167 32.0111 15.5469C32.0205 15.7538 32.0124 15.9614 32.0124 16.3069C28.4489 16.181 24.8913 16.3457 21.5842 14.8097C18.8215 13.526 17.5138 11.1249 17.0839 8.25502C16.7739 6.18397 16.7257 4.07408 16.5542 1.9816C16.5201 1.56713 16.4585 1.15533 16.4089 0.742189C16.8997 0.741519 19.096 1.0261 19.7047 1.16135Z" fill="white"/>
<path d="M16.3945 32.6792C16.6202 30.1595 16.7032 27.7075 17.0862 25.303C17.7719 20.9968 20.1751 18.5528 24.4544 17.843C26.8897 17.4393 29.3799 17.3643 31.844 17.1406C32.5009 24.1633 25.5157 32.8807 16.3945 32.6792Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,3 @@
<svg width="24" height="21" viewBox="0 0 24 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.7934 0.742188C14.0742 0.742188 12.4292 3.534 12.0716 4.92991C11.8093 3.534 10.2263 0.742188 5.99218 0.742188C0.699506 0.742188 -1.66074 7.7458 2.98823 13.7386C6.7074 18.5328 10.5935 20.4052 12.0716 20.7422C13.7166 20.4293 17.8935 18.4895 21.4411 13.2332C25.8755 6.66277 22.4424 0.742188 17.7934 0.742188Z" fill="#FE8D8D"/>
</svg>

After

Width:  |  Height:  |  Size: 439 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 389 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="#666666"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,18 @@
<svg width="54" height="49" viewBox="0 0 54 49" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.0815 7.92932C49.4355 6.5889 51.629 6.5889 52.983 7.92932C54.339 9.27186 54.339 11.4501 52.983 12.7927L29.1999 36.3385C27.8459 37.6789 25.6524 37.6789 24.2984 36.3385L10.8231 22.9976C9.46708 21.6551 9.46708 19.4768 10.8231 18.1343C12.1771 16.7939 14.3706 16.7939 15.7246 18.1343L26.7492 29.0489L48.0815 7.92932ZM51.8777 9.03434C51.1351 8.29909 49.9294 8.29909 49.1867 9.03434L26.7492 31.2481L14.6194 19.2393C13.8767 18.504 12.671 18.504 11.9284 19.2393C11.1878 19.9724 11.1878 21.1595 11.9284 21.8926L25.4037 35.2335C26.1463 35.9687 27.352 35.9687 28.0946 35.2335L51.8777 11.6877C52.6182 10.9545 52.6182 9.76747 51.8777 9.03434Z" fill="url(#paint0_radial_11666_41321)"/>
<path d="M1.56688 24.6641C1.56688 12.2738 11.7134 2.22296 24.238 2.22296C32.565 2.22296 39.8409 6.66576 43.7825 13.2851L44.9262 12.1528C40.6662 5.26123 32.9929 0.664062 24.238 0.664062C10.8554 0.664062 0 11.4056 0 24.6641C0 37.9225 10.8554 48.6641 24.238 48.6641C37.6206 48.6641 48.476 37.9225 48.476 24.6641C48.476 22.0965 48.0689 19.6234 47.3152 17.3043L46.0573 18.5496C46.6122 20.4936 46.9091 22.5446 46.9091 24.6641C46.9091 37.0543 36.7625 47.1052 24.238 47.1052C11.7134 47.1052 1.56688 37.0543 1.56688 24.6641Z" fill="url(#paint1_radial_11666_41321)"/>
<defs>
<radialGradient id="paint0_radial_11666_41321" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(54 0.664065) rotate(138.366) scale(72.2496 97.959)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
<radialGradient id="paint1_radial_11666_41321" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(54 0.664065) rotate(138.366) scale(72.2496 97.959)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,11 @@
<svg width="55" height="44" viewBox="0 0 55 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M54.4456 6.968C52.8502 4.26022 48.1445 3.74111 41.1703 5.49485C37.7503 2.7802 33.5793 1.14675 29.203 0.808095C24.8266 0.469444 20.4485 1.44136 16.6411 3.59675C12.8338 5.75214 9.77451 8.99066 7.8633 12.8888C5.9521 16.787 5.27795 21.1633 5.92903 25.4455C0.860701 30.5173 -1.05 34.7988 0.552524 37.5159C1.53158 39.1785 3.63429 40.0203 6.71606 40.0203C8.68733 39.9852 10.649 39.7398 12.5667 39.2884C12.9792 39.1972 13.4011 39.0966 13.8278 38.9891C17.0317 41.5323 20.8992 43.1302 24.9842 43.5984C29.0692 44.0666 33.2052 43.386 36.9149 41.6351C40.6245 39.8842 43.7568 37.1345 45.9501 33.703C48.1434 30.2716 49.3085 26.2985 49.3109 22.242C49.3125 21.1675 49.2333 20.0943 49.0738 19.0314C52.1011 15.9916 54.1255 13.1201 54.7632 10.7374C55.1639 9.27359 55.0548 8.00622 54.4456 6.968ZM27.5014 2.6C32.1048 2.60551 36.5646 4.18168 40.1241 7.0611C43.6836 9.94053 46.1237 13.9459 47.0304 18.3977C43.1971 22.0666 37.8325 25.9926 31.7424 29.444C25.2683 33.1128 19.2233 35.5821 14.2925 36.9266C11.2741 34.2819 9.14206 30.7945 8.17904 26.9271C7.21602 23.0597 7.46753 18.995 8.90022 15.2718C10.3329 11.5486 12.8791 8.34292 16.2011 6.07984C19.5232 3.81675 23.4641 2.60317 27.5014 2.6ZM2.19534 36.5759C1.18784 34.8689 2.78799 31.5251 6.40315 27.6762C7.38336 31.3793 9.34736 34.7574 12.0926 37.4621C6.84408 38.6102 3.19573 38.2782 2.19534 36.5759ZM27.5014 41.8839C23.4308 41.8879 19.4578 40.655 16.1226 38.353C21.2383 36.8144 26.987 34.2914 32.6812 31.0668C38.4299 27.8072 43.4934 24.1781 47.3385 20.6753C47.3812 21.192 47.4097 21.7135 47.4097 22.242C47.4034 27.4486 45.3041 32.4403 41.572 36.1224C37.84 39.8045 32.7799 41.8765 27.5014 41.8839ZM52.9331 10.2533C52.4282 12.124 50.8992 14.3805 48.6068 16.8147C47.6205 13.1031 45.6464 9.71887 42.8889 7.01243C48.0687 5.88535 51.8 6.20336 52.8051 7.90801C53.1512 8.4996 53.1963 9.28762 52.9331 10.2533Z" fill="url(#paint0_radial_12821_4886)"/>
<defs>
<radialGradient id="paint0_radial_12821_4886" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(55 0.74219) rotate(141.981) scale(69.814 92.4982)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,3 @@
<svg width="51" height="40" viewBox="0 0 51 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M50.4859 5.79145C49.0065 3.27258 44.6431 2.78969 38.1761 4.42108C35.0048 1.89583 31.1372 0.376333 27.0791 0.0613091C23.021 -0.253715 18.9613 0.650395 15.4309 2.65541C11.9004 4.66042 9.06364 7.673 7.29143 11.2992C5.51922 14.9254 4.8941 18.9964 5.49783 22.9798C0.798105 27.6978 -0.973633 31.6805 0.51234 34.2081C1.42019 35.7547 3.36998 36.5377 6.22762 36.5377C8.05553 36.5052 9.87449 36.2769 11.6527 35.8569C12.0352 35.7721 12.4265 35.6785 12.8222 35.5785C15.793 37.9443 19.3793 39.4307 23.1672 39.8663C26.9551 40.3018 30.7903 39.6687 34.2301 38.0399C37.67 36.4112 40.5744 33.8533 42.6083 30.6613C44.6421 27.4693 45.7224 23.7733 45.7246 19.9998C45.7261 19.0003 45.6527 18.002 45.5048 17.0132C48.3119 14.1855 50.1891 11.5144 50.7805 9.29786C51.1519 7.93619 51.0508 6.75724 50.4859 5.79145ZM25.5013 1.7282C29.77 1.73333 33.9054 3.19952 37.206 5.87806C40.5066 8.5566 42.7692 12.2825 43.61 16.4238C40.0555 19.8366 35.081 23.4888 29.4339 26.6994C23.4306 30.1122 17.8253 32.4092 13.253 33.66C10.4542 31.1997 8.47718 27.9557 7.5842 24.3581C6.69122 20.7605 6.92444 16.9793 8.25293 13.5159C9.58142 10.0525 11.9424 7.07045 15.0229 4.96526C18.1033 2.86006 21.7576 1.73114 25.5013 1.7282ZM2.03568 33.3337C1.10145 31.7458 2.58523 28.6353 5.93746 25.0549C6.84638 28.4997 8.66755 31.6421 11.2131 34.1581C6.34633 35.2261 2.96332 34.9172 2.03568 33.3337ZM25.5013 38.2714C21.7268 38.275 18.0427 37.1282 14.95 34.9868C19.6937 33.5556 25.0243 31.2085 30.3044 28.2089C35.635 25.1767 40.3303 21.8008 43.8957 18.5424C43.9353 19.0231 43.9617 19.5082 43.9617 19.9998C43.9559 24.8432 42.0092 29.4866 38.5486 32.9118C35.088 36.3371 30.3959 38.2645 25.5013 38.2714ZM49.0835 8.84759C48.6152 10.5877 47.1974 12.6868 45.0718 14.9512C44.1572 11.4985 42.3267 8.3504 39.7697 5.83278C44.5728 4.78434 48.0327 5.08016 48.9648 6.66588C49.2857 7.2162 49.3274 7.94924 49.0835 8.84759Z" fill="#121212"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,3 @@
<svg width="207" height="22" viewBox="0 0 207 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M197.037 1L206 11M206 11L197.037 21M206 11L1 11" stroke="#121212" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -0,0 +1,4 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 33C26.2843 33 33 26.2843 33 18C33 16.0529 32.6305 14.1994 31.9606 12.5005C31.7927 12.0745 31.6057 11.6579 31.4007 11.2518C31.1211 10.6979 30.808 10.1633 30.4639 9.65087C27.7663 5.63342 23.1901 3 18 3C9.71573 3 3 9.71573 3 18C3 26.2843 9.71573 33 18 33ZM18 36C27.9411 36 36 27.9411 36 18C36 15.6701 35.5573 13.4436 34.7515 11.4C34.5497 10.8881 34.325 10.3877 34.0789 9.9C33.7431 9.23477 33.3672 8.59322 32.9545 7.97852C29.7235 3.16663 24.2316 0 18 0C8.05888 0 0 8.05888 0 18C0 27.9411 8.05888 36 18 36Z" fill="#DD2127"/>
<path d="M28.4694 18.0918C28.4694 19.4613 27.3534 20.5714 25.9767 20.5714H10.0233C8.64664 20.5714 7.53061 19.4613 7.53061 18.0918C7.53061 16.7224 8.64664 15.6122 10.0233 15.6122H25.9767C27.3534 15.6122 28.4694 16.7224 28.4694 18.0918Z" fill="#DD2127"/>
</svg>

After

Width:  |  Height:  |  Size: 929 B

@ -0,0 +1,11 @@
<svg width="23" height="21" viewBox="0 0 23 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.76298 4.44735C3.06952 5.67081 2.13126 7.27684 2.13126 8.95074C2.13126 10.9189 3.43754 12.8055 5.72596 14.0611C6.06925 14.2494 6.23788 14.6639 6.12924 15.0523C5.80108 16.2254 4.97453 17.5082 4.37705 18.4355C4.35717 18.4664 4.33755 18.4969 4.3182 18.5269C4.30813 18.5425 4.29815 18.5581 4.28825 18.5734C4.53639 18.4536 4.80635 18.3131 5.09199 18.1538C6.28443 17.4885 7.6774 16.5358 8.80068 15.5042C8.98115 15.3384 9.22254 15.2642 9.46036 15.3013C10.1165 15.4037 10.7989 15.4578 11.5 15.4578C14.1673 15.4578 16.5467 14.6753 18.237 13.4541C19.9305 12.2307 20.8687 10.6246 20.8687 8.95074C20.8687 7.27684 19.9305 5.67081 18.237 4.44735C16.5467 3.22618 14.1673 2.44368 11.5 2.44368C8.83266 2.44368 6.45327 3.22618 4.76298 4.44735ZM3.0195 19.0408C3.01951 19.0408 3.02033 19.0407 3.02191 19.0407C3.02027 19.0408 3.01948 19.0408 3.0195 19.0408ZM3.83415 3.04862C5.82987 1.60678 8.54267 0.742188 11.5 0.742188C14.4573 0.742188 17.1701 1.60678 19.1659 3.04862C21.1584 4.48816 22.5 6.56104 22.5 8.95074C22.5 11.3404 21.1584 13.4133 19.1659 14.8529C17.1701 16.2947 14.4573 17.1593 11.5 17.1593C10.8501 17.1593 10.2129 17.1176 9.59312 17.0374C8.41664 18.0694 7.04427 18.9942 5.86135 19.6541C5.22123 20.0112 4.61837 20.301 4.11684 20.4893C3.86744 20.583 3.62444 20.6586 3.40353 20.7017C3.21456 20.7385 2.91813 20.7785 2.63153 20.6825C2.42855 20.6146 2.21877 20.4705 2.08381 20.2244C1.95926 19.9972 1.94674 19.7703 1.95698 19.6181C1.97576 19.3391 2.08812 19.078 2.17184 18.9038C2.35249 18.5281 2.6576 18.0542 2.9561 17.5905L2.96393 17.5784C3.47206 16.7891 4.00731 15.953 4.33796 15.1946C2.0636 13.7424 0.5 11.537 0.5 8.95074C0.5 6.56104 1.84159 4.48816 3.83415 3.04862Z" fill="url(#paint0_radial_11432_38673)"/>
<defs>
<radialGradient id="paint0_radial_11432_38673" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(22.5 0.742189) rotate(137.726) scale(29.7321 40.4084)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 244 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="#666666"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -0,0 +1,18 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 33C26.2843 33 33 26.2843 33 18C33 16.0529 32.6305 14.1994 31.9606 12.5005C31.7927 12.0745 31.6057 11.6579 31.4007 11.2518C31.1211 10.6979 30.808 10.1633 30.4639 9.65087C27.7663 5.63342 23.1901 3 18 3C9.71573 3 3 9.71573 3 18C3 26.2843 9.71573 33 18 33ZM18 36C27.9411 36 36 27.9411 36 18C36 15.6701 35.5573 13.4436 34.7515 11.4C34.5497 10.8881 34.325 10.3877 34.0789 9.9C33.7431 9.23477 33.3672 8.59322 32.9545 7.97852C29.7235 3.16663 24.2316 0 18 0C8.05888 0 0 8.05888 0 18C0 27.9411 8.05888 36 18 36Z" fill="url(#paint0_radial_11667_42373)"/>
<path d="M27.7631 15.6376C29.0661 15.6376 30.1224 16.6858 30.1224 17.9789C30.1224 19.272 29.0661 20.3203 27.7631 20.3203H20.4725V27.5763C20.4725 28.8811 19.4066 29.9388 18.0918 29.9388C16.7771 29.9388 15.7112 28.8811 15.7112 27.5763V20.3203H8.42059C7.11755 20.3203 6.06122 19.272 6.06122 17.9789C6.06122 16.6858 7.11755 15.6376 8.42058 15.6376H15.7112V8.42367C15.7112 7.11893 16.7771 6.06122 18.0918 6.06122C19.4066 6.06122 20.4725 7.11893 20.4725 8.42367V15.6376H27.7631Z" fill="url(#paint1_radial_11667_42373)"/>
<defs>
<radialGradient id="paint0_radial_11667_42373" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(36 1.87286e-06) rotate(135) scale(50.9117 69.5076)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
<radialGradient id="paint1_radial_11667_42373" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(36 1.87286e-06) rotate(135) scale(50.9117 69.5076)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21 12.3633H4.5" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M21 12.3633L14.636 18.7272" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M21 12.3633L14.636 5.99932" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 458 B

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.5 12.3633H21" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.5 12.3633L10.864 18.7272" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.5 12.3633L10.864 5.99932" stroke="#121212" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 460 B

@ -0,0 +1,4 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.6412 11.6412C17.532 10.7504 18.7402 10.25 20 10.25C21.2598 10.25 22.468 10.7504 23.3588 11.6412C24.2496 12.532 24.75 13.7402 24.75 15C24.75 16.2598 24.2496 17.468 23.3588 18.3588C22.468 19.2496 21.2598 19.75 20 19.75C18.7402 19.75 17.532 19.2496 16.6412 18.3588C15.7504 17.468 15.25 16.2598 15.25 15C15.25 13.7402 15.7504 12.532 16.6412 11.6412ZM20 11.75C19.138 11.75 18.3114 12.0924 17.7019 12.7019C17.0924 13.3114 16.75 14.138 16.75 15C16.75 15.862 17.0924 16.6886 17.7019 17.2981C18.3114 17.9076 19.138 18.25 20 18.25C20.862 18.25 21.6886 17.9076 22.2981 17.2981C22.9076 16.6886 23.25 15.862 23.25 15C23.25 14.138 22.9076 13.3114 22.2981 12.7019C21.6886 12.0924 20.862 11.75 20 11.75Z" fill="#333333"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 23.75C17.138 23.75 16.3114 24.0924 15.7019 24.7019C15.0924 25.3114 14.75 26.138 14.75 27V29C14.75 29.4142 14.4142 29.75 14 29.75C13.5858 29.75 13.25 29.4142 13.25 29V27C13.25 25.7402 13.7504 24.532 14.6412 23.6412C15.532 22.7504 16.7402 22.25 18 22.25H22C23.2598 22.25 24.468 22.7504 25.3588 23.6412C26.2496 24.532 26.75 25.7402 26.75 27V29C26.75 29.4142 26.4142 29.75 26 29.75C25.5858 29.75 25.25 29.4142 25.25 29V27C25.25 26.138 24.9076 25.3114 24.2981 24.7019C23.6886 24.0924 22.862 23.75 22 23.75H18Z" fill="#333333"/>
</svg>

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');

@ -4,4 +4,63 @@ main{
.block-lists_text p { .block-lists_text p {
font-size: 18px!important; font-size: 18px!important;
}
.user a{
display: flex;
align-items: center;
gap: 5px;
}
.user a{
display:flex;
gap:5px;
}
.user img{
width:30px;
border-radius:100px;
}
.anons-best__card-body__datas .logo a{
display: flex;
align-items: center;
gap:5px;
margin-top: 10px;
}
.comment-submit-btn{
border: 1px solid #000000;
border-radius: 28px;
background: var(--main_white);
padding: 8.5px 16px 8.5px;
font-size: 20px;
font-weight: 500;
line-height: 24px;
margin-top: 15px;
transition: all .5s;
}
.comment-reply-title , .logged-in-as{
margin: 10px 0;
}
.comment-block.answer-block.active{
margin-top: 15px;
}
.comment-form-comment textarea{
padding: 28px 48px;
border-radius: 24px;
background: #f5f5f5 !important;
}
.comment-respond{
margin-top: 30px;
}
.reply-form-container textarea{
background-color: #fff !important;
} }

@ -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,3 @@
<svg width="24" height="21" viewBox="0 0 24 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.7934 0.742188C14.0742 0.742188 12.4292 3.534 12.0716 4.92991C11.8093 3.534 10.2263 0.742188 5.99218 0.742188C0.699506 0.742188 -1.66074 7.7458 2.98823 13.7386C6.7074 18.5328 10.5935 20.4052 12.0716 20.7422C13.7166 20.4293 17.8935 18.4895 21.4411 13.2332C25.8755 6.66277 22.4424 0.742188 17.7934 0.742188Z" fill="#FE8D8D"/>
</svg>

After

Width:  |  Height:  |  Size: 439 B

@ -0,0 +1,11 @@
<svg width="23" height="21" viewBox="0 0 23 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.76298 4.44735C3.06952 5.67081 2.13126 7.27684 2.13126 8.95074C2.13126 10.9189 3.43754 12.8055 5.72596 14.0611C6.06925 14.2494 6.23788 14.6639 6.12924 15.0523C5.80108 16.2254 4.97453 17.5082 4.37705 18.4355C4.35717 18.4664 4.33755 18.4969 4.3182 18.5269C4.30813 18.5425 4.29815 18.5581 4.28825 18.5734C4.53639 18.4536 4.80635 18.3131 5.09199 18.1538C6.28443 17.4885 7.6774 16.5358 8.80068 15.5042C8.98115 15.3384 9.22254 15.2642 9.46036 15.3013C10.1165 15.4037 10.7989 15.4578 11.5 15.4578C14.1673 15.4578 16.5467 14.6753 18.237 13.4541C19.9305 12.2307 20.8687 10.6246 20.8687 8.95074C20.8687 7.27684 19.9305 5.67081 18.237 4.44735C16.5467 3.22618 14.1673 2.44368 11.5 2.44368C8.83266 2.44368 6.45327 3.22618 4.76298 4.44735ZM3.0195 19.0408C3.01951 19.0408 3.02033 19.0407 3.02191 19.0407C3.02027 19.0408 3.01948 19.0408 3.0195 19.0408ZM3.83415 3.04862C5.82987 1.60678 8.54267 0.742188 11.5 0.742188C14.4573 0.742188 17.1701 1.60678 19.1659 3.04862C21.1584 4.48816 22.5 6.56104 22.5 8.95074C22.5 11.3404 21.1584 13.4133 19.1659 14.8529C17.1701 16.2947 14.4573 17.1593 11.5 17.1593C10.8501 17.1593 10.2129 17.1176 9.59312 17.0374C8.41664 18.0694 7.04427 18.9942 5.86135 19.6541C5.22123 20.0112 4.61837 20.301 4.11684 20.4893C3.86744 20.583 3.62444 20.6586 3.40353 20.7017C3.21456 20.7385 2.91813 20.7785 2.63153 20.6825C2.42855 20.6146 2.21877 20.4705 2.08381 20.2244C1.95926 19.9972 1.94674 19.7703 1.95698 19.6181C1.97576 19.3391 2.08812 19.078 2.17184 18.9038C2.35249 18.5281 2.6576 18.0542 2.9561 17.5905L2.96393 17.5784C3.47206 16.7891 4.00731 15.953 4.33796 15.1946C2.0636 13.7424 0.5 11.537 0.5 8.95074C0.5 6.56104 1.84159 4.48816 3.83415 3.04862Z" fill="url(#paint0_radial_11432_38673)"/>
<defs>
<radialGradient id="paint0_radial_11432_38673" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(22.5 0.742189) rotate(137.726) scale(29.7321 40.4084)">
<stop stop-color="#188892"/>
<stop offset="0.45" stop-color="#1EA49C"/>
<stop offset="0.9" stop-color="#76CE75"/>
<stop offset="1" stop-color="#BBE38D"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -173,4 +173,8 @@
.home-card__content-body__link:hover{ .home-card__content-body__link:hover{
background-color: #000; background-color: #000;
color: #fff; color: #fff;
}
.blog-home{
padding-bottom: 4rem;
} }

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 389 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 244 B

@ -0,0 +1,3 @@
<svg width="19" height="16" viewBox="0 0 19 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2859 0C11.2135 0 9.85457 2.23345 9.55915 3.35018C9.34251 2.23345 8.03478 0 4.53702 0C0.164809 0 -1.78496 5.60289 2.05549 10.3971C5.12786 14.2325 8.33808 15.7304 9.55915 16C10.9181 15.7497 14.3686 14.1978 17.2991 9.99278C20.9623 4.73646 18.1263 0 14.2859 0Z" fill="#999999"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

@ -0,0 +1,3 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H14C15.6569 0 17 1.34315 17 3V16L13.8125 12.3871H3C1.34315 12.3871 0 11.044 0 9.3871V3Z" fill="#999999"/>
</svg>

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();
}
});

@ -2,4 +2,6 @@
include_component('blog', 'featured-slider'); include_component('blog', 'featured-slider');
$context = Timber::get_context(); $context = Timber::get_context();
$post = Timber::get_post();
$context['post'] = $post;
Timber::render('blog/blog-single.twig', $context); Timber::render('blog/blog-single.twig', $context);

@ -2,17 +2,7 @@
class BlogPost extends \Timber\Post class BlogPost extends \Timber\Post
{ {
/**
* Estimates time required to read a post.
*
* The words per minute are based on the English language, which e.g. is much
* faster than German or French.
*
* @link https://www.irisreading.com/average-reading-speed-in-various-languages/
*
* @return string
*/
public function reading_time() public function reading_time()
{ {
$symb_per_minute = 2280; $symb_per_minute = 2280;
@ -20,7 +10,6 @@ class BlogPost extends \Timber\Post
$symb = strlen(wp_strip_all_tags($this->content())); $symb = strlen(wp_strip_all_tags($this->content()));
$minutes = round($symb / $symb_per_minute); $minutes = round($symb / $symb_per_minute);
/* translators: %s: Time duration in minute or minutes. */
return sprintf(_n('%s ' . pll__('мин.'), '%s ' . pll__('мин.'), $minutes), (int) $minutes); return sprintf(_n('%s ' . pll__('мин.'), '%s ' . pll__('мин.'), $minutes), (int) $minutes);
} }
public function get_author_name() public function get_author_name()
@ -35,6 +24,19 @@ class BlogPost extends \Timber\Post
$id = get_field('post_author', $this->ID); $id = get_field('post_author', $this->ID);
return get_the_post_thumbnail_url( $id, 'thumbnail' ); return get_the_post_thumbnail_url( $id, 'thumbnail' );
} }
public function get_author_link()
{
$id = get_field('post_author', $this->ID);
if ($id) {
return get_permalink($id);
}
return false;
}
public function get_comments_number()
{
return get_comments_number($this->ID);
}
} }
add_filter('timber/post/classmap', function ($classmap) { add_filter('timber/post/classmap', function ($classmap) {
@ -43,4 +45,43 @@ add_filter('timber/post/classmap', function ($classmap) {
]; ];
return array_merge($classmap, $custom_classmap); return array_merge($classmap, $custom_classmap);
}); });
function enable_comments_for_posts() {
update_option('default_comment_status', 'open');
$posts = get_posts([
'post_type' => 'post',
'numberposts' => -1,
'post_status' => 'publish'
]);
foreach ($posts as $post) {
if (!comments_open($post->ID)) {
update_post_meta($post->ID, 'comment_status', 'open');
}
}
}
add_action('after_setup_theme', 'enable_comments_for_posts');
function enqueue_comment_scripts() {
if (is_singular() && comments_open()) {
wp_enqueue_script('comment-reply');
wp_enqueue_script(
'blog-comments-js',
get_template_directory_uri() . '/modules/blog/assets/js/comments.js',
array('jquery', 'comment-reply'),
filemtime(get_template_directory() . '/modules/blog/assets/js/comments.js'),
true
);
wp_localize_script('blog-comments-js', 'ajax_object', array(
'ajax_url' => admin_url('admin-ajax.php')
));
}
}
add_action('wp_enqueue_scripts', 'enqueue_comment_scripts');

File diff suppressed because one or more lines are too long

@ -0,0 +1,6 @@
<?php
include_module('author');
include_component('author', 'author-single');
?>

@ -1,62 +1,89 @@
{% extends 'layout.twig' %} {% extends 'layout.twig' %}
{% block content %} {% block content %}
<!-- Breadcrumb -->
<section class="breadcrumb">
<div class="container">
<a href="{{ site.url }}">{{ function('pll_e', 'Главная') }}</a> /
<a href="{{ site.url }}">{{ function('pll_e', 'Блог') }}</a> /
<a href="{{ post.link }}">{{ post.name }}</a>
</div>
</section>
<!-- Breadcrumb end -->
<!-- Article home --> <!-- Breadcrumb -->
<section class="article-home"> <section class="breadcrumb">
<div class="container"> <div class="container">
<h1>{{post.name}}</h1> <a href="{{ site.url }}">{{ function('pll_e', 'Главная') }}</a> /
<div class="article-home__data"> <a href="{{ site.url }}">{{ function('pll_e', 'Блог') }}</a> /
<ul class="article-home__data-alerts"> <a href="{{ post.link }}">{{ post.name }}</a>
{% for category in post.categories %} </div>
<li> </section>
<a href="{{ category.link }}">{{ category.name }}</a> <!-- Breadcrumb end -->
</li>
{% endfor %}
</ul>
<p>{{post.date}}</p>
<p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p>
{% if post.get_author_name %}
<div class="user">
<img src="{{post.get_author_img}}">
<span>{{post.get_author_name}}</span>
<!-- Article home -->
<section class="article-home">
<div class="container">
<h1>{{post.name}}</h1>
<div class="article-home__data">
<ul class="article-home__data-alerts">
{% for category in post.categories %}
<li>
<a href="{{ category.link }}">{{ category.name }}</a>
</li>
{% endfor %}
</ul>
<p>{{post.date}}</p>
<p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p>
{% if post.get_author_name %}
<div class="user">
<a href="{{ post.get_author_link }}">
<img src="{{post.get_author_img}}">
<span>{{post.get_author_name}}</span>
</a>
</div>
{% endif %}
</div>
<div class="article-home__card">
<img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}">
</div> </div>
{% endif %}
</div> </div>
<div class="article-home__card"> </section>
<img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}">
<!-- Article home end -->
<!-- Article content -->
<div class="article-content">
<div class="article-container">
{{post.content}}
</div> </div>
<!-- Комментарии -->
<section class="comment">
<div class="container">
<div class="comment-btn">
<button {% if function('is_user_liked_post', post.ID) %}class="active"{% endif %} data-post-id="{{ post.ID }}">
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.7859 4.66406C14.7135 4.66406 13.3546 6.89752 13.0591 8.01424C12.8425 6.89752 11.5348 4.66406 8.03702 4.66406C3.66481 4.66406 1.71504 10.267 5.55549 15.0612C8.62786 18.8966 11.8381 20.3945 13.0591 20.6641C14.4181 20.4138 17.8686 18.8619 20.7991 14.6568C24.4623 9.40052 21.6263 4.66406 17.7859 4.66406Z" {% if function('is_user_liked_post', post.ID) %}fill="rgba(255, 0, 0, 0.7)" stroke="#ff0000"{% else %}fill="#121212"{% endif %}></path>
</svg>
Нравится
</button>
<span>
{{ function('get_post_likes_count', post.ID) }}
</span>
</div>
<div class="comment-in">
<h3 class="comment-title">
{{ function('pll_e', 'КОММЕНТАРИИ') }} ({{ function('get_comments_number', post.ID) }})
</h3>
{{ function('comments_template') }}
</div>
</div>
</section>
<!-- Комментарии end -->
</div> </div>
</section> <!-- Article content end -->
<!-- Article home end -->
<!-- Article content --> <section class="home other-home">
<div class="article-content"> <div class="container">
<div class="article-container"> {% include '/blog/featured-slider.twig' %}
{{post.content}} </div>
</div> </section>
</div>
<!-- Article content end -->
<section class="home other-home">
<div class="container">
{% include '/blog/featured-slider.twig' %}
</div>
</section>
{% endblock %} {% endblock %}

@ -27,14 +27,21 @@
<p>{{_post.date}}</p> <p>{{_post.date}}</p>
<p>{{_post.reading_time}}</p> <p>{{_post.reading_time}}</p>
<ul> <ul>
{% if _post.get_author_name %} <li>
<li class="logo"> <img src="{{ current_path }}/assets/img/header-red.svg" alt="">
<img src="{{_post.get_author_img}}" alt=""> <span>{{ function('get_post_likes_count', _post.ID|default(0)) }}</span>
</li>
<li>
<img src="{{ current_path }}/assets/img/msg-green.svg" alt="">
<span>{{ _post.get_comments_number }}</span> </li>
{% if _post.get_author_name %}
<li class="logo">
<a href="{{ _post.get_author_link }}">
<img src="{{_post.get_author_img}}" alt="">
</a>
</li> </li>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
</div> </div>
</li> </li>

@ -36,7 +36,20 @@
</ul> </ul>
<div class="home-card__content-body__day">{{_post.date}}</div> <div class="home-card__content-body__day">{{_post.date}}</div>
<div class="home-card__content-body__time">{{ function('pll_e', 'время чтения') }}: {{_post.reading_time}}</div> <div class="home-card__content-body__time">{{ function('pll_e', 'время чтения') }}: {{_post.reading_time}}</div>
<div class="home-card__content-body__data">
<div>
<img src="{{ current_path }}/assets/img/heart-grey.svg" alt="">
<span>{{ function('get_post_likes_count', _post.ID|default(0)) }}</span>
</div>
<div>
<img src="{{ current_path }}/assets/img/msg-grey.svg" alt="">
<span>{{ _post.get_comments_number }}</span> </div>
{% if _post.get_author_name %}
<div class="logo">
<img class="main-img" src="{{_post.get_author_img}}" alt="">
</div>
{% endif %}
</div>
<a href="{{_post.link}}" class="home-card__content-body__link">{{ function('pll_e', 'читать статью') }}</a> <a href="{{_post.link}}" class="home-card__content-body__link">{{ function('pll_e', 'читать статью') }}</a>
</div> </div>
</div> </div>

@ -1,3 +1,6 @@
{% set current_path = template_path ~ '/modules/blog/components/most-read' %}
<div class="anons-best"> <div class="anons-best">
<h2 class="anons-best__title">{{ function('pll_e', 'САМЫЕ ЧИТАЕМЫЕ') }}:</h2> <h2 class="anons-best__title">{{ function('pll_e', 'САМЫЕ ЧИТАЕМЫЕ') }}:</h2>
@ -33,12 +36,24 @@
<p>{{ post.date|date('d.m.Y') }}</p> <p>{{ post.date|date('d.m.Y') }}</p>
<p>{{ function('pll_e', 'время чтения') }}: {{ post.reading_time|default('5 мин') }}</p> <p>{{ function('pll_e', 'время чтения') }}: {{ post.reading_time|default('5 мин') }}</p>
<ul> <ul>
<li>
<img src="{{ current_path }}/assets/img/heart-white.svg" alt="">
<span>{{ function('get_post_likes_count', post.ID) }}</span>
</li>
<li>
<img src="{{ current_path }}/assets/img/msg-white.svg" alt="">
<span>{{ post.comment_count }}</span>
</li>
{% if post.get_author_name %} {% if post.get_author_name %}
<li class="logo"> <li class="logo">
<img src="{{ post.get_author_img|default('https://via.placeholder.com/40') }}" alt="{{ post.get_author_name }}"> <a href="{{ post.get_author_link }}">
<img src="{{ post.get_author_img|default('https://via.placeholder.com/40') }}" alt="{{ post.get_author_name }}">
</a>
</li> </li>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
</div> </div>
</li> </li>

@ -1,30 +1,40 @@
{% for post in posts %} {% set current_path = template_path ~ '/modules/blog/components/news-list' %}
<li class="anons-best__card light">
<ul class="anons-best__card-alerts"> {% for post in posts %}
{% for category in post.categories %}
<li> <li class="anons-best__card light">
<a href="{{ category.link }}">{{ category.name }}</a> <ul class="anons-best__card-alerts">
</li> {% for category in post.categories %}
{% endfor %} <li>
</ul> <a href="{{ category.link }}">{{ category.name }}</a>
<a href="{{post.link}}" class="main-img"> </li>
<img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}"> {% endfor %}
</a> </ul>
<div class="anons-best__card-body"> <a href="{{post.link}}" class="main-img">
<a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a> <img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}">
<div class="anons-best__card-body__datas"> </a>
<p>{{post.date}}</p> <div class="anons-best__card-body">
<p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p> <a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a>
<ul> <div class="anons-best__card-body__datas">
{% if post.get_author_name %} <p>{{post.date}}</p>
<li class="logo"> <p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p>
<img src="{{post.get_author_img}}" alt=""> <ul>
</li> <li>
<img src="{{ current_path }}/assets/img/heart-grey.svg" alt="">
{% endif %} <span>{{ function('get_post_likes_count', post.ID) }}</span>
</ul> </li>
<li>
<img src="{{ current_path }}/assets/img/msg-grey.svg" alt="">
<span>{{ post.comment_count }}</span>
</li>
{% if post.get_author_name %}
<li class="logo">
<img src="{{post.get_author_img}}" alt="">
</li>
{% endif %}
</ul>
</div>
</div> </div>
</div> </li>
</li> {% endfor %}
{% endfor %}

@ -0,0 +1,60 @@
{% extends 'layout.twig' %}
{% block content %}
{% set current_path = template_path ~ '/modules/author/' %}
<!-- Breadcrumb -->
<section class="breadcrumb">
<div class="container">
<a href="/">{{ function('pll_e', 'Главная') }}</a> /
<a href="/blog/">{{ function('pll_e', 'Блог') }}</a> /
<a href="/blog_author/">{{ function('pll_e', 'Наши авторы') }}</a>
</div>
</section>
<!-- Breadcrumb end -->
<!-- Authors block -->
<section class="authors">
<div class="container">
<h1>{{ function('pll_e', 'Все авторы') }}</h1>
<ul>
{% for author in authors %}
<li>
<a href="{{ author.link }}">
<div class="main-img">
<img src="{{ author.thumbnail.src|default(author.thumbnail|default('https://via.placeholder.com/150')) }}" alt="{{ author.title }}">
</div>
<div class="authors-name">{{ author.title }}</div>
<div class="authors-type">{{ author.position|default(author.meta('position')) }}</div>
<p>{{ function('pll_e', 'статей:') }} {{ author.post_count|default(0) }}</p>
</a>
</li>
{% else %}
<li>{{ function('pll_e', 'Нет авторов для отображения.') }}</li>
{% endfor %}
</ul>
</div>
</section>
{% include 'forms/discount.twig' %}
<section class="blog-home other-home">
<div class="container">
<!-- Authors block end -->
{% include '/blog/featured-slider.twig' %}
</div>
</section>
{% endblock %}

@ -0,0 +1,36 @@
{% for post in posts %}
<li class="anons-best__card light">
<ul class="anons-best__card-alerts">
{% for category in post.categories %}
<li>
<a href="{{ category.link }}">{{ category.name }}</a>
</li>
{% endfor %}
</ul>
<a href="{{ post.link }}" class="main-img">
<img src="{{ post.thumbnail.src|default('https://via.placeholder.com/150') }}" alt="{{ post.thumbnail.alt }}">
</a>
<div class="anons-best__card-body">
<a href="{{ post.link }}" class="anons-best__card-body__title">{{ post.title }}</a>
<div class="anons-best__card-body__datas">
<p>{{ post.date|date('d.m.Y') }}</p>
<p>{{ function('pll_e', 'время чтения:') }} {{ post.reading_time|default(function('pll_e', '5 мин.')) }}</p>
<ul>
{% if post.get_author_img %}
<li class="logo">
<img src="{{ post.get_author_img }}" alt="{{ post.get_author_name }}">
</li>
{% endif %}
<li>
<img src="{{ current_path }}/assets/img/heart-grey.svg" alt="">
<span>{{ function('get_post_likes_count', post.ID) }}</span>
</li>
<li>
<img src="{{ current_path }}/assets/img/msg-grey.svg" alt="">
<span>{{ post.comment_count }}</span>
</li>
</ul>
</div>
</div>
</li>
{% endfor %}

@ -0,0 +1,92 @@
{% set current_path = template_path ~ '/modules/blog/components/news-list' %}
{% extends 'layout.twig' %}
{% block content %}
<main>
<!-- Breadcrumb -->
<section class="breadcrumb">
<div class="container">
<a href="/">{{ function('pll_e', 'Главная') }}</a> /
<a href="/blog">{{ function('pll_e', 'Блог') }}</a> /
<a href="#">{{ author.title }}</a>
</div>
</section>
<!-- Breadcrumb end -->
<!-- Authors block -->
<section class="author-head">
<div class="container">
<div class="author-head-content">
<div class="main-img">
<img src="{{ author.thumbnail.src|default('https://via.placeholder.com/150') }}" alt="{{ author.title }}">
</div>
<div>
<div class="author-name">{{ author.title }}</div>
<div class="author-type">{{ author.position }}</div>
<div class="author-description">{{ author.content|striptags }}</div>
<p>{{ function('pll_e', 'статей:') }} {{ author.post_count }}</p>
</div>
</div>
<h2>{{ author.meta('headline')|default(function('pll_e', 'Посты автора')) }}</h2>
</div>
</section>
<section class="anons">
<div class="container">
<div class="anons-article">
<ul class="anons-article__card-wrap">
{% for post in author.posts %}
<li class="anons-best__card light">
<ul class="anons-best__card-alerts">
{% for category in post.categories %}
<li>
<a href="{{ category.link }}">{{ category.name }}</a>
</li>
{% endfor %}
</ul>
<a href="{{ post.link }}" class="main-img">
<img src="{{ post.thumbnail.src|default('https://via.placeholder.com/150') }}" alt="{{ post.thumbnail.alt }}">
</a>
<div class="anons-best__card-body">
<a href="{{ post.link }}" class="anons-best__card-body__title">{{ post.title }}</a>
<div class="anons-best__card-body__datas">
<p>{{ post.date|date('d.m.Y') }}</p>
<p>{{ function('pll_e', 'время чтения:') }} {{ post.reading_time|default(function('pll_e', '5 мин.')) }}</p>
<ul>
{% if post.get_author_img %}
<li class="logo">
<img src="{{ post.get_author_img }}" alt="{{ post.get_author_name }}">
</li>
{% endif %}
<li>
<img src="{{ current_path }}/assets/img/heart-grey.svg" alt="">
<span>{{ function('get_post_likes_count', post.ID) }}</span>
</li>
<li>
<img src="{{ current_path }}/assets/img/msg-grey.svg" alt="">
<span>{{ post.comment_count }}</span>
</li>
</ul>
</div>
</div>
</li>
{% else %}
<li>{{ function('pll_e', 'Нет постов') }}</li>
{% endfor %}
</ul>
{% if total_pages > 1 %}
<form id="ajax-load-author" data-total="{{ total_pages }}" data-author="{{ author.ID }}">
<input type="hidden" name="page_num" id="page_num" value="1">
<input type="hidden" name="action" value="get_author_posts">
<button class="anons-article__more-link">
{{ function('pll_e', 'ПОКАЗАТЬ ЕЩЁ') }}
</button>
</form>
{% endif %}
</div>
</div>
</section>
<!-- Authors block end -->
</main>
{% endblock %}

@ -0,0 +1,32 @@
<div class="comment-block">
<div class="comment-user">
<img src="{{ comment.avatar ?? function('get_avatar_url', comment.author.id)|default('') }}" alt="{{ comment.author.name }}">
<div class="comment-user_text">
<h6>
{{ comment.author.name }}
</h6>
<span>
{{ comment.date }}
</span>
</div>
</div>
<p>
{{ comment.content }}
</p>
<div class="comment-btns">
<button class="reply-comment-btn" data-comment-id="{{ comment.ID }}">
<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>
{{ function('pll_e', 'Ответить') }}
</button>
<button class="like-comment-btn" data-comment-id="{{ 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" stroke="#666666"></path>
</svg>
{{ comment.like_count|default('0') }}
</button>
</div>
<div class="reply-form-container" id="reply-form-{{ comment.ID }}" style="display: none;"></div>
</div>

@ -0,0 +1,36 @@
<section class="discount__sale sec-bf">
<div class="container">
<div class="discount_top">
<h3 class="discount_title">{{sub_title}}</span>
</h3>
<div class="discount_top-imgs">
<img class="dicount_dog-img img--desktop"
src="{{ theme.link }}/static/front-page/img/dicsount-sale.png"
alt="">
<img class="dicount_dog-img img--mobile"
src="{{ theme.link }}/static/front-page/img/dicsount-sale-mob.png"
alt="">
</div>
</div>
<div class="dicsount__body">
<div class="" id="" lang="ru-RU" dir="ltr">
<div class="screen-reader-response"><p role="status" aria-live="polite" aria-atomic="true"></p> <ul></ul></div>
<form class="form-process" action="subscribe_form" method="post" class="" aria-label="Контактная форма" novalidate="novalidate" data-status="init">
<div class="discount_form ">
<span class="" data-name="subscriber"><input size="40" class="discount_form-inp" aria-required="true" aria-invalid="false" placeholder="{{ function('pll_e', 'Эл.почта') }}" value="" type="email" name="subscriber"></span>
<img src="/wp-content/themes/cosmopet/static/front-page/img/discount-line-w.svg" data-src="https://cosmopet.shop/wp-content/themes/woodmart/images/svg/discount-line-w.svg" decoding="async" class=" lazyloaded"><noscript><img src="https://cosmopet.shop/wp-content/themes/woodmart/images/svg/discount-line-w.svg" data-eio="l"></noscript>
<input type="hidden" name="from_url" value="{{ current_url }}">
<input type="hidden" name="form_name" value="Subscribtion form">
<button class="discount_form-btn main_link" type="submit">{{ function('pll_e', 'подписаться') }}</button>
</div>
</form>
</div>
<p class="discount_form-text">
{{ function('pll_e', 'Подписываясь на рассылку, я даю согласие на обработку персональных данных, на получение рекламных сообщений и новостей о товарах и услугах') }}</p>
<p class="discount_text">{{sub_text}}</p>
</div>
</div>
</section>

@ -609,42 +609,7 @@
</section> </section>
</div> </div>
<section class="discount__sale sec-bf"> {% include 'forms/discount.twig' %}
<div class="container">
<div class="discount_top">
<h3 class="discount_title">{{sub_title}}</span>
</h3>
<div class="discount_top-imgs">
<img class="dicount_dog-img img--desktop"
src="{{ theme.link }}/static/front-page/img/dicsount-sale.png"
alt="">
<img class="dicount_dog-img img--mobile"
src="{{ theme.link }}/static/front-page/img/dicsount-sale-mob.png"
alt="">
</div>
</div>
<div class="dicsount__body">
<div class="" id="" lang="ru-RU" dir="ltr">
<div class="screen-reader-response"><p role="status" aria-live="polite" aria-atomic="true"></p> <ul></ul></div>
<form class="form-process" action="subscribe_form" method="post" class="" aria-label="Контактная форма" novalidate="novalidate" data-status="init">
<div class="discount_form ">
<span class="" data-name="subscriber"><input size="40" class="discount_form-inp" aria-required="true" aria-invalid="false" placeholder="{{ function('pll_e', 'Эл.почта') }}" value="" type="email" name="subscriber"></span>
<img src="/wp-content/themes/cosmopet/static/front-page/img/discount-line-w.svg" data-src="https://cosmopet.shop/wp-content/themes/woodmart/images/svg/discount-line-w.svg" decoding="async" class=" lazyloaded"><noscript><img src="https://cosmopet.shop/wp-content/themes/woodmart/images/svg/discount-line-w.svg" data-eio="l"></noscript>
<input type="hidden" name="from_url" value="{{ current_url }}">
<input type="hidden" name="form_name" value="Subscribtion form">
<button class="discount_form-btn main_link" type="submit">{{ function('pll_e', 'подписаться') }}</button>
</div>
</form>
</div>
<p class="discount_form-text">
{{ function('pll_e', 'Подписываясь на рассылку, я даю согласие на обработку персональных данных, на получение рекламных сообщений и новостей о товарах и услугах') }}</p>
<p class="discount_text">{{sub_text}}</p>
</div>
</div>
</section>
{% endblock %} {% endblock %}
Loading…
Cancel
Save