Blog module

pull/1/head
parent c35aa5535d
commit ddf4d4dfd2
  1. 6
      wp-content/.htaccess
  2. 6
      wp-content/themes/cosmopet/archive.php
  3. 38
      wp-content/themes/cosmopet/functions.php
  4. 26
      wp-content/themes/cosmopet/global-functions/multilang-functions.php
  5. 3
      wp-content/themes/cosmopet/modules/blog/components/archive/component-controller.php
  6. 8
      wp-content/themes/cosmopet/modules/blog/components/archive/component-template.twig
  7. 27
      wp-content/themes/cosmopet/modules/blog/components/author-banner/component-template.twig
  8. 3
      wp-content/themes/cosmopet/modules/blog/components/editorial/component-template.twig
  9. 172
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/css/gp-style-desktop.css
  10. 95
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/css/gp-style-tablet.css
  11. 4
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/component-template.twig
  12. 4
      wp-content/themes/cosmopet/modules/blog/components/most-read/component-template.twig
  13. 2
      wp-content/themes/cosmopet/modules/blog/components/news-list/component-template.twig
  14. 112
      wp-content/themes/cosmopet/modules/blog/components/single/assets/css/gp-style-desktop.css
  15. 61
      wp-content/themes/cosmopet/modules/blog/components/single/assets/css/gp-style-tablet.css
  16. 2
      wp-content/themes/cosmopet/modules/blog/components/single/component-controller.php
  17. 14
      wp-content/themes/cosmopet/modules/blog/components/single/component-template.twig
  18. 28
      wp-content/themes/cosmopet/modules/blog/components/themes/component-template.twig
  19. 77
      wp-content/themes/cosmopet/modules/blog/editor-blocks/accent/assets/css/style.css
  20. 40
      wp-content/themes/cosmopet/modules/blog/editor-blocks/accent/editor-block-controller.php
  21. 14
      wp-content/themes/cosmopet/modules/blog/editor-blocks/accent/editor-block-template.twig
  22. 131
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/css/style.css
  23. 3
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/icon-1.svg
  24. 3
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/icon-2.svg
  25. 5
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/icon-3.svg
  26. 5
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/icon-4.svg
  27. 18
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/assets/img/icon-5.svg
  28. 38
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/editor-block-controller.php
  29. 17
      wp-content/themes/cosmopet/modules/blog/editor-blocks/alerts/editor-block-template.twig
  30. 176
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/assets/css/style.css
  31. 4
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/assets/img/minus-icon.svg
  32. 18
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/assets/img/plus-icon.svg
  33. 41
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/editor-block-controller.php
  34. 49
      wp-content/themes/cosmopet/modules/blog/editor-blocks/block_img/editor-block-template.twig
  35. 56
      wp-content/themes/cosmopet/modules/blog/editor-blocks/button_block/assets/css/style.css
  36. 46
      wp-content/themes/cosmopet/modules/blog/editor-blocks/button_block/editor-block-controller.php
  37. 4
      wp-content/themes/cosmopet/modules/blog/editor-blocks/button_block/editor-block-template.twig
  38. 16
      wp-content/themes/cosmopet/modules/blog/editor-blocks/image/assets/css/style.css
  39. 44
      wp-content/themes/cosmopet/modules/blog/editor-blocks/image/editor-block-controller.php
  40. 3
      wp-content/themes/cosmopet/modules/blog/editor-blocks/image/editor-block-template.twig
  41. 24
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v1/assets/css/style.css
  42. 44
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v1/editor-block-controller.php
  43. 10
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v1/editor-block-template.twig
  44. 34
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v2/assets/css/style.css
  45. 43
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v2/editor-block-controller.php
  46. 10
      wp-content/themes/cosmopet/modules/blog/editor-blocks/list_v2/editor-block-template.twig
  47. 72
      wp-content/themes/cosmopet/modules/blog/editor-blocks/swiper/assets/css/style.css
  48. 14
      wp-content/themes/cosmopet/modules/blog/editor-blocks/swiper/assets/js/script.js
  49. 40
      wp-content/themes/cosmopet/modules/blog/editor-blocks/swiper/editor-block-controller.php
  50. 18
      wp-content/themes/cosmopet/modules/blog/editor-blocks/swiper/editor-block-template.twig
  51. 87
      wp-content/themes/cosmopet/modules/blog/editor-blocks/table/assets/css/style.css
  52. 36
      wp-content/themes/cosmopet/modules/blog/editor-blocks/table/editor-block-controller.php
  53. 21
      wp-content/themes/cosmopet/modules/blog/editor-blocks/table/editor-block-template.twig
  54. 36
      wp-content/themes/cosmopet/modules/blog/editor-blocks/texts/assets/css/style.css
  55. 2
      wp-content/themes/cosmopet/modules/blog/editor-blocks/texts/editor-block-controller.php
  56. 5
      wp-content/themes/cosmopet/modules/blog/editor-blocks/video/assets/css/style.css
  57. 43
      wp-content/themes/cosmopet/modules/blog/editor-blocks/video/editor-block-controller.php
  58. 3
      wp-content/themes/cosmopet/modules/blog/editor-blocks/video/editor-block-template.twig
  59. 2
      wp-content/themes/cosmopet/modules/blog/module-controller.php
  60. 12
      wp-content/themes/cosmopet/modules/blog/shortcodes/intend/shortcode.php
  61. 1
      wp-content/themes/cosmopet/modules/blog/shortcodes/intend/shortcode.twig
  62. 10
      wp-content/themes/cosmopet/modules/blog/shortcodes/intend_close/shortcode.php
  63. 1
      wp-content/themes/cosmopet/modules/blog/shortcodes/intend_close/shortcode.twig
  64. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg-sm.png
  65. BIN
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/assets/img/discount-bg.png
  66. 10
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/shortcode.php
  67. 17
      wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form/shortcode.twig
  68. 4
      wp-content/themes/cosmopet/modules/example/components/example/component-ajax-controller.php
  69. 11
      wp-content/themes/cosmopet/modules/footer/module-controller.php
  70. 56
      wp-content/themes/cosmopet/modules/footer/module.template.twig
  71. 19
      wp-content/themes/cosmopet/modules/forms/assets/js/form.js
  72. 21
      wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php
  73. 72
      wp-content/themes/cosmopet/modules/forms/module-controller.php
  74. 0
      wp-content/themes/cosmopet/modules/forms/module.template.twig
  75. 773
      wp-content/themes/cosmopet/modules/header/assets/css/gp-style-desktop.css
  76. 3
      wp-content/themes/cosmopet/modules/header/assets/img/arrow-black.svg
  77. 11
      wp-content/themes/cosmopet/modules/header/assets/img/arrow-selected.svg
  78. BIN
      wp-content/themes/cosmopet/modules/header/assets/img/cat.png
  79. BIN
      wp-content/themes/cosmopet/modules/header/assets/img/dog.png
  80. 151
      wp-content/themes/cosmopet/modules/header/assets/js/core.js
  81. 46
      wp-content/themes/cosmopet/modules/header/module.template.twig
  82. 154
      wp-content/themes/cosmopet/modules/header/module.template_ENG.twig
  83. 150
      wp-content/themes/cosmopet/modules/header/module.template_RU.twig
  84. 20
      wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css
  85. 1539
      wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-full.css
  86. 1
      wp-content/themes/cosmopet/modules/layout/module-controller.php
  87. 11
      wp-content/themes/cosmopet/modules/layout/module.template.twig
  88. 154
      wp-content/themes/cosmopet/modules/popup/assets/css/gp-style-desktop.css
  89. 68
      wp-content/themes/cosmopet/modules/popup/assets/css/gp-style-mobile.css
  90. 4
      wp-content/themes/cosmopet/modules/popup/assets/css/gp-style-tablet.css
  91. 0
      wp-content/themes/cosmopet/modules/popup/components/thx/assets/css/gp-style-desktop.css
  92. 0
      wp-content/themes/cosmopet/modules/popup/components/thx/assets/css/gp-style-mobile.css
  93. 0
      wp-content/themes/cosmopet/modules/popup/components/thx/assets/css/gp-style-tablet.css
  94. 0
      wp-content/themes/cosmopet/modules/popup/components/thx/component-ajax-controller.php
  95. 12
      wp-content/themes/cosmopet/modules/popup/components/thx/component-controller.php
  96. 33
      wp-content/themes/cosmopet/modules/popup/components/thx/component-template.twig
  97. 0
      wp-content/themes/cosmopet/modules/popup/module-ajax-controller.php
  98. 10
      wp-content/themes/cosmopet/modules/popup/module-controller.php
  99. 60
      wp-content/themes/cosmopet/modules/popup/module.template.twig

@ -1,7 +1 @@
# BEGIN WebP Converter
# ! --- DO NOT EDIT PREVIOUS LINE --- !
# ! --- DO NOT EDIT NEXT LINE --- !
# END WebP Converter

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

