-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add carousel plugin to landpage
- Loading branch information
1 parent
0f3ec25
commit e65fb58
Showing
4 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
app/contrib/frontend/landpage/templates/frontend/landpage/plugins/carousel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{% load cms_tags sekizai_tags static %} | ||
|
||
{% addtoblock "css" %} | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.css" /> | ||
{% endaddtoblock %} | ||
|
||
<section class="bg-[#024C2B] relative"> | ||
<div class="container px-5 py-28 mx-auto md:px-4"> | ||
{% if title or description %}<div class="mb-6">{% endif %} | ||
{% if title %}<h2 class="text-4xl text-white text-center max-w-[620px] mx-auto mb-4">{{title}}</h2>{% endif %} | ||
{% if description %}<p class="text-white text-center max-w-[815px] mx-auto">{{ description }}</p>{% endif %} | ||
{% if title or description %}</div>{% endif %} | ||
|
||
<div class="swiper mySwiper md:min-h-[300px]"> | ||
<div class="swiper-wrapper"> | ||
<!-- Slides --> | ||
{% for item in items %} | ||
<div class="swiper-slide"> | ||
<img src="{{ item.image.url }}" alt="{{ item.image.description }}"> | ||
<p>{{ item.text }}</p> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
<div class="swiper-pagination"></div> | ||
<div class="swiper-button-prev mt-14 md:mx-5 md:mt-10"></div> | ||
<div class="swiper-button-next mt-14 md:mx-5 md:mt-10"></div> | ||
</div> | ||
</section> | ||
|
||
{% addtoblock "js" %} | ||
<script src="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js"></script> | ||
<script> | ||
var swiper = new Swiper(".mySwiper", { | ||
slidesPerView: 1, | ||
spaceBetween: 10, | ||
pagination: { | ||
el: ".swiper-pagination", | ||
clickable: true, | ||
}, | ||
navigation: { | ||
nextEl: ".swiper-button-next", | ||
prevEl: ".swiper-button-prev", | ||
}, | ||
breakpoints: { | ||
640: { | ||
slidesPerView: 2, | ||
spaceBetween: 20, | ||
}, | ||
768: { | ||
slidesPerView: 4, | ||
spaceBetween: 40, | ||
}, | ||
1024: { | ||
slidesPerView: 5, | ||
spaceBetween: 50, | ||
}, | ||
}, | ||
}); | ||
</script> | ||
{% endaddtoblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters