Demas ajustes

This commit is contained in:
2026-10-09 23:02:05 -06:00
parent 220178d421
commit f9666c4088
83 changed files with 10271 additions and 6509 deletions
+19 -404
View File
@@ -72,9 +72,16 @@
endcase
assign poster_alt = heading
assign slide_state = ''
if forloop.index0 == active_index
assign slide_state = ' is-active'
if video_src != blank
assign slide_state = slide_state | append: ' is-playing'
endif
endif
%}
<article
class="learn__slide{% if forloop.index0 == active_index %} is-active{% endif %}"
class="learn__slide{{ slide_state }}"
data-slide
{{ block.shopify_attributes }}
>
@@ -107,6 +114,7 @@
<video
class="learn__video"
data-learn-video
src="{{ video_src }}"
data-src="{{ video_src }}"
{% if block.settings.poster != blank %}
poster="{{ block.settings.poster | image_url: width: 800 }}"
@@ -116,7 +124,12 @@
muted
playsinline
loop
preload="none"
{% if forloop.index0 == active_index %}
autoplay
preload="auto"
{% else %}
preload="none"
{% endif %}
></video>
{% endif %}
</div>
@@ -226,406 +239,6 @@
</div>
</section>
{% stylesheet %}
.learn {
--slide: 384px;
--slide-gap: 30px;
position: relative;
margin-top: 50px;
padding: 97px 0 50px;
overflow: hidden;
background: linear-gradient(127deg, #f8e1ee 8%, #ffffff 60%);
color: #000;
font-family: Archivo, sans-serif;
}
.learn__blob {
position: absolute;
z-index: 0;
pointer-events: none;
user-select: none;
}
.learn__blob--right {
top: 0;
right: 219px;
width: 539px;
height: auto;
}
.learn__blob--left {
top: 722px;
left: 29px;
width: 407px;
height: auto;
}
.learn__header,
.learn__products,
.learn__progress,
.learn__stage {
position: relative;
z-index: 1;
}
.learn__header {
margin-bottom: 30px;
padding-inline: 100px;
}
.learn__heading {
margin: 0;
font-family: "Roc Grotesk", Archivo, sans-serif;
font-size: 30px;
font-weight: 500;
line-height: normal;
text-transform: uppercase;
}
.learn__subheading {
margin: 13px 0 0;
font-size: 20px;
font-weight: 300;
line-height: 30px;
}
.learn__stage {
height: 680px;
}
.learn__viewport {
height: 100%;
overflow: hidden;
cursor: grab;
touch-action: pan-y;
}
.learn__viewport.is-dragging {
cursor: grabbing;
}
.learn__track {
display: flex;
align-items: center;
gap: var(--slide-gap);
width: max-content;
height: 100%;
padding-inline: calc(50% - var(--slide) / 2);
}
.learn__slide {
flex: 0 0 var(--slide);
width: var(--slide);
}
.learn__media {
position: relative;
height: 518px;
overflow: hidden;
border-radius: 10px;
background: #f3e6ee;
}
.learn__slide.is-active .learn__media {
height: 680px;
}
.learn__poster,
.learn__video {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.learn__video {
opacity: 0;
}
.learn__slide.is-playing .learn__video {
opacity: 1;
}
.learn__slide.is-playing .learn__poster {
opacity: 0;
}
.learn__arrow {
position: absolute;
top: 50%;
z-index: 2;
display: grid;
width: 50px;
height: 50px;
place-items: center;
padding: 0;
border: 0;
border-radius: 60px;
background: #fff;
transform: translateY(-50%);
cursor: pointer;
}
.learn__arrow--prev {
left: 50px;
}
.learn__arrow--next {
right: 50px;
}
.learn__arrow:disabled {
cursor: default;
opacity: 0.45;
}
.learn__arrow-icon {
display: block;
}
.learn__arrow--prev .learn__arrow-icon {
transform: rotate(-90deg);
}
.learn__arrow--next .learn__arrow-icon {
transform: rotate(90deg);
}
.learn__products {
min-height: 120px;
margin-top: 36px;
}
.learn__row {
display: flex;
justify-content: center;
gap: 20px;
}
.learn__row[hidden] {
display: none;
}
.learn__card {
display: flex;
align-items: center;
gap: 10px;
width: 384px;
height: 120px;
padding: 10px;
border-radius: 10px;
background: rgba(249, 249, 250, 0.7);
}
.learn__card-media {
position: relative;
flex: 0 0 100px;
width: 100px;
height: 100px;
overflow: hidden;
border-radius: 5px;
}
.learn__card-image {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.learn__card-image--hover {
position: absolute;
inset: 0;
opacity: 0;
transition: opacity 0.35s ease;
}
.learn__card:hover .learn__card-image--hover,
.learn__card:focus-within .learn__card-image--hover {
opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
.learn__card-image--hover {
transition: none;
}
}
.learn__card-copy {
min-width: 0;
flex: 1 1 auto;
}
.learn__card-title {
display: block;
color: #000;
font-size: 14px;
font-weight: 400;
line-height: normal;
text-decoration: none;
}
.learn__card-price {
margin: 5px 0 0;
font-size: 16px;
font-weight: 400;
line-height: normal;
}
.learn__form {
flex: 0 0 auto;
margin: 0;
}
.learn__cart {
display: grid;
width: 50px;
height: 50px;
place-items: center;
padding: 0;
border: 0;
border-radius: 60px;
background: #9dd6c7;
cursor: pointer;
}
.learn__cart:disabled {
cursor: not-allowed;
opacity: 0.45;
}
.learn__cart svg {
display: block;
}
.learn__progress {
position: relative;
width: min(1200px, calc(100% - 200px));
height: 1px;
margin: 54px auto 0;
background: #e6e6e6;
cursor: pointer;
touch-action: none;
}
.learn__progress::before {
content: "";
position: absolute;
top: -12px;
right: 0;
left: 0;
height: 25px;
}
.learn__progress-bar {
position: absolute;
top: 0;
left: 0;
height: 2px;
background: #000;
}
.learn__arrow:focus-visible,
.learn__cart:focus-visible,
.learn__card-title:focus-visible,
.learn__card-media:focus-visible {
outline: 2px solid #000;
outline-offset: 2px;
}
@media (max-width: 1439px) {
.learn__header {
padding-inline: 40px;
}
.learn__blob--right {
right: -80px;
width: 360px;
}
.learn__blob--left {
top: auto;
bottom: 40px;
width: 240px;
}
}
@media (max-width: 1024px) {
.learn {
--slide: 220px;
--slide-gap: 16px;
margin-top: 24px;
padding: 40px 0 32px;
}
.learn__blob {
display: none;
}
.learn__header {
margin-bottom: 20px;
padding-inline: 15px;
}
.learn__heading {
font-size: 20px;
}
.learn__subheading {
margin-top: 8px;
font-size: 14px;
line-height: 20px;
}
.learn__stage {
height: 390px;
}
.learn__media {
height: 300px;
}
.learn__slide.is-active .learn__media {
height: 390px;
}
.learn__arrow {
width: 40px;
height: 40px;
}
.learn__arrow--prev {
left: 12px;
}
.learn__arrow--next {
right: 12px;
}
.learn__products {
min-height: 0;
margin-top: 20px;
padding-inline: 15px;
}
.learn__row {
flex-direction: column;
align-items: center;
gap: 10px;
}
.learn__card {
width: min(384px, 100%);
}
.learn__progress {
width: calc(100% - 30px);
margin-top: 24px;
}
}
{% endstylesheet %}
{% javascript %}
(() => {
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
@@ -648,8 +261,10 @@
if (!video || reduceMotion) return;
if (video.dataset.loaded !== 'true' && video.dataset.src) {
video.dataset.loaded = 'true';
video.src = video.dataset.src;
video.load();
if (video.getAttribute('src') !== video.dataset.src) {
video.src = video.dataset.src;
video.load();
}
}
const mark = () => slide.classList.add('is-playing');
if (!video.paused && video.currentTime > 0) mark();