@ -45,12 +45,36 @@ function requireAjaxControllers($baseDir) {
} }
} }
if( wp_doing_ajax() ){ function requireShortcodes($baseDir) {
$modules = glob($baseDir . '/*', GLOB_ONLYDIR);
requireAjaxControllers($modulesDir); foreach ($modules as $module) {
$componentsDir = $module . '/shortcodes';
if (is_dir($componentsDir)) {
// Рекурсивно подключаем все shortcodes.php
requireShortcodesRecursive($componentsDir);
}
}
}
function requireShortcodesRecursive($dir) {
// Получаем все подпапки в текущем каталоге
$components = glob($dir . '/*', GLOB_ONLYDIR);
foreach ($components as $component) {
// Проверяем наличие файла shortcode.php в текущей подпапке
$componentController = $component . '/shortcode.php';
if (file_exists($componentController)) {
require_once $componentController;
}
// Рекурсивно вызываем функцию для каждой найденной подпапки
requireShortcodesRecursive($component);
}
} }
// Пример вызова функции
function includeFilesFromFolder($folder) { function includeFilesFromFolder($folder) {
// Проверяем, существует ли папка // Проверяем, существует ли папка
if (is_dir($folder)) { if (is_dir($folder)) {
@ -249,6 +273,16 @@ $modules_path = get_template_directory() . '/modules/*/editor-blocks/*/editor-bl
foreach (glob($modules_path) as $file) { foreach (glob($modules_path) as $file) {
require_once $file; // Подключаем каждый найденный файл require_once $file; // Подключаем каждый найденный файл
} }
add_filter('timber/context', function($context) {
$context['current_lang'] = pll_current_language();
return $context;
});
requireShortcodes(get_template_directory() . '/modules');
require_once('modules/blog/components/news-list/component-ajax-controller.php');
require_once('modules/forms/module-ajax-controller.php');
include_module('forms');
include_module('layout'); include_module('layout');

@ -0,0 +1,26 @@
<?php
pll_register_string ('Темы', 'Темы');
pll_register_string ('САМЫЕ ЧИТАЕМЫЕ', 'САМЫЕ ЧИТАЕМЫЕ');
pll_register_string ('время чтения', 'время чтения');
pll_register_string ('ВСЕ СТАТЬИ', 'ВСЕ СТАТЬИ');
pll_register_string ('ПРЕДЛОЖИТЕ СТАТЬЮ ИЛИ СТАНЬТЕ АВТОРОМ', 'ПРЕДЛОЖИТЕ СТАТЬЮ ИЛИ СТАНЬТЕ АВТОРОМ');
pll_register_string ('НАПИШИТЕ НАМ', 'НАПИШИТЕ НАМ');
pll_register_string ('COSMO тема редакции', 'COSMO тема редакции');
pll_register_string ('мин.', 'мин.');
pll_register_string ('Форма обратной связи', 'Форма обратной связи');
pll_register_string ('Ваше имя', 'Ваше имя');
pll_register_string ('Эл.почта', 'Эл.почта');
pll_register_string ('Текст обращения', 'Текст обращения');
pll_register_string ('Отправить', 'Отправить');
pll_register_string ('Чат бот с ветеринаром', 'Чат бот с ветеринаром');
pll_register_string ('Калькулятор рациона', 'Калькулятор рациона');
pll_register_string ('ПОКАЗАТЬ ЕЩЁ', 'ПОКАЗАТЬ ЕЩЁ');
pll_register_string ('ВСЕ', 'ВСЕ');
pll_register_string ('читать статью', 'читать статью');
pll_register_string ('Блог', 'Блог');
pll_register_string ('Главная', 'Главная');
pll_register_string ('Подпишитесь, чтобы быть в курсе деятельности Cosmopet и узнавать о наших, предложениях. Обещаем не заваливать вас бесполезными письмами. А за подписку дарим -25% на весь ассортимент нашей продукции', 'Подпишитесь, чтобы быть в курсе деятельности Cosmopet и узнавать о наших предложениях. Обещаем не заваливать вас бесполезными письмами. А за подписку дарим -25% на весь ассортимент нашей продукции');
pll_register_string ('Подписываясь на рассылку, я даю согласие на обработку персональных данных, на получение рекламных сообщений и новостей о товарах и услугах', 'Подписываясь на рассылку, я даю согласие на обработку персональных данных, на получение рекламных сообщений и новостей о товарах и услугах');
pll_register_string ('подписаться', 'подписаться');
pll_register_string ('Узнайте о нас больше и получите <span>скидку!</span>', 'Узнайте о нас больше и получите <span>скидку!</span>');

@ -11,7 +11,8 @@ wp_localize_script('blog-archive-posts-ajax-js', 'ajax', array(
)); ));
$context = Timber::get_context(); $context = Timber::get_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['post_count'] = wp_count_posts()->publish; // Количество опубликованных постов
$context['total_pages'] = ceil($context['post_count'] / get_option('posts_per_page')); // Общее количество страниц $context['total_pages'] = ceil($context['post_count'] / get_option('posts_per_page')); // Общее количество страниц

@ -6,8 +6,8 @@
<!-- Home --> <!-- Home -->
<section class="home"> <section class="home">
<div class="container"> <div class="container">
<h1 class="home-title">БЛОГ</h1> <h1 class="home-title">{{blog_title}}</h1>
<p class="home-description">Мы пишем про то, что нас по‑настоящему цепляет: биотехнологии, науку, здоровье и то, как этот мир сделать лучше. Мы не боимся сложных тем и неудобных вопросов, ведь именно с них начинается будущее</p> <p class="home-description">{{blog_desc}}</p>
{% include '/blog/components/featured-slider/component-template.twig' %} {% include '/blog/components/featured-slider/component-template.twig' %}
</div> </div>
</section> </section>
@ -20,7 +20,7 @@
{% include '/blog/components/most-read/component-template.twig' %} {% include '/blog/components/most-read/component-template.twig' %}
<div class="anons-article"> <div class="anons-article">
<h2 class="anons-article__title">ВСЕ СТАТЬИ</h2> <h2 class="anons-article__title">{{ function('pll_e', 'ВСЕ СТАТЬИ') }}</h2>
<ul class="anons-article__card-wrap"> <ul class="anons-article__card-wrap">
{% include '/blog/components/news-list/component-template.twig' %} {% include '/blog/components/news-list/component-template.twig' %}
@ -31,7 +31,7 @@
<input type="hidden" name="page_num" id="page_num" value="1"> <input type="hidden" name="page_num" id="page_num" value="1">
<input type="hidden" name="action" value="load_blog_posts"> <input type="hidden" name="action" value="load_blog_posts">
<button class="anons-article__more-link" > <button class="anons-article__more-link" >
ПОКАЗАТЬ ЕЩЁ {{ function('pll_e', 'ПОКАЗАТЬ ЕЩЁ') }}
</button> </button>
</form> </form>
{% endif %} {% endif %}

@ -1,14 +1,15 @@
{% set current_path = template_path ~ '/modules/blog/components/author-banner' %} {% set current_path = template_path ~ '/modules/blog/components/author-banner' %}
<section class="author"> <section class="author">
<div class="container"> <div class="container">
<div class="author-content"> <div class="author-content">
<img src="{{ current_path }}/assets/img/star-1.png" alt="" class="author-content__star-1"> <img src="{{ current_path }}/assets/img/star-1.png" alt="" class="author-content__star-1">
<img src="{{ current_path }}/assets/img/star-2.png" alt="" class="author-content__star-2"> <img src="{{ current_path }}/assets/img/star-2.png" alt="" class="author-content__star-2">
<img src="{{ current_path }}/assets/img/author-card.png" alt="" class="author-content__img"> <img src="{{ current_path }}/assets/img/author-card.png" alt="" class="author-content__img">
<img src="{{ current_path }}/assets/img/author-card-mb.png" alt="" class="author-content__img mb"> <img src="{{ current_path }}/assets/img/author-card-mb.png" alt="" class="author-content__img mb">
<h2 class="author-content__title">ПРЕДЛОЖИТЕ СТАТЬЮ <br>ИЛИ СТАНЬТЕ АВТОРОМ</h2> <h2 class="author-content__title">{{ function('pll_e', 'ПРЕДЛОЖИТЕ СТАТЬЮ ИЛИ СТАНЬТЕ АВТОРОМ') }}
<a href="#" class="author-content__link">НАПИШИТЕ НАМ</a> </h2>
</div> <a href="#" class="author-content__link">{{ function('pll_e', 'НАПИШИТЕ НАМ') }}</a>
</div> </div>
</section> </div>
</section>

@ -4,7 +4,7 @@
<section class="editorial"> <section class="editorial">
<div class="container"> <div class="container">
<div class="editorial-head"> <div class="editorial-head">
<h2 class="editorial-head__title">COSMO тема редакции</h2> <h2 class="editorial-head__title">{{ function('pll_e', 'COSMO тема редакции') }}</h2>
<img src="{{ current_path }}/assets/img/editorial-head-icon.png" alt="" class="editorial-head__img"> <img src="{{ current_path }}/assets/img/editorial-head-icon.png" alt="" class="editorial-head__img">
<img src="{{ current_path }}/assets/img/editorial-head-star.png" alt="" class="editorial-head__star"> <img src="{{ current_path }}/assets/img/editorial-head-star.png" alt="" class="editorial-head__star">
</div> </div>
@ -27,7 +27,6 @@
<div class="editorial-card__content-data"> <div class="editorial-card__content-data">
<p>{{_post.date}}</p> <p>{{_post.date}}</p>
<p>{{_post.reading_time}}</p> <p>{{_post.reading_time}}</p>
</div> </div>
</div> </div>
</li> </li>

@ -0,0 +1,172 @@
.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 8.5px;
font-size: 20px;
font-weight: 500;
line-height: 24px;
transition: all .5s;
}
.home-card__content-body__link:hover{
background-color: #000;
color: #fff;
}

@ -0,0 +1,95 @@
/* Стили для планшетов */
@media only screen and (max-width: 992px) {
.home-swp__btn {
bottom: auto;
top: 93px;
left: -10px;
width: calc(100% + 20px);
justify-content: space-between;
transform: translateX(0);
}
.home-swp__btn button {
width: 48px;
height: 48px;
border-radius: 20px;
}
.home-card {
flex-direction: column;
border-radius: 24px;
gap: 17px;
}
.home-card__img {
height: 234px;
width: 100%;
border-radius: 24px;
}
.home-card__content {
padding: 0 16px 89px;
}
.home-card__content-title {
font-size: 20px;
line-height: 24px;
margin-bottom: 15px;
}
.home-card__content-description {
font-size: 16px;
line-height: 20px;
margin-bottom: 15px;
display: -webkit-box;
-webkit-line-clamp: 5;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.home-card__content-body {
gap: 7px;
}
.home-card__content-body__alerts {
gap: 7px;
}
.home-card__content-body__alerts li {
font-size: 14px;
line-height: 16px;
padding: 8px;
}
.home-card__content-body__day {
font-size: 14px;
line-height: 16px;
}
.home-card__content-body__time {
font-size: 14px;
line-height: 16px;
}
.home-card__content-body__data {
gap: 7px;
}
.home-card__content-body__data>div {
gap: 4px;
font-size: 14px;
line-height: 16px;
}
.home-card__content-body__data .main-img {
width: 32px;
height: 32px;
}
.home-card__content-body__link {
right: 50%;
bottom: 27px;
transform: translateX(50%);
}
}

@ -34,9 +34,9 @@
{% endfor %} {% endfor %}
</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">время чтения: {{_post.reading_time}}</div> <div class="home-card__content-body__time">{{ function('pll_e', 'время чтения') }}: {{_post.reading_time}}</div>
<a href="{{_post.link}}" class="home-card__content-body__link">читать статью</a> <a href="{{_post.link}}" class="home-card__content-body__link">{{ function('pll_e', 'читать статью') }}</a>
</div> </div>
</div> </div>
</div> </div>

@ -1,5 +1,5 @@
<div class="anons-best"> <div class="anons-best">
<h2 class="anons-best__title">САМЫЕ ЧИТАЕМЫЕ:</h2> <h2 class="anons-best__title">{{ function('pll_e', 'САМЫЕ ЧИТАЕМЫЕ') }}:</h2>
<ul class="anons-best__card-wrap"> <ul class="anons-best__card-wrap">
{% for post in most_read %} {% for post in most_read %}
<li class="anons-best__card"> <li class="anons-best__card">
@ -17,7 +17,7 @@
<a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a> <a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a>
<div class="anons-best__card-body__datas"> <div class="anons-best__card-body__datas">
<p>{{post.date}}</p> <p>{{post.date}}</p>
<p>время чтения: {{post.reading_time}}</p> <p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p>
</div> </div>
</div> </div>
</li> </li>

@ -15,7 +15,7 @@
<a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a> <a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a>
<div class="anons-best__card-body__datas"> <div class="anons-best__card-body__datas">
<p>{{post.date}}</p> <p>{{post.date}}</p>
<p>время чтения: {{post.reading_time}}</p> <p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p>
</div> </div>
</div> </div>
</li> </li>

@ -0,0 +1,112 @@
.article-content p {
color: var(--grey-black);
font-size: 24px;
line-height: 32px;
font-weight: 500;
}
.article-content h2 {
max-width: 661px;
font-size: 36px;
line-height: 40px;
font-weight: bold;
text-transform: uppercase;
color: var(--grey-black);
}
.indent {
background: #E2F3FF;
border-radius: 32px;
padding: 36px 49px;
display: flex;
flex-direction: column;
gap: 32px;
margin-bottom: 48px;
}
/* Discount */
.discount {
background: radial-gradient(122% 156.56% at 100% 0%, #7E90FF 0%, #8187FF 45%, #F8A6FF 100%) /* warning: gradient uses a rotation that is not supported by CSS and may not behave as expected */;
border-radius: 32px;
padding: 32px;
position: relative;
z-index: 1;
margin-bottom: 48px;
}
.discount-title {
font-size: 36px;
font-weight: bold;
line-height: 40px;
text-transform: uppercase;
max-width: 517px;
color: var(--main_black);
margin-bottom: 15px;
}
.discount-bg {
position: absolute;
top: 4px;
right: 8px;
width: 369px;
z-index: -1;
}
.discount-bg.mb {
display: none;
}
.discount-title span {
color: var(--main_white);
}
.discount-form {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 15px;
}
.discount-form input {
width: 280px;
height: 50px;
border: 2px solid var(--main_black);
border-radius: 48px;
background: #F5F5F5;
padding: 0 18px;
font-size: 24px;
font-weight: 500;
color: var(--main_black);
}
.discount-form button {
border: 2px solid var(--main_black);
background: transparent;
height: 50px;
padding: 0 30px;
font-size: 24px;
font-weight: 500;
color: var(--main_black);
border-radius: 50px;
}
.discount-form button:hover {
background: var(--interface_title);
color: var(--main_white);
}
p.discount-description__1 {
font-size: 14px;
font-weight: 500;
color: var(--main_black);
max-width: 621px;
margin-bottom: 15px;
}
p.discount-description__2 {
font-size: 20px;
font-weight: 500;
color: var(--main_black);
}
/* Discount end */

@ -0,0 +1,61 @@
@media (max-width: 992px) {
.discount {
padding: 32px 24px;
border-radius: 32px;
margin-bottom: 48px;
}
.discount-title {
font-size: 26px;
line-height: 32px;
margin-bottom: 21px;
}
.discount-bg {
display: none;
}
.discount-bg.mb {
display: inline-block;
position: static;
margin-bottom: 21px;
}
.discount-form {
flex-direction: column;
gap: 21px;
margin-bottom: 21px;
}
.discount-form img {
display: none;
}
.discount-form input {
width: 100%;
text-align: center;
}
.discount-form button {
width: 100%;
text-align: center;
}
.discount-descriptions {
display: flex;
flex-direction: column-reverse;
}
.discount-description__2 {
font-size: 18px;
line-height: 24px;
font-weight: 500;
grid-area: 21px;
margin-bottom: 21px;
}
.discount-description__1 {
margin-bottom: 0;
font-size: 12px;
}
}

@ -1,6 +1,6 @@
<?php <?php
include_component('blog', 'featured-slider');
$context = Timber::get_context(); $context = Timber::get_context();
Timber::render('blog/components/single/component-template.twig', $context); Timber::render('blog/components/single/component-template.twig', $context);

@ -6,8 +6,8 @@
<!-- Breadcrumb --> <!-- Breadcrumb -->
<section class="breadcrumb"> <section class="breadcrumb">
<div class="container"> <div class="container">
<a href="{{ site.url }}">Главная</a> / <a href="{{ site.url }}">{{ function('pll_e', 'Главная') }}</a> /
<a href="{{ site.url }}">Блог</a> / <a href="{{ site.url }}">{{ function('pll_e', 'Блог') }}</a> /
<a href="{{ post.link }}">{{ post.name }}</a> <a href="{{ post.link }}">{{ post.name }}</a>
</div> </div>
</section> </section>
@ -26,7 +26,7 @@
{% endfor %} {% endfor %}
</ul> </ul>
<p>{{post.date}}</p> <p>{{post.date}}</p>
<p>время чтения: {{post.reading_time}}</p> <p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p>
</div> </div>
<div class="article-home__card"> <div class="article-home__card">
@ -41,9 +41,15 @@
<div class="article-content"> <div class="article-content">
<div class="article-container"> <div class="article-container">
{{post.content}} {{post.content}}
</div>
</div> </div>
<!-- Article content end --> <!-- Article content end -->
<section class="home other-home">
<div class="container">
{% include '/blog/components/featured-slider/component-template.twig' %}
</div>
</section>
{% endblock %} {% endblock %}

@ -1,15 +1,15 @@
<div class="anons-theme">
<h3 class="anons-theme__title">{{ function('pll_e', 'Темы') }}:</h3>
<ul>
<li>
<a href="/" class="{% if not current_category %} active {% endif %}">{{ function('pll_e', 'ВСЕ') }}</a>
</li>
{% for category in category_list %}
<li>
<a href="/category/{{category.slug}}"
class="{% if current_category == category.name %} active {% endif %}">{{ category.name }}</a>
</li>
<div class="anons-theme"> {% endfor %}
<h3 class="anons-theme__title">Темы:</h3> </ul>
<ul> </div>
<li>
<a href="" class="{% if not current_category %} active {% endif %}">ВСЕ</a>
</li>
{% for category in category_list %}
<li>
<a href="{{ category.link }}" class="{% if current_category == category.name %} active {% endif %}">{{ category.name }}</a>
</li>
{% endfor %}
</ul>
</div>

@ -0,0 +1,77 @@
.block-accent {
display: flex;
flex-direction: column;
gap: 48px;
}
.block-accent__card {
padding: 36px 63px 36px 49px;
border-radius: 32px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 32px;
width: 100%;
}
.block-accent .card-violet {
flex-direction: row-reverse;
background: var(--violet_90);
}
.block-accent__card-content {
width: 100%;
display: flex;
flex-direction: column;
gap: 21px;
}
.block-accent__card h3 {
font-size: 26px;
font-weight: bold;
color: var(--grey-black);
text-transform: uppercase;
}
.block-accent__card p {
font-size: 24px;
line-height: 32px;
font-weight: 500;
color: var(--grey-black);
}
.block-accent__card img {
flex-shrink: 0;
}
.block-accent .card-orange {
background: var(--orange_80);
}
.block-accent .card-blue {
background: #E0FDFF;
}
@media (max-width: 992px) {
.block-accent__card {
padding: 36px 24px;
gap: 32px;
flex-direction: column !important;
}
.block-accent__card-content {
gap: 27px;
}
.block-accent__card-content h3 {
font-size: 20px;
line-height: 24px;
text-align: center;
}
.block-accent__card-content p {
font-size: 18px;
line-height: 24px;
}
}

@ -0,0 +1,40 @@
<?php
function accent_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['color'] = get_field('color');
$context['content'] = get_field('content');
$context['order'] = get_field('order');
$context['img'] = get_field('img');
Timber::render('modules/blog/editor-blocks/accent/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_accent',
'title' => __('GP - accent'),
'description' => __('accent block'),
'render_callback' => 'accent_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'accent', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_accent_style', get_template_directory_uri() . '/modules/blog/editor-blocks/accent/assets/css/style.css', array(), '2.0', 'all');
}
));
}
});
?>

