Task 7453 | layout fixes and add read more button to reviews

pull/36/head
parent 692f1d6bf4
commit 50a330a42b
  1. 1
      wp-content/themes/cosmopet/global-functions/global-constaints.php
  2. 1
      wp-content/themes/cosmopet/global-functions/multisite-functions.php
  3. 1
      wp-content/themes/cosmopet/modules/blog/components/main-page-block/component-controller.php
  4. 91
      wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css
  5. 203
      wp-content/themes/cosmopet/static/css/new-front-page.css
  6. BIN
      wp-content/themes/cosmopet/static/img/new-front/arr.png
  7. BIN
      wp-content/themes/cosmopet/static/img/new-front/brain.png
  8. BIN
      wp-content/themes/cosmopet/static/img/new-front/gift.png
  9. BIN
      wp-content/themes/cosmopet/static/img/new-front/sale.png
  10. BIN
      wp-content/themes/cosmopet/static/img/new-front/star.png
  11. BIN
      wp-content/themes/cosmopet/static/img/rocket.png
  12. 8
      wp-content/themes/cosmopet/templates/_pages/new-front-page/main-quiz.twig
  13. 31
      wp-content/themes/cosmopet/templates/modal/rewiew_modal.twig
  14. 31
      wp-content/themes/cosmopet/templates/shop/reviews-section_block.twig

