547 lines
12 KiB
CSS
547 lines
12 KiB
CSS
.esun-interactive-cards {
|
|
--esun-card-gap: 16px;
|
|
--esun-card-height: 400px;
|
|
--esun-card-width: 360px;
|
|
--esun-active-width: 680px;
|
|
--esun-side-width: 220px;
|
|
--esun-green: #19ad61;
|
|
width: 100%;
|
|
padding: 24px 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.esun-interactive-cards *,
|
|
.esun-interactive-cards *::before,
|
|
.esun-interactive-cards *::after {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.esun-interactive-cards__viewport {
|
|
width: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.esun-interactive-cards__track {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: stretch;
|
|
gap: var(--esun-card-gap);
|
|
width: 100%;
|
|
transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
|
|
will-change: transform;
|
|
}
|
|
|
|
.esun-interactive-cards.is-carousel .esun-interactive-cards__track {
|
|
flex-wrap: nowrap;
|
|
}
|
|
|
|
.esun-interactive-cards__track.is-resizing {
|
|
transition: none;
|
|
}
|
|
|
|
.esun-interactive-card {
|
|
position: relative;
|
|
flex: 0 0 var(--esun-card-width);
|
|
width: var(--esun-card-width);
|
|
height: var(--esun-card-height);
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
border-radius: 16px;
|
|
background: #e5e8e7;
|
|
cursor: pointer;
|
|
isolation: isolate;
|
|
transition:
|
|
flex-basis 0.48s cubic-bezier(0.22, 0.61, 0.36, 1),
|
|
width 0.48s cubic-bezier(0.22, 0.61, 0.36, 1),
|
|
opacity 0.35s ease,
|
|
filter 0.35s ease,
|
|
box-shadow 0.35s ease;
|
|
}
|
|
|
|
.esun-interactive-card:focus-visible {
|
|
outline: 3px solid var(--esun-green);
|
|
outline-offset: 3px;
|
|
}
|
|
|
|
.esun-interactive-card__picture,
|
|
.esun-interactive-card__image {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.esun-interactive-card__image {
|
|
object-fit: cover;
|
|
object-position: center;
|
|
transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
|
|
}
|
|
|
|
.esun-interactive-card__shade {
|
|
position: absolute;
|
|
inset: 0;
|
|
z-index: 1;
|
|
background: rgba(20, 24, 23, 0.48);
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
transition:
|
|
opacity 0.35s ease,
|
|
background 0.35s ease;
|
|
}
|
|
|
|
.esun-interactive-card__content {
|
|
position: absolute;
|
|
inset: 0;
|
|
z-index: 2;
|
|
color: #fff;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.esun-interactive-card__title {
|
|
position: absolute;
|
|
left: 26px;
|
|
right: 26px;
|
|
top: 50%;
|
|
margin: 0;
|
|
color: #fff;
|
|
font-size: clamp(15px, 1.15vw, 20px);
|
|
font-weight: 700;
|
|
line-height: 1.35;
|
|
letter-spacing: 0;
|
|
text-align: center;
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transform: translateY(calc(-50% + 18px));
|
|
transition:
|
|
opacity 0.35s ease,
|
|
visibility 0.35s ease,
|
|
transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1),
|
|
inset 0.42s ease;
|
|
}
|
|
|
|
.esun-interactive-card__description {
|
|
position: absolute;
|
|
left: 30px;
|
|
bottom: 28px;
|
|
width: calc(52% - 44px);
|
|
max-height: 108px;
|
|
overflow: hidden;
|
|
color: #fff;
|
|
font-size: 14px;
|
|
line-height: 1.55;
|
|
letter-spacing: 0;
|
|
white-space: pre-line;
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transform: translateY(16px);
|
|
transition:
|
|
opacity 0.35s ease 0.08s,
|
|
visibility 0.35s ease 0.08s,
|
|
transform 0.42s ease 0.08s;
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.esun-interactive-cards.has-hover:not(.has-active)
|
|
.esun-interactive-card:hover
|
|
.esun-interactive-card__shade {
|
|
opacity: 1;
|
|
}
|
|
|
|
.esun-interactive-cards.has-hover:not(.has-active)
|
|
.esun-interactive-card:hover
|
|
.esun-interactive-card__image {
|
|
transform: scale(1.035);
|
|
}
|
|
|
|
.esun-interactive-cards.has-hover:not(.has-active)
|
|
.esun-interactive-card:hover
|
|
.esun-interactive-card__title {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
transform: translateY(-50%);
|
|
}
|
|
}
|
|
|
|
/* Side-pull applies only to the active carousel window or active grid row. */
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card:is(.is-active-window, .is-active-row).is-active {
|
|
flex-basis: var(--esun-active-width);
|
|
width: var(--esun-active-width);
|
|
opacity: 1;
|
|
filter: none;
|
|
cursor: default;
|
|
box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card:is(.is-active-window, .is-active-row):not(
|
|
.is-active
|
|
) {
|
|
flex-basis: var(--esun-side-width);
|
|
width: var(--esun-side-width);
|
|
opacity: 0.82;
|
|
filter: saturate(0.72);
|
|
}
|
|
|
|
.esun-interactive-cards.is-carousel.has-active
|
|
.esun-interactive-card.is-outside-window {
|
|
display: none;
|
|
}
|
|
|
|
.esun-interactive-cards.is-carousel.has-active .esun-interactive-cards__track {
|
|
transform: translate3d(0, 0, 0) !important;
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card.is-active
|
|
.esun-interactive-card__shade {
|
|
opacity: 1;
|
|
background: linear-gradient(
|
|
90deg,
|
|
rgba(13, 18, 16, 0.82) 0%,
|
|
rgba(13, 18, 16, 0.58) 46%,
|
|
rgba(13, 18, 16, 0.2) 100%
|
|
);
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card.is-active
|
|
.esun-interactive-card__content {
|
|
right: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: flex-end;
|
|
gap: 12px;
|
|
width: 52%;
|
|
padding: 30px;
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card.is-active
|
|
.esun-interactive-card__title {
|
|
position: static;
|
|
opacity: 1;
|
|
visibility: visible;
|
|
text-align: left;
|
|
transform: none;
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card.is-active
|
|
.esun-interactive-card__description {
|
|
position: static;
|
|
width: 100%;
|
|
opacity: 1;
|
|
visibility: visible;
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card.is-active
|
|
.esun-interactive-card__description
|
|
> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card.is-active
|
|
.esun-interactive-card__description
|
|
> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.esun-interactive-card__product {
|
|
position: absolute;
|
|
right: 24px;
|
|
bottom: 24px;
|
|
z-index: 3;
|
|
display: grid;
|
|
grid-template-columns: minmax(90px, 42%) minmax(0, 1fr);
|
|
gap: 12px;
|
|
align-items: center;
|
|
width: min(44%, 490px);
|
|
min-height: 126px;
|
|
padding: 12px;
|
|
overflow: hidden;
|
|
border: 1px solid rgba(25, 173, 97, 0.95);
|
|
border-radius: 14px;
|
|
color: #fff;
|
|
background: rgba(14, 18, 16, 0.68);
|
|
backdrop-filter: blur(10px);
|
|
-webkit-backdrop-filter: blur(10px);
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transform: translateX(22px);
|
|
pointer-events: none;
|
|
transition:
|
|
opacity 0.35s ease 0.12s,
|
|
visibility 0.35s ease 0.12s,
|
|
transform 0.42s ease 0.12s;
|
|
}
|
|
|
|
.esun-interactive-card__product:empty {
|
|
display: none;
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card.is-active
|
|
.esun-interactive-card__product:not(:empty) {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
transform: translateX(0);
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.esun-interactive-card__product.is-loading::before {
|
|
content: "";
|
|
position: absolute;
|
|
left: 50%;
|
|
top: 50%;
|
|
width: 24px;
|
|
height: 24px;
|
|
margin: -12px 0 0 -12px;
|
|
border: 2px solid rgba(255, 255, 255, 0.35);
|
|
border-top-color: #fff;
|
|
border-radius: 50%;
|
|
animation: esun-interactive-spin 0.8s linear infinite;
|
|
}
|
|
|
|
.esun-interactive-product__image {
|
|
display: block;
|
|
height: 100px;
|
|
overflow: hidden;
|
|
border-radius: 8px;
|
|
background: #101312;
|
|
}
|
|
|
|
.esun-interactive-product__image img {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.esun-interactive-product__details {
|
|
min-width: 0;
|
|
padding-right: 40px;
|
|
}
|
|
|
|
.esun-interactive-product__name {
|
|
display: -webkit-box;
|
|
overflow: hidden;
|
|
color: #fff !important;
|
|
font-size: 14px;
|
|
line-height: 1.35;
|
|
text-decoration: none;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-line-clamp: 2;
|
|
}
|
|
|
|
.esun-interactive-product__prices {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 7px;
|
|
margin-top: 8px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.esun-interactive-product__prices del {
|
|
color: rgba(255, 255, 255, 0.46);
|
|
font-size: 11px;
|
|
}
|
|
|
|
.esun-interactive-product__form {
|
|
position: absolute;
|
|
right: 12px;
|
|
bottom: 12px;
|
|
margin: 0;
|
|
}
|
|
|
|
.esun-interactive-product__cart {
|
|
display: block;
|
|
width: 36px;
|
|
height: 36px;
|
|
min-width: 36px;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: 50%;
|
|
background-color: var(--esun-green);
|
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1'/%3E%3Ccircle cx='19' cy='20' r='1'/%3E%3Cpath d='M3 4h2l2.4 10.4a2 2 0 0 0 2 1.6h7.7a2 2 0 0 0 2-1.6L21 8H6'/%3E%3C/svg%3E");
|
|
background-position: center;
|
|
background-repeat: no-repeat;
|
|
cursor: pointer;
|
|
transition:
|
|
transform 0.25s ease,
|
|
background-color 0.25s ease;
|
|
}
|
|
|
|
.esun-interactive-product__cart--link {
|
|
position: absolute;
|
|
right: 12px;
|
|
bottom: 12px;
|
|
}
|
|
|
|
.esun-interactive-product__cart:hover {
|
|
background-color: #0b8c4d;
|
|
transform: scale(1.08);
|
|
}
|
|
|
|
.esun-interactive-card__product.has-error {
|
|
display: flex;
|
|
grid-template-columns: none;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: rgba(255, 255, 255, 0.78);
|
|
font-size: 13px;
|
|
}
|
|
|
|
.esun-interactive-cards__controls {
|
|
display: flex;
|
|
align-items: stretch;
|
|
justify-content: center;
|
|
gap: 18px;
|
|
min-height: 42px;
|
|
margin-top: 28px;
|
|
}
|
|
|
|
.esun-interactive-cards__arrow {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 34px;
|
|
height: 34px;
|
|
padding: 0;
|
|
border: 0;
|
|
color: var(--esun-green);
|
|
background: transparent;
|
|
font-size: 34px;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
font-weight: 400;
|
|
}
|
|
|
|
.esun-interactive-cards__arrow:disabled {
|
|
opacity: 0.3;
|
|
cursor: default;
|
|
}
|
|
|
|
.esun-interactive-cards__dots {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 12px;
|
|
min-width: 120px;
|
|
}
|
|
|
|
.esun-interactive-cards__dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
min-width: 8px;
|
|
padding: 0;
|
|
border: 0;
|
|
border-radius: 50%;
|
|
background: #d2e9dc;
|
|
cursor: pointer;
|
|
transition:
|
|
width 0.25s ease,
|
|
border-radius 0.25s ease,
|
|
background 0.25s ease;
|
|
}
|
|
|
|
.esun-interactive-cards__dot.is-current {
|
|
width: 32px;
|
|
border-radius: 8px;
|
|
background: var(--esun-green);
|
|
}
|
|
|
|
@keyframes esun-interactive-spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
@media (max-width: 1024px) {
|
|
.esun-interactive-card__description {
|
|
font-size: 13px;
|
|
}
|
|
|
|
.esun-interactive-card__product {
|
|
width: 45%;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 767px) {
|
|
.esun-interactive-cards {
|
|
--esun-card-height: 390px !important;
|
|
padding: 18px 0;
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card:is(.is-active-window, .is-active-row):not(
|
|
.is-active
|
|
) {
|
|
display: none;
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card:is(.is-active-window, .is-active-row).is-active {
|
|
flex-basis: 100%;
|
|
width: 100%;
|
|
}
|
|
|
|
.esun-interactive-cards.has-active
|
|
.esun-interactive-card.is-active
|
|
.esun-interactive-card__content {
|
|
width: 100%;
|
|
padding: 20px 20px 92px;
|
|
gap: 8px;
|
|
}
|
|
|
|
.esun-interactive-card__description {
|
|
max-height: 66px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.esun-interactive-card__product {
|
|
left: 16px;
|
|
right: 16px;
|
|
bottom: 14px;
|
|
grid-template-columns: 58px minmax(0, 1fr);
|
|
width: auto;
|
|
min-height: 66px;
|
|
padding: 7px;
|
|
}
|
|
|
|
.esun-interactive-product__image {
|
|
height: 58px;
|
|
}
|
|
|
|
.esun-interactive-product__details {
|
|
padding-right: 38px;
|
|
}
|
|
|
|
.esun-interactive-product__name {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.esun-interactive-product__form,
|
|
.esun-interactive-product__cart--link {
|
|
right: 8px;
|
|
bottom: 15px;
|
|
}
|
|
|
|
.esun-interactive-cards__controls {
|
|
margin-top: 18px;
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.esun-interactive-cards *,
|
|
.esun-interactive-cards *::before,
|
|
.esun-interactive-cards *::after {
|
|
scroll-behavior: auto !important;
|
|
transition-duration: 0.01ms !important;
|
|
animation-duration: 0.01ms !important;
|
|
animation-iteration-count: 1 !important;
|
|
}
|
|
}
|