@ -0,0 +1,14 @@
<section class="block-accent">
<div class="block-accent__card card-violet" style="background-color: {{color}}">
{% if order %}
<img src="{{img.url}}" alt="{{img.src}}">
{% endif %}
<div class="block-accent__card-content">
{{content}}
</div>
{% if not order %}
<img src="{{img.url}}" alt="{{img.src}}">
{% endif %}
</div>
</section>

@ -0,0 +1,131 @@
/* Alerts */
.alerts {
display: flex;
flex-direction: column;
gap: 48px;
}
.alerts-grey {
padding: 32px 98px;
border-radius: 32px;
background: var(--bg-light-grey);
position: relative;
}
.alerts-grey p {
color: #191919;
font-size: 24px;
font-weight: 500;
line-height: 32px;
}
.alerts-grey .icon-1 {
position: absolute;
top: 32px;
left: 32px;
}
.alerts-grey .icon-2 {
position: absolute;
bottom: 32px;
right: 32px;
}
.alerts-violet {
background: #FAEAE9;
border-radius: 32px;
padding: 32px;
display: flex;
align-items: center;
gap: 32px;
}
.alerts-violet img {
flex-shrink: 0;
}
.alerts-violet p {
font-size: 24px;
font-weight: 500;
line-height: 32px;
color: #191919;
}
.alerts-yellow {
display: flex;
align-items: center;
background: #FEF8E6;
border-radius: 32px;
padding: 32px;
gap: 32px;
}
.alerts-yellow img {
flex-shrink: 0;
}
.alerts-yellow p {
font-size: 24px;
line-height: 32px;
font-weight: 500;
color: #191919;
}
.alerts-green {
background: #E9F8EB;
border-radius: 32px;
padding: 32px;
display: flex;
align-items: center;
gap: 32px;
}
.alerts-green img {
flex-shrink: 0;
}
.alerts-green p {
color: #191919;
font-size: 24px;
font-weight: 500;
line-height: 32px;
}
/* Alerts end */
@media (max-width: 992px) {
.alerts-grey {
padding: 32px 48px;
}
.alerts-grey .icon-1 {
width: 24px;
top: 32px;
left: 16px;
}
.alerts-grey .icon-2 {
width: 24px;
right: 16px;
bottom: 32px;
}
.alerts-grey p {
font-size: 18px;
line-height: 24px;
}
.alerts-violet,
.alerts-yellow,
.alerts-green {
padding: 32px 24px;
flex-direction: column;
}
.alerts-violet p,
.alerts-yellow p,
.alerts-green p {
font-size: 18px;
line-height: 24px;
}
}

@ -0,0 +1,3 @@
<svg width="42" height="33" viewBox="0 0 42 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.88461 32.6538C6.5 32.6538 4.42308 31.7692 2.65385 30C0.884615 28.2308 0 25.5769 0 22.0385C0 18.9615 0.615385 16 1.84615 13.1538C3.07692 10.3077 5.07692 7.73077 7.84615 5.42308C10.6923 3.11538 14.3846 1.30769 18.9231 0V4.84615C15.1538 6.07692 12.3846 7.57692 10.6154 9.34615C8.84615 11.0385 7.96154 13 7.96154 15.2308C7.96154 16.3846 8.38461 17.2692 9.23077 17.8846C10.0769 18.5 11.0385 19.0769 12.1154 19.6154C13.2692 20.1538 14.2692 20.8846 15.1154 21.8077C15.9615 22.7308 16.3846 24.0769 16.3846 25.8462C16.3846 28 15.6538 29.6923 14.1923 30.9231C12.8077 32.0769 11.0385 32.6538 8.88461 32.6538ZM31.9615 32.6538C29.5769 32.6538 27.5 31.7692 25.7308 30C23.9615 28.2308 23.0769 25.5769 23.0769 22.0385C23.0769 18.9615 23.6923 16 24.9231 13.1538C26.1538 10.3077 28.1538 7.73077 30.9231 5.42308C33.7692 3.11538 37.4615 1.30769 42 0V4.84615C38.2308 6.07692 35.4615 7.57692 33.6923 9.34615C31.9231 11.0385 31.0385 13 31.0385 15.2308C31.0385 16.3846 31.4615 17.2692 32.3077 17.8846C33.1538 18.5 34.1154 19.0769 35.1923 19.6154C36.3462 20.1538 37.3462 20.8846 38.1923 21.8077C39.0385 22.7308 39.4615 24.0769 39.4615 25.8462C39.4615 28 38.7308 29.6923 37.2692 30.9231C35.8846 32.0769 34.1154 32.6538 31.9615 32.6538Z" fill="#121212"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,3 @@
<svg width="42" height="31" viewBox="0 0 42 31" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M33.1154 0.00698775C35.5 0.00698796 37.5769 0.846611 39.3462 2.52586C41.1154 4.2051 42 6.72397 42 10.0825C42 13.0029 41.3846 15.8138 40.1538 18.5152C38.9231 21.2166 36.9231 23.6624 34.1538 25.8528C31.3077 28.0431 27.6154 29.7588 23.0769 31L23.0769 26.4003C26.8462 25.2322 29.6154 23.8085 31.3846 22.1292C33.1538 20.523 34.0385 18.6612 34.0385 16.5439C34.0385 15.4487 33.6154 14.6091 32.7692 14.025C31.9231 13.4409 30.9615 12.8934 29.8846 12.3823C28.7308 11.8712 27.7308 11.1776 26.8846 10.3015C26.0385 9.42536 25.6154 8.14768 25.6154 6.46843C25.6154 4.42413 26.3462 2.8179 27.8077 1.64973C29.1923 0.554568 30.9615 0.00698756 33.1154 0.00698775ZM10.0385 0.00698573C12.4231 0.00698594 14.5 0.846609 16.2692 2.52585C18.0385 4.2051 18.9231 6.72397 18.9231 10.0825C18.9231 13.0029 18.3077 15.8138 17.0769 18.5152C15.8462 21.2166 13.8462 23.6624 11.0769 25.8527C8.23077 28.0431 4.53846 29.7588 3.8147e-06 31L4.21681e-06 26.4003C3.76923 25.2322 6.53846 23.8085 8.30769 22.1292C10.0769 20.523 10.9615 18.6612 10.9615 16.5439C10.9615 15.4487 10.5385 14.6091 9.6923 14.025C8.84615 13.4409 7.88462 12.8934 6.80769 12.3823C5.65385 11.8712 4.65385 11.1776 3.8077 10.3015C2.96154 9.42536 2.53846 8.14767 2.53846 6.46843C2.53846 4.42413 3.26923 2.8179 4.73077 1.64972C6.11538 0.554566 7.88462 0.00698554 10.0385 0.00698573Z" fill="#121212"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,5 @@
<svg width="68" height="60" viewBox="0 0 68 60" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M34 46.0156C32.8954 46.0156 32 46.9111 32 48.0156C32 49.1202 32.8954 50.0156 34 50.0156C35.1046 50.0156 36 49.1202 36 48.0156C36 46.9111 35.1046 46.0156 34 46.0156ZM40 48.0156C40 51.3293 37.3137 54.0156 34 54.0156C30.6863 54.0156 28 51.3293 28 48.0156C28 44.7019 30.6863 42.0156 34 42.0156C37.3137 42.0156 40 44.7019 40 48.0156Z" fill="#DD2127"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40 19.0156V34.0156C40 37.3293 37.3137 40.0156 34 40.0156C30.6863 40.0156 28 37.3293 28 34.0156V19.0156C28 15.7019 30.6863 13.0156 34 13.0156C37.3137 13.0156 40 15.7019 40 19.0156ZM36 19.0156V34.0156C36 35.1202 35.1046 36.0156 34 36.0156C32.8954 36.0156 32 35.1202 32 34.0156V19.0156C32 17.9111 32.8954 17.0156 34 17.0156C35.1046 17.0156 36 17.9111 36 19.0156Z" fill="#DD2127"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34 0.015625C35.4291 0.015625 36.7496 0.778021 37.4641 2.01562L67.4641 53.9771C68.1786 55.2148 68.1786 56.7395 67.4641 57.9771C66.7496 59.2148 65.4291 59.9771 64 59.9771H4C2.57094 59.9771 1.25043 59.2148 0.535898 57.9771C-0.178633 56.7395 -0.178633 55.2148 0.535898 53.9771L30.5359 2.01562C31.2504 0.778021 32.5709 0.015625 34 0.015625ZM34 4.01562L4 55.9771H64L34 4.01562Z" fill="#DD2127"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,5 @@
<svg width="68" height="68" viewBox="0 0 68 68" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M68 34C68 52.7777 52.7777 68 34 68C15.2223 68 0 52.7777 0 34C0 15.2223 15.2223 0 34 0C52.7777 0 68 15.2223 68 34ZM34 64C50.5685 64 64 50.5685 64 34C64 17.4315 50.5685 4 34 4C17.4315 4 4 17.4315 4 34C4 50.5685 17.4315 64 34 64Z" fill="#F3C81C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34 49C32.8954 49 32 49.8954 32 51C32 52.1046 32.8954 53 34 53C35.1046 53 36 52.1046 36 51C36 49.8954 35.1046 49 34 49ZM40 51C40 54.3137 37.3137 57 34 57C30.6863 57 28 54.3137 28 51C28 47.6863 30.6863 45 34 45C37.3137 45 40 47.6863 40 51Z" fill="#F3C81C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40 16V36C40 39.3137 37.3137 42 34 42C30.6863 42 28 39.3137 28 36V16C28 12.6863 30.6863 10 34 10C37.3137 10 40 12.6863 40 16ZM36 16C36 14.8954 35.1046 14 34 14C32.8954 14 32 14.8954 32 16V36C32 37.1046 32.8954 38 34 38C35.1046 38 36 37.1046 36 36V16Z" fill="#F3C81C"/>
</svg>

After

Width:  |  Height:  |  Size: 1021 B

@ -0,0 +1,18 @@
<svg width="68" height="68" viewBox="0 0 68 68" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M68 34C68 52.7777 52.7777 68 34 68C15.2223 68 0 52.7777 0 34C0 15.2223 15.2223 0 34 0C45.7745 0 56.1488 5.98866 62.245 15.0677C63.0245 16.2286 63.7345 17.4405 64.369 18.6976C64.8342 19.6192 65.2588 20.565 65.6404 21.5327C67.1646 25.3983 68 29.6064 68 34ZM34 64C50.5685 64 64 50.5685 64 34C64 30.1168 63.2622 26.406 61.9192 23C61.5828 22.1468 65 21.5327 63.5 18C61.9192 15.0677 58.9242 17.2975 58.9242 17.2975C53.5392 9.27772 44.3859 4 34 4C17.4315 4 4 17.4315 4 34C4 50.5685 17.4315 64 34 64Z" fill="url(#paint0_radial_11667_42358)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M65.5962 14.9038C68.1346 17.4422 68.1346 21.5578 65.5962 24.0962L62.7678 21.2678C63.7441 20.2915 63.7441 18.7085 62.7678 17.7322L65.5962 14.9038ZM35 36.3076L56.4038 14.9038C58.9422 12.3654 63.0578 12.3654 65.5962 14.9038L62.7678 17.7322C61.7915 16.7559 60.2085 16.7559 59.2322 17.7322L35 41.9645L22.2678 29.2322C21.2915 28.2559 19.7085 28.2559 18.7322 29.2322C17.7559 30.2085 17.7559 31.7915 18.7322 32.7678L33.2322 47.2678C34.2085 48.2441 35.7915 48.2441 36.7678 47.2678L62.7678 21.2678L65.5962 24.0962L39.5962 50.0962C37.0578 52.6346 32.9422 52.6346 30.4038 50.0962L15.9038 35.5962C13.3654 33.0578 13.3654 28.9422 15.9038 26.4038C18.4422 23.8654 22.5578 23.8654 25.0962 26.4038L35 36.3076Z" fill="url(#paint1_radial_11667_42358)"/>
<defs>
<radialGradient id="paint0_radial_11667_42358" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(68 3.53762e-06) rotate(135) scale(96.1665 131.292)">
<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_42358" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(68 3.53762e-06) rotate(135) scale(96.1665 131.292)">
<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,38 @@
<?php
function alerts_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['color'] = get_field('type');
$context['content'] = get_field('content');
Timber::render('modules/blog/editor-blocks/alerts/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_alerts',
'title' => __('GP - alerts'),
'description' => __('Alerts block'),
'render_callback' => 'alerts_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'alerts', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_alerts_style', get_template_directory_uri() . '/modules/blog/editor-blocks/alerts/assets/css/style.css', array(), '2.0', 'all');
}
));
}
});
?>

@ -0,0 +1,17 @@
<section class="alerts">
<div class="alerts-{{color}}">
{% if color == 'grey' %}
<img src="{{ template_path }}/modules/blog/editor-blocks/alerts/assets/img/icon-1.svg" alt="" class="icon-1">
{% elseif color == 'violet' %}
<img src="{{ template_path }}/modules/blog/editor-blocks/alerts/assets/img/icon-3.svg" alt="" class="icon-1">
{% elseif color == 'yellow' %}
<img src="{{ template_path }}/modules/blog/editor-blocks/alerts/assets/img/icon-4.svg" alt="" class="icon-1">
{% elseif color == 'green' %}
<img src="{{ template_path }}/modules/blog/editor-blocks/alerts/assets/img/icon-5.svg" alt="" class="icon-1">
{% endif %}
<p>{{content}}</p>
{% if color == 'grey' %}
<img src="{{ template_path }}/modules/blog/editor-blocks/alerts/assets/img/icon-2.svg" alt="" class="icon-2">
{% endif %}
</div>
</section>

@ -0,0 +1,176 @@
/* Article block */
.article-block__head {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
margin-bottom: 48px;
gap: 30px;
}
.article-block__head-left {
display: flex;
flex-direction: column;
gap: 23px;
}
.article-block__head-left h3 {
font-size: 24px;
font-weight: bold;
left: 28px;
text-transform: uppercase;
color: var(--grey-black);
}
.article-block__head-left p {
font-size: 24px;
font-weight: 500;
line-height: 32px;
color: var(--grey-black);
}
.article-block__head-right img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50px;
}
.article-block__item-wrap {
display: flex;
flex-direction: column;
gap: 72px;
}
.article-block__item {
display: flex;
align-items: stretch;
justify-content: space-between;
gap: 32px;
}
.article-block__item-content {
display: flex;
flex-direction: column;
width: 100%;
gap: 23px;
}
.article-block__item-content h3 {
font-size: 26px;
font-weight: bold;
color: var(--grey-black);
}
.article-block__item-content p {
font-size: 24px;
line-height: 32px;
font-weight: 500;
}
.article-block__item-content ul {
width: 100%;
background: var(--bg-light-grey);
border-radius: 24px;
display: flex;
align-items: center;
padding: 20px;
gap: 24px;
}
.article-block__item-content ul li {
display: flex;
align-items: center;
gap: 20px;
font-size: 20px;
line-height: 24px;
color: var(--grey-black);
}
.article-block__item-content ul li img {
flex-shrink: 0;
}
.article-block__item-img {
width: 315px;
flex-shrink: 0;
}
.article-block__item-img img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50px;
}
/* Article block end */
@media (max-width: 992px) {
.article-block__head {
grid-template-columns: repeat(1, minmax(0, 1fr));
gap: 32px;
}
.article-block__head-left {
order: 2;
}
.article-block__head-left h3 {
font-size: 20px;
line-height: 24px;
}
.article-block__head-left p {
font-size: 18px;
line-height: 24px;
}
.article-block__head-right {
order: 1;
height: 319px;
}
.article-block__item-wrap {
gap: 48px;
}
.article-block__item {
flex-direction: column;
gap: 32px;
}
.article-block__item-img {
order: 1;
width: 100%;
height: 450px;
border-radius: 50px;
}
.article-block__item-content {
order: 2;
}
.article-block__item-content h3 {
font-size: 20px;
line-height: 24px;
}
.article-block__item-content p {
font-size: 18px;
line-height: 24px;
}
.article-block__item-content ul {
flex-direction: column;
padding: 20px 14px 20px 20px;
gap: 28px;
border-radius: 24px;
}
.article-block__item-content ul li {
gap: 19px;
}
.article-block__item-content ul li p {
font-size: 16px;
line-height: 20px;
}
}

@ -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,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,41 @@
<?php
function block_img_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['order'] = get_field('order');
$context['shrink'] = get_field('shrink');
$context['img'] = get_field('img');
$context['plus_minus'] = get_field('plus_minus');
$context['content'] = get_field('content');
Timber::render('modules/blog/editor-blocks/block_img/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_block_img',
'title' => __('GP - block_img'),
'description' => __('block_img'),
'render_callback' => 'block_img_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'block_img', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_img_style', get_template_directory_uri() . '/modules/blog/editor-blocks/block_img/assets/css/style.css', array(), '2.0', 'all');
}
));
}
});
?>

@ -0,0 +1,49 @@
<section class="article-block">
{% if shrink %}
<div class="article-block__head">
{% if order %}
<div class="article-block__head-right">
<img src="{{img.url}}" alt="{{img.alt}}">
</div>
{% endif %}
<div class="article-block__head-left">
{{content}}
</div>
{% if not order %}
<div class="article-block__head-right">
<img src="{{img.url}}" alt="{{img.alt}}">
</div>
{% endif %}
</div>
{% else %}
<div class="article-block__item-wrap">
<div class="article-block__item">
{% if order %}
<div class="article-block__item-img">
<img src="{{img.url}}" alt="{{img.alt}}">
</div>
{% endif %}
<div class="article-block__item-content">
{{content}}
{% if plus_minus.plus %}
<ul>
<li>
<img src="{{ template_path }}/modules/blog/editor-blocks/block_img/assets/img/plus-icon.svg" alt="">
<p>{{ plus_minus.plus }}</p>
</li>
<li>
<img src="{{ template_path }}/modules/blog/editor-blocks/block_img/assets/img/minus-icon.svg" alt="">
<p>{{ plus_minus.minus }}</p>
</li>
</ul>
{% endif %}
</div>
{% if not order %}
<div class="article-block__item-img">
<img src="{{img.url}}" alt="{{img.alt}}">
</div>
{% endif %}
</div>
</div>
{% endif %}
</section>

@ -0,0 +1,56 @@
/* Diet */
.diet {
background: var(--violet_90);
border-radius: 32px;
padding: 36px 49px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 32px;
margin-bottom: 48px;
}
.diet p {
font-size: 24px;
font-weight: 500;
line-height: 32px;
color: var(--grey-black);
}
.diet a {
padding: 12px 24px;
text-align: center;
border: 1px solid var(--main_black);
background: var(--main_white);
border-radius: 20px;
font-size: 20px;
line-height: 24px;
font-weight: 600;
}
.diet a:hover {
background: var(--interface_title);
color: var(--main_white)
}
/* Diet end */
@media only screen and (max-width: 992px) {
.diet {
padding: 36px 24px;
border-radius: 32px;
flex-direction: column;
margin-bottom: 48px;
}
.diet p {
width: 100%;
font-size: 18px;
line-height: 24px;
}
.diet a {
width: 100%;
}
}

@ -0,0 +1,46 @@
<?php
function button_block_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['text'] = get_field('text');
$context['button'] = get_field('button');
$context['link'] = get_field('link');
$context['color'] = get_field('color');
Timber::render('modules/blog/editor-blocks/button_block/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_button_block',
'title' => __('GP - button_block'),
'description' => __('button_block block'),
'render_callback' => 'button_block_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'button_block', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_button_block_style', get_template_directory_uri() . '/modules/blog/editor-blocks/button_block/assets/css/style.css', array(), '2.0', 'all');
},
'supports' => array(
'align' => true,
'multiple' => true,
'jsx' => true,
'__experimentalInnerBlocks' => true, // Включение поддержки вложенных блоков
),
));
}
});
?>

@ -0,0 +1,4 @@
<section class="diet" {% if color %}style="background: {{color}}"{% endif %}>
<p>{{ text }}</p>
<a href="{{link}}">{{button}}</a>
</section>

@ -0,0 +1,16 @@
/* Product card */
.product-card {
display: flex;
align-items: center;
gap: 50px;
justify-content: center;
background: var(--blue_90);
padding: 32px;
border-radius: 50px;
}
.product-card img {
max-width: 740px;
max-height: 512px;
}
/* Product card end */

