animated news blocks

This commit is contained in:
saparatayev 2022-05-03 13:38:09 +05:00
parent 57e04f9a33
commit b9a5e81492
2 changed files with 30 additions and 2 deletions

View File

@ -72,7 +72,21 @@ postPage = "news_post"
{% for post in posts %}
<div class="news_box-item wow fadeInUp" data-wow-duration=".5s" data-wow-delay=".1s">
<div class="news_box-item wow fadeInUp" data-wow-duration=".5s"
{% if loop.index > 4 %}
{% if loop.index - 3 < 10 %}
data-wow-delay=".{{ loop.index - 3 }}s"
{% else %}
data-wow-delay="{{ (loop.index - 3) / 10 }}s"
{% endif %}
{% else %}
{% if loop.index < 10 %}
data-wow-delay=".{{ loop.index }}s"
{% else %}
data-wow-delay="{{ loop.index / 10 }}s"
{% endif %}
{% endif %}
>
<div class="news_box-item-photo">
<img src="{{ post.featured_images[0].thumb(467,300,{'mode':'crop'}) }}" alt="news-photo">

View File

@ -29,7 +29,21 @@ postPage = "news_post"
<div class="news_box">
{% for post in posts %}
<div class="news_box-item wow fadeInUp" data-wow-duration=".5s" data-wow-delay=".2s">
<div class="news_box-item wow fadeInUp" data-wow-duration=".5s"
{% if loop.index > 4 %}
{% if loop.index - 3 < 10 %}
data-wow-delay=".{{ loop.index - 3 }}s"
{% else %}
data-wow-delay="{{ (loop.index - 3) / 10 }}s"
{% endif %}
{% else %}
{% if loop.index < 10 %}
data-wow-delay=".{{ loop.index }}s"
{% else %}
data-wow-delay="{{ loop.index / 10 }}s"
{% endif %}
{% endif %}
>
<div class="news_box-item-photo">
<img src="{{ post.featured_images[0].thumb(467,300,{'mode':'crop'}) }}" alt="news-photo">