@ -1,4 +1,3 @@
<?php <?php
add_action('wp_head', function() { add_action('wp_head', function() {

@ -25,6 +25,7 @@ class SiteEnvironment {
add_filter('timber/twig', function (\Twig\Environment $twig) { add_filter('timber/twig', function (\Twig\Environment $twig) {
global $site_env; global $site_env;
$twig->addGlobal('site_region', $site_env->site_region);
$twig->addGlobal('site_env', $site_env); $twig->addGlobal('site_env', $site_env);
$twig->addGlobal('header_scripts', get_field('header_scripts', 'option')); $twig->addGlobal('header_scripts', get_field('header_scripts', 'option'));
return $twig; return $twig;

@ -4,6 +4,7 @@ add_filter('timber/context', function($context) {
$args = array( $args = array(
'post_type' => 'post', 'post_type' => 'post',
'posts_per_page' => 5, 'posts_per_page' => 5,
'post_status' => 'publish', // Только опубликованные записи
); );
$featured_query = new WP_Query($args); $featured_query = new WP_Query($args);
$f_query = array(); $f_query = array();

@ -167,6 +167,7 @@ body {
font-size: 20px; font-size: 20px;
font-weight: 400; font-weight: 400;
line-height: 24px; line-height: 24px;
font-family: inherit;
} }
.form-inp::placeholder { .form-inp::placeholder {
@ -174,7 +175,7 @@ body {
} }
.form-inp:hover, .form-inp:hover,
.form-inp:focus { .form-inp:focus, .form-textarea:hover, .form-textarea:focus {
border-color: var(--main_black); border-color: var(--main_black);
} }
@ -182,11 +183,11 @@ body {
height: 96px; height: 96px;
width: 100%; width: 100%;
resize: none; resize: none;
background: var(--main_white) !important; background: var(--main_white);
border: 1px solid var(--placeholder) !important;; border: 1px solid var(--placeholder);
padding: 12px 16px; padding: 12px 16px;
border-radius: 20px; border-radius: 20px;
color: var(--main_black) !important; color: var(--main_black);
font-size: 20px; font-size: 20px;
font-weight: 400; font-weight: 400;
line-height: 24px; line-height: 24px;
@ -2022,92 +2023,12 @@ textarea{
margin-left: auto; margin-left: auto;
} }
.about_slider .prev, .about_slider .next {
position: absolute;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
z-index: 99;
background-color: unset;
}
.about_slider .next {
right: 29vw;
}
.about_slider .prev {
left: 29vw;
}
.about_slider .carousel-item {
height: 546px;
padding: 35px 50px 25px 50px;
padding: 50px 53px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
/* background: var(--creme-white, #F4F1F0); */
background: #ffffff30;
backdrop-filter: blur(6px);
z-index: 1;
box-shadow: -2px 5px 22.9px 0px rgba(0, 0, 0, 0.25);
}
.about_slider .swiper-slide-active {
backdrop-filter: blur(6px);
width: 429px!important;
z-index: 3;
}
.about_slider .carousel-item img {
width: auto;
}
.about_slider .slide_info {
display: flex;
flex-direction: column;
gap: 15px;
}
.about_slider .carousel-item::after {
content: '';
background-image: url(/wp-content/themes/cosmopet/static/front-page/img/border.png);
background-size: cover;
/* background: linear-gradient(21.69deg, #F44242 23.69%, #569EF0 66.57%); */
display: block;
position: absolute;
width: calc(100% + 4px);
height: calc(100% + 4px);
border-radius: 60px;
top: -2px;
left: -2px;
z-index: -2;
transform: translateZ(-1px);
}
.about_slider .slide_title {
text-transform: uppercase;
font-size: 24px;
font-weight: 700;
line-height: 28.8px;
color: #121212;
}
.about_slider .slide_text {
font-size: 20px;
font-weight: 500;
line-height: 24px;
color:#121212;
}
.discount_block .discount_cosmodog { .discount_block .discount_cosmodog {
margin-top: 60px; margin-top: 60px;
} }
.about_slider .carousel .carousel-item {
border-radius: 60px!important;
}
.about_slider { .about_slider {
position: relative; position: relative;

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

@ -6,10 +6,10 @@
<div class="truth_pictures"> <div class="truth_pictures">
<img src="/wp-content/uploads/2025/07/layer-0-1.png" class="truth_pictures_present"> <img src="/wp-content/themes/cosmopet/static/img/new-front/gift.png" class="truth_pictures_present">
<img src="/wp-content/uploads/2025/07/arrow-4.png" class="truth_pictures_arrow"> <img src="/wp-content/themes/cosmopet/static/img/new-front/arr.png" class="truth_pictures_arrow">
<img src="/wp-content/uploads/2025/07/frame-1321316166.png" class="truth_pictures_sale"> <img src="/wp-content/themes/cosmopet/static/img/new-front/sale.png" class="truth_pictures_sale">
<img src="/wp-content/uploads/2025/07/a_simple_icon_of_light_pink_brain_and_a_rockets_flame_at_bottom_icon_flying_background_is_uniform_da_b230abcd-ab16-4226-90a0-2818b496ae19.png" class="truth_pictures_brain"> <img src="/wp-content/themes/cosmopet/static/img/new-front/brain.png" class="truth_pictures_brain">
</div> </div>
<div class="truth_content-wrap"> <div class="truth_content-wrap">

@ -0,0 +1,31 @@
<div class="mform mform_rev modal-rev_{{ slide.ID }}" style="display: none;">
<div class="mform__review-wrap">
<div class="mform__review">
<div class="close-button">&times;</div>
{% if fn('get_field', 'media_file', slide) %}
<a href="{{fn('get_field', 'media_file', slide)}}" data-fancybox><img class="main-food_reviews-slide-media_file" src="{{fn('get_field', 'media_file', slide)}}"></a>
{% endif %}
{% if fn('get_field', 'media', slide) %}
<div class="main-food_reviews-slide-media_wrap">
<a href="{{fn('get_field', 'media_file', slide)}}" data-fancybox><img class="main-food_reviews-slide-media_main" src="{{fn('get_field', 'media_file', slide)}}"></a>
{% for file in fn('get_field', 'media', slide) %}
<img {% if file.video %}data-video="{{file.video}}"{% endif %} class="main-food_reviews-slide-media_mini {% if file.video %}--video{% endif %}" src="{{file.img}}">
{% endfor %}
</div>
{% endif %}
<div class="main-food_reviews-slide-head">
{% if fn('get_field', 'photo', slide) %}
<img class="main-food_reviews-slide-photo" src="{{fn('get_field', 'photo', slide)}}">
{% endif %}
<p class="main-food_reviews-slide-name {% if not fn('get_field', 'photo', slide) %}--no-padding-left{% endif %}">{{fn('get_the_title', slide)}}</p>
</div>
<p class="main-food_reviews-slide-position {% if not fn('get_field', 'photo', slide) %}--no-padding-left{% endif %}">{{fn('get_field', 'desc', slide)}}</p>
{% if fn('get_field', 'text', slide) %}
<div class="main-food_reviews-slide-text">{{fn('get_field', 'text', slide)}}</div>
{% endif %}
</div>
</div>
</div>

@ -1,6 +1,6 @@
<div class="main-food_reviews"> <div class="main-food_reviews">
<div class="main-food_reviews-title">Отзывы</div> <div class="main-food_reviews-title">Отзывы</div>
<img class="main-food_reviews-star" src="/wp-content/uploads/2025/07/white_star_with_4_rays_background_uniform_purple_stylized_3d_illustration__7bb9c7b9-0db3-4d70-8bee-2db16a58e4d1.png" alt="Звезда"> <img class="main-food_reviews-star" src="/wp-content/themes/cosmopet/static/img/new-front/star.png" alt="Звезда">
<div class="main-{{section}}_reviews-slider swiper"> <div class="main-{{section}}_reviews-slider swiper">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
{% for slide in rev_list %} {% for slide in rev_list %}
@ -18,12 +18,26 @@
</div> </div>
{% endif %} {% endif %}
<div class="main-food_reviews-slide-head"> <div class="main-food_reviews-slide-head">
{% if fn('get_field', 'photo', slide) %}
<img class="main-food_reviews-slide-photo" src="{{fn('get_field', 'photo', slide)}}"> <img class="main-food_reviews-slide-photo" src="{{fn('get_field', 'photo', slide)}}">
<p class="main-food_reviews-slide-name">{{fn('get_the_title', slide)}}</p> {% endif %}
<p class="main-food_reviews-slide-name {% if not fn('get_field', 'photo', slide) %}--no-padding-left{% endif %}">{{fn('get_the_title', slide)}}</p>
</div> </div>
<p class="main-food_reviews-slide-position">{{fn('get_field', 'desc', slide)}}</p> <p class="main-food_reviews-slide-position {% if not fn('get_field', 'photo', slide) %}--no-padding-left{% endif %}">{{fn('get_field', 'desc', slide)}}</p>
{% if fn('get_field', 'text', slide) %} {% if fn('get_field', 'text', slide) %}
<p class="main-food_reviews-slide-text">{{fn('get_field', 'text', slide)}}</p> {% set maxLength = 500 %}
{% set content = fn('get_field', 'text', slide) %}
{% if content|length > maxLength %}
<div class="main-food_reviews-slide-text">{{ content[:maxLength] ~ '...' }}
<button class="read-more" onclick="showModal('modal-rev_{{slide.ID}}')">
Читать полностью
</button>
</div>
{% else %}
<div class="main-food_reviews-slide-text">{{ content }}</div>
{% endif %}
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}
@ -38,4 +52,11 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{% for slide in rev_list %}
{% include 'modal/rewiew_modal.twig' with {slide : slide} %}
{% endfor %}
Loading…
Cancel
Save