@ -0,0 +1,44 @@
<?php
function image_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['image'] = get_field('image');
$context['color'] = get_field('color');
Timber::render('modules/blog/editor-blocks/image/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_image',
'title' => __('GP - image'),
'description' => __('image block'),
'render_callback' => 'image_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'image', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_image_style', get_template_directory_uri() . '/modules/blog/editor-blocks/image/assets/css/style.css', array(), '2.0', 'all');
},
'supports' => array(
'align' => true,
'multiple' => true,
'jsx' => true,
'__experimentalInnerBlocks' => true, // Включение поддержки вложенных блоков
),
));
}
});
?>

@ -0,0 +1,3 @@
<section class="product-card" {% if color %}style="background: {{color}}"{% endif %}>
<img src="{{image.url}}" alt="{{image.alt}}">
</section>

@ -0,0 +1,24 @@
.list_v1 {
display: flex;
flex-direction: column;
gap: 32px;
}
.list_v1 li {
display: flex;
align-items: flex-start;
gap: 16px;
}
.list_v1 li h3 {
font-size: 26px;
font-weight: bold;
text-transform: uppercase;
color: var(--grey-black);
margin-bottom: 16px;
}
.list_v1 li img {
flex-shrink: 0;
max-width: 54px;
}

@ -0,0 +1,44 @@
<?php
function list_v1_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['list'] = get_field('list');
$context['icon'] = get_field('icon');
Timber::render('modules/blog/editor-blocks/list_v1/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_list_v1',
'title' => __('GP - list_v1'),
'description' => __('list_v1 block'),
'render_callback' => 'list_v1_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'list_v1', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_list_v1_style', get_template_directory_uri() . '/modules/blog/editor-blocks/list_v1/assets/css/style.css', array(), '2.0', 'all');
},
'supports' => array(
'align' => true,
'multiple' => true,
'jsx' => true,
'__experimentalInnerBlocks' => true, // Включение поддержки вложенных блоков
),
));
}
});
?>

@ -0,0 +1,10 @@
<ul class="list_v1">
{% for item in list %}
<li>
<img src="{{ icon.url }}" alt="{{ icon.alt }}">
<div>
{{ item.text }}
</div>
</li>
{% endfor %}
</ul>

@ -0,0 +1,34 @@
/* block_lists */
.block-lists {
margin: 48px 0;
display: flex;
flex-direction: column;
gap: 48px;
}
.block-list_block {
display: flex;
align-items: start;
gap: 25px;
}
.block-list_block img {
width: 145px;
flex-shrink: 0;
}
.block-list_block h3 {
font-size: 24px;
font-weight: 700;
line-height: 28px;
color: var(--main_black);
margin-bottom: 24px;
}
.block-list_block p {
font-size: 24px;
font-weight: 500;
line-height: 32px;
color: var(--main_black);
}
/* block_lists */

@ -0,0 +1,43 @@
<?php
function list_v2_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['list'] = get_field('list');
Timber::render('modules/blog/editor-blocks/list_v2/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_list_list_v2',
'title' => __('GP - list_v2'),
'description' => __('list_v2 block'),
'render_callback' => 'list_v2_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'list_v2', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_list_v2_style', get_template_directory_uri() . '/modules/blog/editor-blocks/list_v2/assets/css/style.css', array(), '2.0', 'all');
},
'supports' => array(
'align' => true,
'multiple' => true,
'jsx' => true,
'__experimentalInnerBlocks' => true, // Включение поддержки вложенных блоков
),
));
}
});
?>

@ -0,0 +1,10 @@
<section class="block-lists">
{% for item in list %}
<div class="block-list_block">
<img src="{{ item.icon.url }}" alt="{{ item.icon.alt }}">
<div class="block-lists_text">
{{ item.text }}
</div>
</div>
{% endfor %}
</section>

@ -0,0 +1,72 @@
.texts-swp {
position: relative;
}
.texts-swp__prev {
position: absolute;
z-index: 2;
top: 50%;
transform: translateY(-50%);
left: 10px;
background: var(--main_white);
width: 56px;
height: 56px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
}
.texts-swp__next {
position: absolute;
z-index: 2;
top: 50%;
transform: translateY(-50%);
right: 10px;
background: var(--main_white);
width: 56px;
height: 56px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
}
.texts-swp .swiper-slide img {
height: 517px;
width: 100%;
object-fit: cover;
border-radius: 50px;
}
/* .texts-swp .swiper-slide:not(.swiper-slide-active) {
height: 0;
overflow: hidden;
} */
.texts-swp__pagination {
position: absolute;
top: auto !important;
bottom: 20px !important;
right: auto;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
gap: 11px;
}
.texts-swp__pagination span {
opacity: 0.5;
background: var(--main_white);
width: 40px;
height: 6px;
border-radius: 6px;
margin: 0 !important;
padding: 0 !important;
}
.texts-swp__pagination span.swiper-pagination-bullet-active {
opacity: 1;
}

@ -0,0 +1,14 @@
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,
}
})

@ -0,0 +1,40 @@
<?php
function slider_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['gallery'] = get_field('gallery');
Timber::render('modules/blog/editor-blocks/swiper/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_slider',
'title' => __('GP - slider'),
'description' => __('Slider block'),
'render_callback' => 'slider_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'slider', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_script('layout-swiper-bundle.min-js',get_template_directory_uri() . '/modules/layout/assets/js/swiper-bundle.min.js', ['jquery'], '1.0', 'all');
wp_enqueue_script('gp_arcticle_slider_js',get_template_directory_uri() . '/modules/blog/editor-blocks/swiper/assets/js/script.js', ['jquery'], '1.0', 'all');
wp_enqueue_style('gp_slider_style', get_template_directory_uri() . '/modules/blog/editor-blocks/swiper/assets/css/style.css', array(), '2.0', 'all');
wp_enqueue_style('layout-swiper-bundle-css', get_template_directory_uri() . '/modules/layout/assets/css/swiper-bundle.css', array(), '1.0', 'all');
}
));
}
});
?>

@ -0,0 +1,18 @@
<div class="texts-swp">
<button class="texts-swp__prev">
<img src="{{ template_path }}/modules/blog/components/featured-slider/assets/img/swp-prev.svg" alt="">
</button>
<button class="texts-swp__next">
<img src="{{ template_path }}/modules/blog/components/featured-slider/assets/img/swp-next.svg" alt="">
</button>
<div class="texts-swp__pagination"></div>
<div class="swiper">
<div class="swiper-wrapper">
{% for slide in gallery %}
<div class="swiper-slide">
<img src="{{ slide.img.url }}" alt="{{ slide.img.alt }}">
</div>
{% endfor %}
</div>
</div>
</div> <div id="appointment" data-auth="ZpG3K" data-widgetUrl="https://tekhosmotr-ryadom.ru"></div>

@ -0,0 +1,87 @@
/* Article table */
.article-table__wrap {
background: var(--accent-3);
border-radius: 24px;
overflow: hidden;
padding: 2px;
margin-bottom: 48px;
}
.article-table {
background: var(--main_white);
border-radius: 22px;
overflow: hidden;
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 18px;
}
.article-table__item {
display: flex;
width: calc(100% / 3 - 36px / 3);
align-items: stretch;
border: 1px solid #E1E1E1;
text-align: center;
font-size: 20px;
line-height: 24px;
font-weight: 500;
}
.article-table__item ul {
width: 50%;
flex-shrink: 0;
}
.article-table__item li {
padding: 8px;
}
.article-table__item li:not(:last-child) {
border-bottom: 1px solid #E1E1E1;
}
.article-table__item li:first-child {
background: #E1E1E1;
}
.article-table__item ul:first-child li:first-child {
border-right: 1px solid var(--main_white);
}
.article-table__item ul:not(:last-child) li {
border-right: 1px solid #E1E1E1;
}
/* Article table end */
@media (max-width: 992px) {
.article-table {
flex-direction: column;
gap: 0px;
}
.article-table__item {
width: 100%;
}
.article-table__item:not(:first-child) li:first-child {
display: none;
}
.article-table__item:not(:first-child) {
border-top: 0;
}
.article-table__item ul li {
font-size: 16px;
line-height: 20px;
font-weight: 500;
}
.article-block__head {
grid-template-columns: repeat(1, minmax(0, 1fr));
gap: 32px;
}
}

@ -0,0 +1,36 @@
<?php
function table_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['content'] = get_field('content');
Timber::render('modules/blog/editor-blocks/table/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_table',
'title' => __('GP - table'),
'description' => __('table block'),
'render_callback' => 'table_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'table', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_table_style', get_template_directory_uri() . '/modules/blog/editor-blocks/table/assets/css/style.css', array(), '2.0', 'all');
}
));
}
});
?>

@ -0,0 +1,21 @@
<section class="article-table__wrap">
<div class="article-table">
{%for item in content %}
<div class="article-table__item">
<ul>
<li>{{ item.head_1 }}</li>
{% for c in item.table %}
<li>{{c.text_1}}</li>
{% endfor %}
</ul>
<ul>
<li>{{ item.head_2 }}</li>
{% for c in item.table %}
<li>{{c.text_2}}</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</section>

@ -20,24 +20,6 @@
text-transform: uppercase; text-transform: uppercase;
} }
.texts-description {
display: flex;
flex-direction: column;
gap: 48px;
}
.texts-description p {
color: var(--grey-black);
font-size: 24px;
line-height: 32px;
font-weight: 500;
}
.texts-description a {
display: inline;
text-decoration: underline;
}
.texts ol { .texts ol {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -46,15 +28,18 @@
line-height: 32px; line-height: 32px;
font-weight: 500; font-weight: 500;
color: #191919; color: #191919;
counter-reset: none;
} }
.texts ol li { .texts ol li {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 12px;
counter-increment: num;
} }
.texts ol h4 { .texts ol li::before {
content: counter(num);
background: var(--accent-1); background: var(--accent-1);
border-radius: 5.2px; border-radius: 5.2px;
width: 32px; width: 32px;
@ -96,6 +81,19 @@
} }
.texts p {
color: var(--grey-black);
font-size: 24px;
line-height: 32px;
font-weight: 500;
}
.texts a {
display: inline;
text-decoration: underline;
}
@media only screen and (max-width: 992px) { @media only screen and (max-width: 992px) {
.texts h2 { .texts h2 {

@ -25,7 +25,7 @@
'enqueue_assets' => function(){ 'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all'); wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all'); wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_texts_style', get_template_directory_uri() . '/modules/blog/editor-blocks/texts/assets/css/style.css', array(), '1.0', 'all'); wp_enqueue_style('gp_texts_style', get_template_directory_uri() . '/modules/blog/editor-blocks/texts/assets/css/style.css', array(), '2.0', 'all');
} }
)); ));
} }

@ -0,0 +1,5 @@
.video_block {
display: flex;
align-items: center;
justify-content: center;
}

@ -0,0 +1,43 @@
<?php
function video_render_callback($block, $content = '', $is_preview = false, $post_id = 0) {
$context = Timber::context();
$context['block'] = $block;
$context['is_preview'] = $is_preview;
$context['video'] = get_field('video');
Timber::render('modules/blog/editor-blocks/video/editor-block-template.twig', $context);
}
add_action('acf/init', function(){
if( function_exists('acf_register_block') ) {
// register a testimonial block
acf_register_block(array(
'name' => 'gp_video',
'title' => __('GP - video'),
'description' => __('video block'),
'render_callback' => 'video_render_callback',
'category' => 'formatting',
'icon' => 'admin-comments',
'keywords' => array( 'video', 'gp-block',),
'mode' => 'preview',
'enqueue_assets' => function(){
wp_enqueue_style('gp_util_style', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-core.css', array(), '1.0', 'all');
wp_enqueue_style('gp_normalize', get_template_directory_uri() . '/modules/layout/assets/css/gp-style-normalize.css', array(), '1.0', 'all');
wp_enqueue_style('gp_video_style', get_template_directory_uri() . '/modules/blog/editor-blocks/video/assets/css/style.css', array(), '2.0', 'all');
},
'supports' => array(
'align' => true,
'multiple' => true,
'jsx' => true,
'__experimentalInnerBlocks' => true, // Включение поддержки вложенных блоков
),
));
}
});
?>

@ -20,7 +20,7 @@ class BlogPost extends \Timber\Post
$minutes = round($symb / $symb_per_minute); $minutes = round($symb / $symb_per_minute);
/* translators: %s: Time duration in minute or minutes. */ /* translators: %s: Time duration in minute or minutes. */
return sprintf(_n('%s мин.', '%s мин.', $minutes), (int) $minutes); return sprintf(_n('%s ' . pll__('мин.'), '%s ' . pll__('мин.'), $minutes), (int) $minutes);
} }
} }

