Skip to content

Commit

Permalink
[BEAM-14418] added arrows to slider
Browse files Browse the repository at this point in the history
[BEAM-14418] add buttons to slider, change structure of slider

[BEAM-14418] hide arrows from mobile view, add formatting
  • Loading branch information
bullet03 committed May 20, 2022
1 parent 0f77d68 commit ace81bf
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
4 changes: 4 additions & 0 deletions website/www/site/assets/js/quotes-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ new Swiper('.swiper', {
bulletClass: "bullet-class-custom",
bulletActiveClass: "bullet-active-class-custom",
},
navigation: {
nextEl: ".swiper-button-next-custom",
prevEl: ".swiper-button-prev-custom",
},
breakpoints: {
// switches from mobile to desktop when window width is > 1024px
1025: {
Expand Down
17 changes: 16 additions & 1 deletion website/www/site/assets/scss/_quotes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
}
}


.bullet-class-custom {
display: inline-block;
border: none;
Expand Down Expand Up @@ -169,3 +168,19 @@
}
}
}

.swiper-container {
display: flex;
align-items: center;
}

.swiper-button-next-custom,
.swiper-button-prev-custom {
@media (max-width: $mobile) {
display: none;
}
img {
display: block;
width: 100%;
}
}
24 changes: 16 additions & 8 deletions website/www/site/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,24 @@ <h2 class="calendar-title">
{{ T "home-quotes-title" }}
</div>

<div class="quotes-desktop swiper">
<div class="swiper-wrapper">
{{ $data := index $.Site.Data .Site.Language.Lang }}
{{ range $quote := $data.quotes }}
<div class="swiper-slide">
{{ partial "quotes/quote.html" (dict "icon" $quote.icon "text" $quote.text "logoUrl" $quote.logoUrl "linkUrl" $quote.linkUrl "linkText" $quote.linkText) }}
<div class="swiper-container">
<div class="swiper-button-prev-custom">
<img src="/images/swiper-button-prev.png" alt="previous button">
</div>
<div class="quotes-desktop swiper">
<div class="swiper-wrapper">
{{ $data := index $.Site.Data .Site.Language.Lang }}
{{ range $quote := $data.quotes }}
<div class="swiper-slide">
{{ partial "quotes/quote.html" (dict "icon" $quote.icon "text" $quote.text "logoUrl" $quote.logoUrl "linkUrl" $quote.linkUrl "linkText" $quote.linkText) }}
</div>
{{ end }}
</div>
{{ end }}
<div id="swiper-pagination-id" class="swiper-pagination"></div>
</div>
<div class="swiper-button-next-custom">
<img src="/images/swiper-button-next.png" alt="next button">
</div>
<div id="swiper-pagination-id" class="swiper-pagination"></div>
</div>

</div>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ace81bf

Please sign in to comment.