Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/epic/esl-carousel' into main-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Jul 18, 2023
2 parents d71cd10 + 3e77a60 commit 9088365
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 27 deletions.
2 changes: 1 addition & 1 deletion pages/src/common/card.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
height: 100%;
flex-direction: column;
background: #fff;
box-shadow: 1px 1px 4px 2px rgba(0, 0, 0, .3);
box-shadow: 1px 1px 4px 2px rgba(0, 0, 0, 0.3);

&-image {
flex: 0 0 auto;
Expand Down
22 changes: 12 additions & 10 deletions pages/src/esl-carousel-demo/test-carousel.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import (reference) "../common/variables.less";
@import (reference) '../common/variables.less';

.marquee-carousel [esl-carousel-container] {
esl-carousel {
Expand All @@ -22,7 +22,8 @@
background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' fill='%23fff'%3E%3Cpath d='M31 40 16 25l15-15 2 2-13 13 13 13z'/%3E%3C/svg%3E");
}
}
button.arrow-prev::before, button.arrow-next::before {
button.arrow-prev::before,
button.arrow-next::before {
width: 60px;
height: 60px;
}
Expand All @@ -38,14 +39,15 @@
}

&.main-carousel {
div[data-slides-area] {
min-height: 500px;
gap: 0;
}
esl-carousel-slide {
padding: 0;
}
button.arrow-prev, button.arrow-next {
div[data-slides-area] {
min-height: 500px;
gap: 0;
}
esl-carousel-slide {
padding: 0;
}
button.arrow-prev,
button.arrow-next {
@media @lg-xl {
display: none;
}
Expand Down
6 changes: 3 additions & 3 deletions src/modules/esl-carousel/all.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./core";
@import './core';

@import "./plugin/nav/esl-carousel.nav.arrows.less";
@import "./plugin/nav/esl-carousel.nav.dots.less";
@import './plugin/nav/esl-carousel.nav.arrows.less';
@import './plugin/nav/esl-carousel.nav.dots.less';
4 changes: 2 additions & 2 deletions src/modules/esl-carousel/core.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./core/esl-carousel";
@import './core/esl-carousel';

// Renderer Default
@import "./renderers/multi/esl-multi-carousel.less";
@import './renderers/multi/esl-multi-carousel.less';
1 change: 0 additions & 1 deletion src/modules/esl-carousel/core/esl-carousel.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ esl-carousel {
padding: 5px;
overflow: hidden;


[data-slides-area] {
position: relative;
width: 100%;
Expand Down
13 changes: 9 additions & 4 deletions src/modules/esl-carousel/plugin/nav/esl-carousel.nav.arrows.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/** Arrow navigation styles */
[esl-carousel-container] {
--esl-carousel-arrow-size: 40px;
--esl-carousel-arrow-offset: clamp(-40px, calc(40px - 40 * 100% / 700), -25px);
--esl-carousel-arrow-offset: clamp(
-40px,
calc(40px - 40 * 100% / 700),
-25px
);

.esl-carousel-arrow {
display: flex;
Expand All @@ -17,7 +21,7 @@
appearance: none;

&[disabled] {
opacity: .25;
opacity: 0.25;
}
}

Expand Down Expand Up @@ -50,8 +54,9 @@
width: 100%;
height: 100%;
margin: auto;
opacity: .75;
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='5 5 40 40'%3E%3Cpolygon points='31 40 16 25 31 10 33 12 20 25 33 38'/%3E%3C/svg%3E") no-repeat center center;
opacity: 0.75;
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='5 5 40 40'%3E%3Cpolygon points='31 40 16 25 31 10 33 12 20 25 33 38'/%3E%3C/svg%3E")
no-repeat center center;

filter: drop-shadow(0 0 4px #fff);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
display: block;
text-align: center;
opacity: 1;
transition: opacity .5s ease-out;
transition: opacity 0.5s ease-out;
cursor: default;

.carousel-dot {
Expand All @@ -13,7 +13,7 @@
height: 9px;
margin: 0 5px;
vertical-align: middle;
background: rgba(118, 118, 118, .5);
background: rgba(118, 118, 118, 0.5);
border: none;
border-radius: 24px;
cursor: pointer;
Expand All @@ -22,7 +22,7 @@
.active-dot {
width: 11px;
height: 11px;
background: rgba(255, 255, 255, .5);
background: rgba(255, 255, 255, 0.5);
border: 1px solid #bababa;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
esl-carousel.multi-carousel {
@SLIDE_CAROUSEL_ANIMATION: .25s linear;
@SLIDE_CAROUSEL_ANIMATION: 0.25s linear;
&[animating] {
[data-slides-area] {
// animation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class ESLMultiCarouselRenderer extends ESLCarouselRenderer {
const slideWidth = this.slideWidth + this.gapWidth;
// calculate offset to move to
const shiftCount = Math.abs(offset) % slideWidth >= slideWidth / 4 ? 1 : 0;
const stageOffset = offset < 0 ? -shiftCount * slideWidth : (shiftCount - 1) * slideWidth;
const stageOffset = offset < 0 ? -shiftCount * slideWidth : (shiftCount - 1) * slideWidth - this.gapWidth;

this.carousel.toggleAttribute('animating', true);
this.$area.style.transform = `translateX(${stageOffset}px)`;
Expand Down
3 changes: 2 additions & 1 deletion src/modules/esl-footnotes/core/esl-note.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ esl-note {
}

.esl-note-link {
&, &:hover {
&,
&:hover {
color: inherit;
text-decoration: none;
}
Expand Down

0 comments on commit 9088365

Please sign in to comment.