@ -0,0 +1,12 @@
<?php
add_shortcode( 'intend_open', 'intend_open' );
function intend_open( $atts ){
$context = Timber::get_context();
$context['color'] = $atts['color'];
return \Timber\Timber::compile( 'blog/shortcodes/intend/shortcode.twig', $context );
}
?>

@ -0,0 +1 @@
<section class="indent" {% if color %}style="background:{{color}}"{% endif %}>

@ -0,0 +1,10 @@
<?php
add_shortcode( 'intend_close', 'intend_close' );
function intend_close( $atts ){
return \Timber\Timber::compile( 'blog/shortcodes/intend_close/shortcode.twig');
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

@ -0,0 +1,10 @@
<?php
add_shortcode( 'subs_form', 'subs_form' );
function subs_form( $atts ){
return \Timber\Timber::compile( 'blog/shortcodes/subs_form/shortcode.twig');
}
?>

@ -0,0 +1,17 @@
<!-- Discount -->
{% set current_path = '/wp-content/themes/cosmopet/modules/blog/shortcodes/subs_form' %}
<section class="discount form-process">
<h2 class="discount-title">{{ function('pll_e', 'Узнайте о нас больше и получите <span>скидку!</span>') }}</h2>
<img src="{{ current_path }}/assets/img/discount-bg.png" alt="" class="discount-bg">
<img src="{{ current_path }}/assets/img/discount-bg-sm.png" alt="" class="discount-bg mb">
<form action="" class="discount-form">
<input type="email" placeholder="{{ function('pll_e', 'Эл.почта') }}">
<img src="assets/img/long-arrow.svg" alt="">
<button type="submit">{{ function('pll_e', 'подписаться') }}</button>
</form>
<div class="discount-descriptions">
<p class="discount-description__1">{{ function('pll_e', 'Подписываясь на рассылку, я даю согласие на обработку персональных данных, на получение рекламных сообщений и новостей о товарах и услугах') }} </p>
<p class="discount-description__2">{{ function('pll_e', 'Подпишитесь, чтобы быть в курсе деятельности Cosmopet и узнавать о наших, предложениях. Обещаем не заваливать вас бесполезными письмами. А за подписку дарим -25% на весь ассортимент нашей продукции', 'Подпишитесь, чтобы быть в курсе деятельности Cosmopet и узнавать о наших предложениях. Обещаем не заваливать вас бесполезными письмами. А за подписку дарим -25% на весь ассортимент нашей продукции') }}</p>
</div>
</section>
<!-- Discount end -->

@ -1,4 +0,0 @@
<!-- Подключаем хуки ajax_wp стандартным способом
данный файл подключается только при ajax запросах на сервер
поэтому не нужно использовать его для хранени
функций используемых вне ajax логики -->

@ -1,3 +1,14 @@
<?php <?php
add_filter('timber/context', function($context) {
$context['email_list'] = get_field('email_list', 'options');
$context['adres'] = get_field('adres', 'options');
$context['social'] = get_field('social', 'options');
$context['links'] = get_field('links', 'options');
return $context;
});
?> ?>

@ -9,59 +9,43 @@
<span>сosmopet</span> <span>сosmopet</span>
</a> </a>
<p class="footer-content__address"> <p class="footer-content__address">
123182 г. Москва, <br> {{adres}}
4-й Красногорский пр., <br>
д. 2/4, стр. 1, этаж/ком. 3/1
</p> </p>
<ul> <ul>
{% for item in email_list %}
<li> <li>
<p>Отзывы и предложения</p> <p>{{item.name}}</p>
<a href="mailto:pro@cosmopet.shop" target="_blank">pro@cosmopet.shop</a> <a href="mailto:{{item.email}}">{{item.email}}</a>
</li>
<li>
<p>Заявки для оптовых покупателей</p>
<a href="mailto:pro@cosmopet.shop" target="_blank">pro@cosmopet.shop</a>
</li>
<li>
<p>Связь с ветеринаром</p>
<a href="mailto:vetvopros@cosmopet.shop" target="_blank">vetvopros@cosmopet.shop</a>
</li> </li>
{% endfor %}
</ul> </ul>
</div> </div>
<div class="footer-top__link"> <div class="footer-top__link">
<a href="#" class="link-black">Чат бот с ветеринаром</a> <a href="#" class="link-black">{{ function('pll_e', 'Чат бот с ветеринаром') }}</a>
<a href="#" class="link-white">Калькулятор рациона</a> <a href="#" class="link-white">{{ function('pll_e', 'Калькулятор рациона') }}</a>
</div> </div>
</div> </div>
<form class="footer-contact"> <form class="footer-contact form-process">
<h3 class="footer-contact__title">Форма обратной связи</h3> <h3 class="footer-contact__title">{{ function('pll_e', 'Форма обратной связи') }}</h3>
<input type="text" placeholder="Ваше имя" class="form-inp"> <input type="text" placeholder="{{ function('pll_e', 'Ваше имя') }}" class="form-inp">
<input type="email" placeholder="Эл.почта" class="form-inp"> <input type="email" placeholder="{{ function('pll_e', 'Эл.почта') }}" class="form-inp">
<textarea class="form-textarea" name="" placeholder="Текст обращения" id=""></textarea> <textarea class="form-textarea" name="" placeholder="{{ function('pll_e', 'Текст обращения') }}" id=""></textarea>
<button class="footer-contact__submit" type="submit">Отправить</button> <button class="footer-contact__submit" type="submit">{{ function('pll_e', 'Отправить') }}</button>
</form> </form>
</div> </div>
<div class="footer-bottom"> <div class="footer-bottom">
<ul class="footer-network"> <ul class="footer-network">
{% for item in social %}
<li> <li>
<a href="#"> <a href="{{item.link}}" target="_blank">
<img src="{{ current_path }}/assets/img/footer-network-1.svg" alt=""> <img src="{{item.img}}">
</a>
</li>
<li>
<a href="#">
<img src="{{ current_path }}/assets/img/footer-network-2.svg" alt="">
</a>
</li>
<li>
<a href="#">
<img src="{{ current_path }}/assets/img/footer-network-3.svg" alt="">
</a> </a>
</li> </li>
{% endfor %}
</ul> </ul>
<a href="#">Соглашение о конфиденциальности</a> {% for item in links %}
<a href="#">Декларация соответствия корма</a> <a href="{{item.link}}">{{item.name}}</a>
<a href="#">Декларация соответствия лакомств</a> {% endfor %}
</div> </div>
</div> </div>
</footer> </footer>

@ -0,0 +1,19 @@
jQuery(document).ready(function($) {
$('.form-process').submit(function(event) {
event.preventDefault();
let formData = $(this).serialize();
$.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: {
action: 'process_form',
formData: formData
},
success: function(response) {
alert(response.message);
}
});
});
});

@ -0,0 +1,21 @@
<?php
require_once 'module-controller.php';
add_action('wp_ajax_process_form', 'process_form');
add_action('wp_ajax_nopriv_process_form', 'process_form');
function process_form() {
$formData = $_POST['formData'];
// Получаем обработчик с цепочкой декораторов
$handler = FormHandlerFactory::getHandler();
// Обрабатываем форму (отправляем в несколько сервисов)
$response = $handler->handle($formData);
wp_send_json($response);
}
?>

@ -0,0 +1,72 @@
<?php
abstract class FormHandler {
protected $nextHandler;
public function __construct($nextHandler = null) {
$this->nextHandler = $nextHandler;
}
public function handle($data) {
if ($this->nextHandler) {
return $this->nextHandler->handle($data);
}
return ['success' => true, 'message' => 'Форма обработана'];
}
}
class b24Handler extends FormHandler {
public function handle($data) {
// Логика отправки в Mailchimp
error_log("Отправка в b24: " . json_encode($data));
// Вызываем следующий обработчик в цепочке
return parent::handle($data);
}
}
class zohoHandler extends FormHandler {
public function handle($data) {
// Логика отправки в HubSpot
error_log("Отправка в Zoho: " . json_encode($data));
return parent::handle($data);
}
}
class mindboxHandler extends FormHandler {
public function handle($data) {
// Отправка в стандартный обработчик (например, email)
error_log("Отправка в mindBox: " . json_encode($data));
return parent::handle($data);
}
}
class emailHandler extends FormHandler {
public function handle($data) {
$to = 'fcs.andrew@gmail.com';
$subject = 'Test Email';
$message = json_encode($data, JSON_PRETTY_PRINT); // Преобразуем данные в строку
$headers = ['Content-Type: text/plain; charset=UTF-8'];
wp_mail($to, $subject, $message, $headers);
return parent::handle($data);
}
}
class FormHandlerFactory {
public static function getHandler() {
// Базовый обработчик
$handler = new emailHandler();
// Добавляем в цепочку обработчиков
$handler = new mindboxHandler($handler);
$handler = new zohoHandler($handler);
$handler = new b24Handler($handler);
return $handler;
}
}
?>

@ -1,87 +1,740 @@
/* Header */ .main-menu{
.header { display: flex;
background: var(--main_white); align-items: center;
border-bottom: 1px solid var(--interface_title);
position: fixed; list-style-type: none;
top: 0; margin-bottom: 0;
left: 0; }
width: 100%; .main-menu li{
z-index: 4; margin-bottom: 0;
} }
.lang p{
margin-bottom: 0;
}
.main-menu__item{
margin-left: 24px;
transition: opacity .2s ease-out;
}
.main-menu__item:first-child{
margin-left: 0;
}
.main-menu__item:hover{
opacity: .8;
background: #f2f2f2;
border-radius: 24px;
}
.header.white .main-menu__item:hover .main-menu__link{
color: #000
}
.main-menu__item:active{
opacity: 1;
}
.main-menu__link{
display: block;
padding: 8px 12px;
font-family: var(--font-family);
font-weight: 700;
font-size: 16px;
line-height: 125%;
color: #000
text-decoration: none;
transition: color .2s ease-out;
}
.main-menu__button{
padding: 8px 32px 8px 12px;
font-family: var(--font-family);
font-weight: 700;
font-size: 16px;
line-height: 125%;
color: #000
border: none;
border-radius: 24px;
background: var(--gradient-turquoise);
position: relative;
}
.main-menu__button::before{
content: '';
position: absolute;
top: 14px;
right: 14px;
width: 13px;
height: 8px;
background-image: url(../img/arrow-black.svg);
background-repeat: no-repeat;
background-size: contain;
}
.header-container { /* lang*/
.lang{
position: relative;
}
.lang__open{
padding: 12px 15px;
width: 74px;
background: none;
border: none;
display: flex;
align-items: center;
transition: opacity .2s ease-out;
}
.lang__open:hover{
opacity: .8;
}
.lang-open p{
font-family: var(--font-family);
font-weight: 700;
font-size: 16px;
line-height: 125%;
text-align: start;
color: #000
}
.lang-open__arrow{
margin-left: 7.25px;
display: flex;
justify-content: center;
align-items: center;
}
.lang-open__black{
}
.lang-open__white{
display: none;
}
.lang__content{
position: absolute;
top: 33px;
left: -13px;
height: 0;
border-radius: 6px;
transition: height .2s ease-out;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.1), 0 0 2px 0 rgba(0, 0, 0, 0.2);
overflow: hidden;
background-color: #fff;
z-index: 100;
}
.lang__list{
width: 104px;
padding: 8px;
list-style-type: none;
}
.lang-item{
margin-top: 8px;
}
.lang-item:first-child{
margin-top: 0;
}
.lang-item a{
display: block;
width: 100%;
text-transform: uppercase;
padding: 4px;
border-radius: 6px;
font-family: var(--font-family);
font-weight: 400;
font-size: 20px;
line-height: 120%;
color: var(--text-dark);
text-decoration: none;
position: relative;
transition: background-color .2s ease-out;
}
.lang-item a:hover,
.lang-item.current-lang a{
background-color: var(--background-grey);
}
.lang-item.current-lang a::before{
content: '';
position: absolute;
top: 10px;
right: 8px;
width: 16px;
height: 12px;
background-image: url(../img/arrow-selected.svg);
}
/* lang */
/* mini-profile */
.mini-profile{
display: flex;
align-items: center;
}
.mini-profile__item{
margin-left: 8px;
}
.mini-profile__item:first-child{
margin-left: 0;
}
.mini-profile__button{
display: block;
padding: 8px;
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
justify-content: space-between;
padding: 16px 0; background: none;
border: none;
transition: opacity .2s ease-out;
}
.mini-profile__button:hover{
opacity: .8;
}
.mini-profile__icon{
width: 24px;
aspect-ratio: 1;
}
.mini-profile__icon.white{
display: none;
}
/* mini-profile */
/* header start */
.header{
position: relative;
background-color: #fff;
position: fixed;
left: 0;
top: 0;
right: 0;
z-index: 200;
} }
.header::after{
content: '';
position: absolute;
left: auto;
right: auto;
bottom: 0;
width: 100%;
height: 1px;
background: var(--text-3);
.header-bars {
display: none;
} }
.header-logo { .header__content{
display: flex; height: 72px;
align-items: center;
gap: 8px; padding: 14px 24px;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
z-index: 101;
} }
.header-logo span { .header__open-menu{
color: var(---main_black); display: none;
font-size: 20px;
text-transform: uppercase; width: 24px;
aspect-ratio: 1;
position: relative;
border: none;
background: none;
} }
.header__open-menu::before{
content: '';
position: absolute;
top: 8px;
left: 4px;
width: 16px;
height: 2px;
background: #000;
border-radius: 1px;
.header-navs {
display: flex;
align-items: center;
gap: 24px;
} }
.header__open-menu::after{
content: '';
.header-navs__link { position: absolute;
padding: 8px 12px; left: 4px;
font-size: 16px; bottom: 8px;
font-weight: bold;
text-transform: uppercase; width: 16px;
line-height: 20px; height: 2px;
background: #000;
border-radius: 1px;
} }
.header-accordion {} .header__logo{
width: 182px;
height: 40px;
}
.header__logo-black,
.header__logo-white{
width: 100%;
height: 100%;
}
.header__logo-white{
display: none;
}
.header-accordion__btn { .header__menu-block{
display: flex; position: absolute;
align-items: center; top: 72px;
gap: 4px; left: 0;
padding: 8px 12px;
border-radius: 24px; width: 100%;
background: var(--accent-2); height: 0;
cursor: pointer;
user-select: none; overflow: hidden;
font-size: 16px; transition: height .2s ease-out;
font-weight: bold;
line-height: 20px; background-color: #fff;
color: var(---main_black);
z-index: 100;
} }
.header-right { .header__pc-menu{
display: flex; padding: 40px 46px;
align-items: center;
gap: 8px; display: flex;
justify-content: center;
position: relative;
}
.header__pc-menu::before{
content: '';
position: absolute;
bottom: 0;
left: 46px;
width: 330px;
height: 248px;
background-image: url(../img/cat.png);
background-repeat: no-repeat;
}
.header__pc-menu::after{
content: '';
position: absolute;
bottom: 0;
right: 46px;
width: 330px;
height: 248px;
background-image: url(../img/dog.png);
background-repeat: no-repeat;
}
.header-pc-menu__content{
width: 600px;
display: flex;
justify-content: space-between;
} }
.header-pc-menu__item{
}
.header-pc-menu__title{
font-family: var(--font-family);
font-weight: 700;
font-size: 26px;
line-height: 123%;
text-transform: uppercase;
color: #000
text-decoration: none;
}
.header-pc-menu__list{
margin-top: 16px;
list-style-type: none;
padding-left: 0;
}
.header-pc-menu__list-li{
margin-top: 25px;
margin-bottom: 0;
}
.header-pc-menu__list-li:first-child{
margin-top: 0;
}
.header-pc-menu__list-li a{
font-family: var(--font-family);
font-weight: 600;
font-size: 20px;
line-height: 120%;
color: var(--text-0);
text-decoration: none;
}
.header__phone-menu{
display: none;
padding: 24px 16px;
.header-lang__btn { height: calc(100vh - 56px);
overflow-x: auto;
}
.header-phone-menu__item{
padding: 16px 0;
border-top: 1px solid #f4f1f0;
border-bottom: 1px solid #f4f1f0;
display: flex;
flex-direction: column;
}
.header-phone-menu__item:first-child{
border-top: 0;
}
.header-phone-menu__item:last-child{
border-bottom: 0;
}
.header-phone-menu__title{
font-family: var(--font-family);
font-weight: 700;
font-size: 20px;
line-height: 120%;
color: #000
text-decoration: none;
}
.header-phone-menu__title--gradient{
background: var(--gradient-blue);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.header-phone-menu__category{
margin-top: 16px;
font-family: var(--font-family);
font-weight: 500;
font-size: 18px;
line-height: 133%;
color: #000
text-decoration: none;
}
.header-phone-menu__list{
margin-top: 24px;
padding-left: 32px;
list-style-type: none;
}
.header-phone-menu__list-item{
margin-top: 16px;
}
.header-phone-menu__list-item:first-child{
margin-top: 0;
}
.header-phone-menu__list-item a{
font-family: var(--font-family);
font-weight: 500;
font-size: 16px;
line-height: 125%;
color: #121212;
color: #000
text-decoration: none;
}
.header.white{
background: none;
}
.header.white .header__logo-black{
display: none;
}
.header.white .header__logo-white{
display: block;
}
.header.white .main-menu__link{
color: #fff;
}
.header.white .main-menu__button{
background: #fff;
}
.header.white .lang__open{
color: #fff;
}
.header.white::after{
background: #fff;
}
.header.white .lang-open__black{
display: none;
}
.header.white .lang-open__white{
display: block;
}
.header.white .mini-profile__icon.white{
display: block;
}
.header.white .mini-profile__icon.black{
display: none;
}
.header.white .header__open-menu::before,
.header.white .header__open-menu::after{
background: #fff;
}
.header__phone-menu::-webkit-scrollbar {
width: 0px;
}
main{
padding-top: 72px;
}
.modal__login {
width: 412px;
}
.login_back {
position: absolute;
top: 24px;
left: 24px;
cursor: pointer;
}
.login_wrap {
height: 100%;
}
.login_wrap.hide {
display: none;
}
.login_inner {
display: none;
margin-top: 128px;
}
.login_inner.active {
display: block;
}
.login_title {
color: #121212;
font-size: 24px;
line-height: 28px;
text-transform: uppercase;
}
.login_subtitle {
color: #575775;
font-size: 20px;
line-height: 24px;
margin-top: 16px;
}
.login_subtitle span {
display: block;
margin-top: 8px;
}
.login_input {
margin-top: 40px;
}
.login_input.error input {
border-color: #FA0505;
}
.login_error {
font-size: 12px;
line-height: 16px;
color: #FA0505;
display: none;
}
.login_input.error .login_error {
display: block;
}
.login_input input {
border: 1px solid #999999;
color: #999999;
border-radius: 20px;
padding: 12px 16px;
width: 100%;
font-size: 20px;
line-height: 24px;
}
.login_btn {
padding: 12px 24px;
border-radius: 20px;
display: block;
width: 100%;
height: 54px;
text-transform: none;
font-size: 20px;
line-height: 24px;
text-align: center;
}
.login_btn.btn_gradient {
margin-top: 24px;
background: radial-gradient(100% 174.56% at 100% 0%, #7AD9E7 0%, #7EE7E1 25%, #B5E4B4 80%, #D7EEAA 100%);
}
.login_btn.account_link {
background: #121212;
color: #fff;
}
.login_privacy {
font-size: 12px;
line-height: 16px;
color: #333333;
position: absolute;
bottom: 24px;
left: 24px;
right: 24px;
}
.login_privacy a {
color: #333333;
text-decoration: underline;
}
.login_inner.step_2 .login_subtitle,
.login_success .login_subtitle,
.login_auth .login_subtitle {
color: #121212;
}
.login_timer {
font-size: 20px;
line-height: 24px;
margin-top: 24px;
color: #121212;
}
.js-repeat-code {
display: none;
}
.login_success img {
margin: 40px 0;
}
/*
.wptelegram-login-output-wrap.container {
position: relative;
}
.wptelegram-login-output-wrap.container:after {
content: 'Войти через Telegram';
position: absolute;
left: 0;
background: radial-gradient(100% 174.56% at 100% 0%, #7AD9E7 0%, #7EE7E1 25%, #B5E4B4 80%, #D7EEAA 100%);
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
width: 100%;
height: 54px;
top: 0;
border-radius: 20px;
font-weight: var(--btn-font-weight);
font-family: var(--btn-font-family);
font-style: var(--btn-font-style);
font-size: 20px;
line-height: 24px;
cursor: pointer; cursor: pointer;
user-select: none;
gap: 4px;
padding: 12px 15px;
color: var(---main_black);
font-size: 16px;
font-weight: bold;
line-height: 20px;
} }
*/
.wptelegram-login-output-wrap {
display: flex;
margin-top: 15px;
justify-content: center;
}
@media(max-width: 480px) {
.modal__login {
width: 100%;
}
.login_title {
font-size: 19px;
line-height: 24px;
}
}
/* header end */
/* Header end */
/* Стили для планшетов */
@media only screen and (max-width: 1200px) {
/* header */
main{
padding-top: 64px;
}
.main-menu{
display: none;
}
.header__open-menu{
display: block;
}
.lang{
display: none;
}
.header__logo{
width: 136px;
height: 29px;
}
.header__content{
height: auto;
padding: 8px 16px;
}
.mini-profile__item:nth-child(2){
margin-left: 0;
}
.header::after{
left: 0;
width: 100%;
}
.header__pc-menu{
display: none;
}
.header__phone-menu{
display: block;
}
.header__menu-block{
top: 56px;
}
.header__content::after{
left: 0;
right: 0;
width: 100%;
}
/* header */
}
@media only screen and (max-width: 720px) {
}

@ -0,0 +1,3 @@
<svg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.46967 0.46967C0.762563 0.176777 1.23744 0.176777 1.53033 0.46967L5 3.93934L8.46967 0.46967C8.76256 0.176777 9.23744 0.176777 9.53033 0.46967C9.82322 0.762563 9.82322 1.23744 9.53033 1.53033L5.53033 5.53033C5.23744 5.82322 4.76256 5.82322 4.46967 5.53033L0.46967 1.53033C0.176777 1.23744 0.176777 0.762563 0.46967 0.46967Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 493 B

@ -0,0 +1,11 @@
<svg width="16" height="12" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.7071 0.292893C16.0976 0.683417 16.0976 1.31658 15.7071 1.70711L5.70711 11.7071C5.31658 12.0976 4.68342 12.0976 4.29289 11.7071L0.292893 7.70711C-0.0976311 7.31658 -0.0976311 6.68342 0.292893 6.29289C0.683417 5.90237 1.31658 5.90237 1.70711 6.29289L5 9.58579L14.2929 0.292893C14.6834 -0.0976311 15.3166 -0.0976311 15.7071 0.292893Z" fill="url(#paint0_radial_79_10214)" />
<defs>
<radialGradient id="paint0_radial_79_10214" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(23.9562 -7.00625) rotate(143.344) scale(34.5677 45.2811)">
<stop stop-color="#0F5881" />
<stop offset="0.512169" stop-color="#1EA49C" />
<stop offset="0.807073" stop-color="#76CE75" />
<stop offset="0.911458" stop-color="#ECF39F" />
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

@ -0,0 +1,151 @@
'use strict';
// function
function modalOpen(buttonElement, contentElement){
let modal = document.querySelector('.modal'),
aside = document.querySelector('.modal__aside'),
elements = document.querySelectorAll(buttonElement),
device = window.screen.width;
elements.forEach(e => {
let thisContentElement = document.querySelector(contentElement);
e.onclick = function () {
modal.classList.add('active');
thisContentElement.classList.add('active');
let width = thisContentElement.clientWidth;
setTimeout(() => {
if (device <= 720) {
aside.style.width = `${device}px`;
thisContentElement.style.opacity = 1;
thisContentElement.style.filter = 'blur(0px)';
}else{
aside.style.width = `${width}px`;
thisContentElement.style.opacity = 1;
thisContentElement.style.filter = 'blur(0px)';
}
}, 10);
}
})
}
function modalClose(buttonElement) {
let modal = document.querySelector('.modal'),
aside = document.querySelector('.modal__aside'),
asideItems = document.querySelectorAll('.modal__item'),
elements = document.querySelectorAll(buttonElement);
elements.forEach(e => {
e.onclick = function () {
aside.style.width = '0px';
asideItems.forEach(e => {
if (e.classList.contains('active')) {
e.style.filter = 'blur(10px)';
}
});
setTimeout(() => {
asideItems.forEach(e => {
if (e.classList.contains('active')) {
e.classList.remove('active');
}
});
modal.classList.remove('active');
}, 300);
}
})
}
function toggleOpenX(mainElement, buttonElement ,heightElement, contentElement, close) {
let elements = document.querySelectorAll(mainElement);
elements.forEach(e => {
let thisMainElement = e,
thisButtonElement = e.querySelector(buttonElement),
thisHeightElement = e.querySelector(heightElement),
thisContentElement = e.querySelector(contentElement);
thisButtonElement.onclick = function (e) {
let height = thisHeightElement.clientHeight;
if (close == true && !thisMainElement.classList.contains('active')) {
elements.forEach(e => {
if (e.classList.contains('active')) {
e.classList.remove('active');
e.querySelector(contentElement).style.height = null
}
})
}
if (!thisMainElement.classList.contains('active')) {
thisContentElement.style.height = `${height}px`;
thisMainElement.classList.add('active');
}else{
thisContentElement.style.height = null;
thisMainElement.classList.remove('active');
}
}
});
}
var menu_opened = false;
function toggleHeader(button, content, blockheight, removeBlock, removeClass) {
let thisButton = document.querySelector(button),
thisContent = document.querySelector(content),
thisRemoveBlock = document.querySelector(removeBlock) || '',
thisBlockheight = document.querySelector(blockheight);
thisButton.onclick = function () {
let height = thisBlockheight.clientHeight;
if (!thisContent.classList.contains('open')) {
thisContent.style.height = `${height}px`;
thisContent.classList .add('open');
if (removeBlock) {
thisRemoveBlock.classList.remove(removeClass);
}
}else{
thisContent.style.height = null;
thisContent.classList.remove('open');
if (removeBlock) {
if (window.Y <= 25) {
thisRemoveBlock.classList.add(removeClass);
}
}
}
menu_opened = !menu_opened;
}
}
if (document.querySelector('.header').classList.contains('white')) {
window.addEventListener("scroll", function (e) {
let header = document.querySelector('.header');
let scroll = window.scrollY;
if(!menu_opened){
if (scroll >= 25) {
header.classList.remove('white')
}else{
header.classList.add('white')
}
}
});
}
toggleOpenX('.lang', '.lang__open', '.lang__list', '.lang__content', false);
toggleHeader('#pc-menu','.header__menu-block','.header__pc-menu', '.white', 'white');
toggleHeader('#phone-menu','.header__menu-block','.header__phone-menu', '.white', 'white');
// scroll

@ -1,46 +0,0 @@
{% set current_path = template_path ~ '/modules/header' %}
<header class="header">
<div class="container header-container">
<button class="header-bars">
<img src="{{ current_path }}/assets/img/bars.svg" alt="">
</button>
<a href="/" class="header-logo">
<img src="{{ current_path }}/assets/img/logo.svg" alt="">
<span>сosmopet</span>
</a>
<ul class="header-navs">
<li>
<a href="#" class="header-navs__link">ГЛАВНАЯ</a>
</li>
<li>
<a href="#" class="header-navs__link">О COSMOPET</a>
</li>
<li>
<a href="#" class="header-navs__link">ПРОИЗВОДСТВО</a>
</li>
<li>
<a href="#" class="header-navs__link">БЛОГ</a>
</li>
<li class="header-accordion">
<div class="header-accordion__btn">
<span>ПРОДУКЦИЯ</span>
<img src="{{ current_path }}/assets/img/arrow-down.svg" alt="">
</div>
</li>
</ul>
<div class="header-right">
<div class="header-lang">
<div class="header-lang__btn">
<span>RU</span>
<img src="{{ current_path }}/assets/img/arrow-down.svg" alt="">
</div>
</div>
<a href="#">
<img src="{{ current_path }}/assets/img/user-icon.svg" alt="">
</a>
<a href="#">
<img src="{{ current_path }}/assets/img/basket-icon.svg" alt="">
</a>
</div>
</div>
</header>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -117,3 +117,23 @@ body {
.form-textarea:focus { .form-textarea:focus {
border-color: var(--main_black); border-color: var(--main_black);
} }
.article-container{
gap: 40px;
display: flex;
flex-direction: column;
}
.indent h2 {
max-width: 661px;
font-size: 36px;
line-height: 40px;
font-weight: bold;
text-transform: uppercase;
color: var(--grey-black);
}
textarea{
font-family: inherit;
}

@ -1,4 +1,5 @@
<?php <?php
include_module('header'); include_module('header');
include_module('footer'); include_module('footer');

@ -19,9 +19,14 @@
<body> <body>
<div class="wrapper">
{% if current_lang == 'en' %}
{% include 'header/module.template.twig' %} {% include 'header/module.template_ENG.twig' %}
{% elseif current_lang == 'fr' %}
{% else %}
{% include 'header/module.template_RU.twig' %}
{% endif %}
<main> <main>
{% block content %} {% block content %}

@ -0,0 +1,154 @@
/* Footer */
.footer {
background: var(--main_black);
padding: 40px 0 38px;
color: var(--main_white);
}
.footer-top {
display: flex;
align-items: stretch;
justify-content: space-between;
gap: 48px;
}
.footer-top .logo {
display: flex;
align-items: center;
gap: 10px;
font-size: 20px;
font-weight: 500;
text-transform: uppercase;
background: var(--accent-1);
color: transparent;
-webkit-background-clip: text;
background-clip: text;
margin-bottom: 24px;
}
.footer-content__address {
font-size: 24px;
font-weight: 500;
line-height: 32px;
margin-bottom: 32px;
}
.footer-content {
width: 100%;
}
.footer-content ul {
display: flex;
flex-direction: column;
gap: 24px;
}
.footer-content ul li {
display: flex;
flex-direction: column;
gap: 4px;
}
.footer-content ul p {
font-size: 16px;
font-weight: bold;
line-height: 20px;
}
.footer-content ul a {
font-size: 24px;
font-weight: 500;
line-height: 32px;
}
.footer-content__wrap {
display: flex;
align-items: flex-end;
justify-content: space-between;
width: 100%;
}
.footer-top__link {
display: flex;
flex-direction: column;
gap: 24px;
}
.footer-top__link .link-black {
padding: 7px 15px;
color: var(--main_white);
font-size: 24px;
line-height: 32px;
font-weight: 500;
white-space: nowrap;
border: 1px solid var(--main_white);
border-radius: 24px;
}
.footer-top__link .link-white {
width: 100%;
text-align: center;
background: var(--main_white);
color: var(--main_black);
font-size: 20px;
font-weight: 600;
line-height: 24px;
padding: 12px;
border-radius: 20px;
}
.footer-contact {
width: 364px;
flex-shrink: 0;
background: var(--accent-1);
border-radius: 24px;
padding: 24px;
display: flex;
flex-direction: column;
gap: 16px;
}
.footer-contact__title {
color: var(--main_black);
font-size: 24px;
font-weight: 500;
line-height: 32px;
}
.footer-contact__submit {
width: 100%;
text-align: center;
height: 48px;
border-radius: 16px;
background: var(--main_black);
font-size: 20px;
font-weight: 600;
line-height: 24px;
color: var(--main_white);
}
.footer-bottom {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 17px;
margin-top: 19px;
border-top: 1px solid var(--main_white);
}
.footer-network {
display: flex;
align-items: center;
gap: 32px;
}
.footer-bottom a {
font-size: 16px;
line-height: 20px;
font-weight: 500;
color: var(--main_white);
opacity: 0.6;
text-decoration: underline;
}
/* Footer end */

@ -0,0 +1,68 @@
/* Стили для мобильных устройств */
@media only screen and (max-width: 576px) {
.footer {
padding: 24px 0 58px;
}
.footer-top {
align-items: flex-start;
text-align: left;
gap: 24px;
}
.footer-content__wrap {
align-items: flex-start;
gap: 24px;
}
.footer-content {
align-items: flex-start;
}
.footer-content .logo {
font-size: 20px;
margin-bottom: 24px;
}
.footer-content__address {
font-size: 18px;
line-height: 24px;
margin-bottom: 32px;
}
.footer-content ul {
gap: 24px;
}
.footer-content ul p {
font-size: 16px;
line-height: 20px;
}
.footer-content ul a {
font-size: 24px;
line-height: 32px;
}
.footer-top__link .link-white {
display: none;
}
.footer-contact {
width: 100%;
padding: 16px;
border-radius: 24px;
}
.footer-contact__title {
color: var(--main_white);
}
.footer-bottom {
margin-top: 0;
padding-top: 24px;
border: 0;
align-items: flex-start;
gap: 17px;
}
}

@ -0,0 +1,4 @@
/* Стили для планшетов */
@media only screen and (max-width: 992px) {
}

@ -0,0 +1,12 @@
<?php
add_filter('timber/context', function($context) {
#Подготавливаем данные для рендеринга
#$context['field_name'] = get_field('field_name')
return $context;
});
$context = Timber::get_context();
# Если необходимо рендерим шаблон компонента
#Timber::render('example/components/example/component-template.twig', $context);

@ -0,0 +1,33 @@
{% extends 'layout/module.template.twig' %}
{% block content %}
<!-- Home -->
<section class="home">
<div class="container">
<h1 class="home-title">БЛОГ</h1>
<p class="home-description">Мы пишем про то, что нас по‑настоящему цепляет: биотехнологии, науку, здоровье и то, как этот мир сделать лучше. Мы не боимся сложных тем и неудобных вопросов, ведь именно с них начинается будущее</p>
{% include '/blog/components/featured-slider/component-template.twig' %}
</div>
</section>
<!-- Home end -->
<!-- Anons -->
<section class="anons">
<div class="container">
{% include '/blog/components/themes/component-template.twig' %}
{% include '/blog/components/most-read/component-template.twig' %}
{% include '/blog/components/news-list/component-template.twig' %}
</section>
<!-- Anons end -->
<!-- Author -->
{% include '/blog/components/author-banner/component-template.twig' %}
<!-- Author end -->
<!-- Editorial -->
{% include '/blog/components/editorial/component-template.twig' %}
<!-- Editorial end -->
{% endblock %}

@ -0,0 +1,10 @@
<?php
add_filter('timber/context', function($context) {
return $context;
});
?>

@ -0,0 +1,60 @@
{% set current_path = template_path ~ '/modules/footer' %}
<footer class="footer">
<div class="container">
<div class="footer-top">
<div class="footer-content__wrap">
<div class="footer-content">
<a href="/" class="logo">
<img src="{{ current_path }}/assets/img/logo-green.svg" alt="">
<span>сosmopet</span>
</a>
<p class="footer-content__address">
{{adres}}
</p>
<ul>
{% for item in email_list %}
<li>
<p>{{item.name}}</p>
<a href="mailto:{{item.email}}">{{item.email}}</a>
</li>
{% endfor %}
</ul>
</div>
<div class="footer-top__link">
<a href="#" class="link-black">{{ function('pll_e', 'Чат бот с ветеринаром') }}</a>
<a href="#" class="link-white">{{ function('pll_e', 'Калькулятор рациона') }}</a>
</div>
</div>
<form class="footer-contact">
<h3 class="footer-contact__title">{{ function('pll_e', 'Форма обратной связи') }}</h3>
<input type="text" placeholder="{{ function('pll_e', 'Ваше имя') }}" class="form-inp">
<input type="email" placeholder="{{ function('pll_e', 'Эл.почта') }}" class="form-inp">
<textarea class="form-textarea" name="" placeholder="{{ function('pll_e', 'Текст обращения') }}" id=""></textarea>
<button class="footer-contact__submit" type="submit">{{ function('pll_e', 'Отправить') }}</button>
</form>
</div>
<div class="footer-bottom">
<ul class="footer-network">
<li>
<a href="#">
<img src="{{ current_path }}/assets/img/footer-network-1.svg" alt="">
</a>
</li>
<li>
<a href="#">
<img src="{{ current_path }}/assets/img/footer-network-2.svg" alt="">
</a>
</li>
<li>
<a href="#">
<img src="{{ current_path }}/assets/img/footer-network-3.svg" alt="">
</a>
</li>
</ul>
<a href="#">Соглашение о конфиденциальности</a>
<a href="#">Декларация соответствия корма</a>
<a href="#">Декларация соответствия лакомств</a>
</div>
</div>
</footer>
<!-- Footer end -->
Loading…
Cancel
Save