Журнал Тильды
/
Библиотека промптов
/
Слайдер-обложка для сайта с карточками проектов
Обложки, Галерея и слайдеры
Слайдер-обложка для сайта с карточками проектов
Полноэкранный слайдер на HTML: фото проектов сменяются каждые 5 секунд, внизу карточки с миниатюрами и полосой прогресса.
Промпт
Вы можете скопировать промпт и вставить его в вайб блок в поле ввода. Подробнее в инструкции.
Создай Verdur: полноэкранное слайд-шоу,3 карточки снизу.

Статичный HTML: 3 фоновых img,3 миниатюры с src,все тексты/ссылки. Текстам data-tilda-edit="y",img data-tilda-img="y". Без динамического контента,innerHTML/клонов/canvas; JS меняет классы. Без JS видны первый фон и текст; редактор: всё доступно без эффектов. IIFE после HTML: root ищи в document.currentScript?.getRootNode()||document; init сразу. CSS/JS изолируй.

Min-height:100svh,flex-column,#0d0d0d,Arial,overflow:hidden. Фоны absolute inset:0,cover,brightness(.72) saturate(.82); слой linear-gradient(to top,#0d0d0deb,#0d0d0d8c 30%,#0d0d0d1a 58%,transparent). Crossfade .85с,scale1.08→1 за9с.

Nav h72px,padding0 60px: Verdur слева,Residences/Locations/Studio по центру,+1 000 000 00 00 справа. href="#",13px/500,белый; меню opacity.7,gap40px.

Контент flex:1,grid 1fr 1fr,gap48px,align-items:end,padding0 60px 72px. H1 слева,3 строки:
Built to Belong,
Designed to Last,
Made to Inspire
72px,700,line-height:.96,letter-spacing:-.03em,#f5f3ef.
Справа: We select residences where architecture and location are irreplaceable. Not listed elsewhere. Not rushed. Properties that hold their meaning over decades.
clamp(15px,1.2vw,18px)/1.65,#ffffff99,46ch. Через40px View Collection (href="#"): #c7a261,белый14px/600,tracking:.04em,padding18px 36px,radius4px,border1.5px transparent. Hover: прозрачный фон,белая рамка,.32с.

Внизу 3 равные карточки,разделители1px белые .1,padding20px 28px,gap16px. Фото110×70px,radius4px; название18px,город14px; справа круглая ссылка-стрелка32px. Неактивная: фото brightness(.6),название белое .55,город .3. Активная: фон белый .07,фото brightness(1),название #f5f3ef/600,город .5,стрелка #b8965a. Сверху трек2px: белый .08,у активной заполнение #b8965a слева направо за5с.

Автоплей5с по кругу,старт через1.3с. Клик/Enter/Space: смена,сброс таймера; стрелка только href="#". Hover/focus полосы и скрытая вкладка: пауза таймера/прогресса,синхронное продолжение. H1/описание постоянные.

После init: шторка #0d0d0d,clip-path inset(0)→inset(0 0 100% 0),1.1с,delay.15с. Nav/описание/полоса: fade+Y(-14/18/18→0px),.72/.72/.6с,delay1/1.55/1.8с. Easing cubic-bezier(.22,1,.36,1). Без JS/при сбое шторка скрыта. Reduced-motion: без вступления/zoom.

≤960px: меню скрыто,nav padding0 36px; контент1 колонкой,padding48px 36px 60px,gap36px; фото72×52px.
≤640px: nav60px,padding0 20px; контент снизу,padding32px 20px 36px,H1 60px,отступы20/24px. Карточки вертикально,padding14px 20px,фото64×48px,название15px,город12px; прогресс слева2px сверху вниз. Без обрезки текста.
≤480px: H1 44px,фото56×42px,название14px. ≤360px: H1 40px,описание16px,без миниатюр.

Название|город|фото фона/миниатюры. Префикс https://static.tildacdn.com/; полные src в HTML:
Meridian Penthouse|Tbilisi, Georgia|tild6238-3234-4363-a131-313231343564/photo-1702411200201-.jpg
Corten House|Lisbon, Portugal|tild3266-3637-4763-b131-633337623461/5226.jpg
Glass Residency|Vienna, Austria|tild3438-3838-4632-a536-663237373330/photo-1532888277436-.jpg
Скопировать промпт
Код
Вы можете скопировать код и вставить его в вайб блок в раздел код. Подробнее в инструкции.
<section class="kpx-hero" aria-labelledby="kpx-heading-u0s96">

<style>
.kpx-hero,
.kpx-hero * { box-sizing: border-box; }
.kpx-hero input,
.kpx-hero textarea,
.kpx-hero select { font: inherit; }

.kpx-hero {
--kpx-ink: #0d0d0d;
--kpx-white: #f5f3ef;
--kpx-gold: #b8965a;
--kpx-gold-l: #d4ae78;
--kpx-muted: rgba(245,243,239,0.48);
--kpx-dur: 0.72s;
--kpx-ease: cubic-bezier(0.22, 1, 0.36, 1);
--kpx-progress-dur: 5000ms;
--kpx-nav-size: 13px;
--kpx-nav-weight: 500;
}

.kpx-hero {
position: relative;
width: 100%;
min-height: 100svh;
background: var(--kpx-ink);
overflow: hidden;
display: flex;
flex-direction: column;
font-family: Arial, sans-serif;
}

/* ════ SLIDESHOW ════ */
.kpx-slides {
position: absolute;
inset: 0;
z-index: 0;
}

.kpx-slide {
position: absolute;
inset: 0;
opacity: 0;
transition: opacity 0.85s ease;
will-change: opacity;
}

.kpx-slide.kpx-slide--active { opacity: 1; }

.kpx-slide img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
filter: brightness(0.72) saturate(0.82);
transform: scale(1.08);
transition: transform 9s ease-out;
}

.kpx-slide.kpx-slide--active img { transform: scale(1); }

.kpx-slides::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(
to top,
rgba(13,13,13,0.92) 0%,
rgba(13,13,13,0.55) 30%,
rgba(13,13,13,0.10) 58%,
transparent 100%
);
pointer-events: none;
}

/* ════ CURTAIN ════ */
.kpx-curtain {
position: absolute;
inset: 0;
z-index: 20;
background: var(--kpx-ink);
clip-path: inset(0 0 0 0);
animation: kpx-curtain-lift-u0s96 1.1s var(--kpx-ease) 0.15s forwards;
pointer-events: none;
}

@keyframes kpx-curtain-lift-u0s96 { to { clip-path: inset(0 0 100% 0); } }

/* ════ NAV ════ */
.kpx-nav {
position: relative;
z-index: 10;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 60px;
height: 72px;
opacity: 0;
animation: kpx-fade-down-u0s96 var(--kpx-dur) var(--kpx-ease) 1.0s forwards;
flex-shrink: 0;
}

.kpx-logo,
.kpx-nav__links a,
.kpx-nav__action {
font-family: Arial, sans-serif;
font-size: var(--kpx-nav-size);
font-weight: var(--kpx-nav-weight);
line-height: 1;
letter-spacing: 0;
text-transform: none;
text-decoration: none;
text-shadow: none;
}

.kpx-logo { color: #ffffff; }

.kpx-nav__links {
display: flex;
gap: 40px;
list-style: none;
margin: 0;
padding: 0;
align-items: center;
}

.kpx-nav__links a {
color: rgba(255,255,255,0.7);
transition: color 0.22s;
}
.kpx-nav__links a:hover { color: #ffffff; }

.kpx-nav__action {
color: #ffffff;
transition: color 0.22s;
}
.kpx-nav__action:hover { color: rgba(255,255,255,0.7); }

/* ════ MAIN CONTENT ════ */
.kpx-body {
position: relative;
z-index: 10;
flex: 1;
display: grid;
grid-template-columns: 1fr 1fr;
align-items: end;
padding: 0 60px 72px;
gap: 48px;
min-height: 0;
}

.kpx-headline { display: flex; flex-direction: column; gap: 0; }

.kpx-title {
font-family: Arial, sans-serif;
font-size: clamp(42px, 6.2vw, 94px);
font-weight: 700;
line-height: 0.96;
letter-spacing: -0.03em;
color: var(--kpx-white);
margin: 0;
text-wrap: balance;
}

.kpx-info {
display: flex;
flex-direction: column;
gap: 32px;
padding-bottom: 6px;
opacity: 0;
transform: translateY(22px);
animation: kpx-fade-up-u0s96 var(--kpx-dur) var(--kpx-ease) 1.55s forwards;
}

.kpx-desc {
font-family: Arial, sans-serif;
font-size: clamp(15px, 1.2vw, 18px);
font-weight: 400;
line-height: 1.65;
color: var(--kpx-muted);
max-width: 46ch;
text-wrap: pretty;
margin: 0;
}

.kpx-actions {
display: flex;
align-items: center;
gap: 20px;
flex-wrap: wrap;
}

/* ════ BUTTON ════ */
.kpx-btn {
display: inline-flex;
align-items: center;
gap: 12px;
font-family: Arial, sans-serif;
font-size: 14px;
font-weight: var(--uc-button-fontweight-CVxwyaO, 600);
letter-spacing: 0.04em;
color: #ffffff;
background: #c7a261;
border: 1.5px solid transparent;
border-radius: 4px;
padding: 18px 36px;
cursor: pointer;
text-decoration: none;
position: relative;
overflow: hidden;
transition: color 0.32s var(--kpx-ease),
background 0.32s var(--kpx-ease),
border-color 0.32s var(--kpx-ease);
}

.kpx-btn:hover {
background: transparent;
border-color: #ffffff;
color: #ffffff;
}

.kpx-btn__text,
.kpx-btn__icon { position: relative; z-index: 1; }

.kpx-btn__icon { transition: transform 0.28s var(--kpx-ease); }
.kpx-btn:hover .kpx-btn__icon { transform: translateX(5px); }

/* ════ BOTTOM BAR ════ */
.kpx-bar {
position: relative;
z-index: 10;
border-top: 1px solid rgba(245,243,239,0.1);
opacity: 0;
animation: kpx-fade-up-u0s96 0.6s var(--kpx-ease) 1.8s forwards;
flex-shrink: 0;
}

.kpx-bar__props {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
width: 100%;
}

/* ════ PROP CARD ════ */
.kpx-prop {
position: relative;
display: flex;
align-items: center;
gap: 16px;
padding: 20px 28px;
cursor: pointer;
transition: background 0.3s ease;
overflow: hidden;
}

.kpx-prop:not(:last-child) { border-right: 1px solid rgba(245,243,239,0.1); }

/* ════ PROGRESS — горизонтальный (desktop) ════ */
.kpx-prop__progress {
position: absolute;
top: 0; left: 0;
width: 100%; height: 2px;
background: rgba(245,243,239,0.08);
overflow: hidden;
}

.kpx-prop__progress-fill {
position: absolute;
inset: 0;
background: var(--kpx-gold);
transform: scaleX(0);
transform-origin: left center;
}

.kpx-prop__progress-fill.kpx-progress--running {
animation: kpx-progress-x-u0s96 var(--kpx-progress-dur) linear forwards;
}

@keyframes kpx-progress-x-u0s96 {
from { transform: scaleX(0); }
to { transform: scaleX(1); }
}

.kpx-prop:hover { background: rgba(245,243,239,0.04); }
.kpx-prop--active { background: rgba(245,243,239,0.07); }

.kpx-prop__thumb {
width: 110px;
height: 70px;
border-radius: 4px;
object-fit: cover;
flex-shrink: 0;
filter: brightness(0.6);
transition: filter 0.35s ease;
}

.kpx-prop--active .kpx-prop__thumb { filter: brightness(1); }
.kpx-prop:hover .kpx-prop__thumb { filter: brightness(0.85); }

.kpx-prop__info {
display: flex;
flex-direction: column;
gap: 3px;
flex: 1;
min-width: 0;
}

.kpx-prop__name {
font-family: Arial, sans-serif;
font-size: 18px;
font-weight: 400;
color: rgba(245,243,239,0.55);
letter-spacing: 0.01em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
transition: color 0.3s ease, font-weight 0.3s ease;
}

.kpx-prop--active .kpx-prop__name { color: var(--kpx-white); font-weight: 600; }

.kpx-prop__loc {
font-family: Arial, sans-serif;
font-size: 14px;
color: rgba(245,243,239,0.3);
letter-spacing: 0.03em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
transition: color 0.3s ease;
}

.kpx-prop--active .kpx-prop__loc { color: rgba(245,243,239,0.5); }

.kpx-prop__arrow {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 32px;
height: 32px;
border-radius: 50%;
border: 1px solid rgba(245,243,239,0.15);
color: rgba(245,243,239,0.35);
text-decoration: none;
transition:
color 0.25s ease,
border-color 0.25s ease,
background 0.25s ease,
transform 0.25s var(--kpx-ease);
position: relative;
z-index: 5;
}

.kpx-prop__arrow svg { transition: transform 0.25s var(--kpx-ease); }

.kpx-prop--active .kpx-prop__arrow {
border-color: rgba(184,150,90,0.45);
color: var(--kpx-gold);
}

.kpx-prop__arrow:hover {
background: var(--kpx-gold);
border-color: var(--kpx-gold);
color: var(--kpx-ink);
}

.kpx-prop__arrow:hover svg { transform: translateX(2px); }

/* ════ HIDDEN DATA FIELDS ════ */
.kpx-field {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
opacity: 0;
pointer-events: none;
white-space: nowrap;
}

/* ════ KEYFRAMES ════ */
@keyframes kpx-fade-down-u0s96 {
from { opacity: 0; transform: translateY(-14px); }
to { opacity: 1; transform: translateY(0); }
}

@keyframes kpx-fade-up-u0s96 {
from { opacity: 0; transform: translateY(18px); }
to { opacity: 1; transform: translateY(0); }
}

@keyframes kpx-fade-in-u0s96 {
from { opacity: 0; }
to { opacity: 1; }
}

/* ════ REDUCED MOTION ════ */
@media (prefers-reduced-motion: reduce) {
.kpx-curtain { animation: none; clip-path: inset(0 0 100% 0); }
.kpx-title__word,
.kpx-nav,
.kpx-info,
.kpx-bar { animation: none; opacity: 1; transform: none; }
.kpx-slide img { transition: none; }
.kpx-prop__progress-fill.kpx-progress--running { animation: none; transform: scaleX(1); }
}

/* ════ RESPONSIVE ════ */
@media (max-width: 960px) {
.kpx-nav { padding: 0 36px; }
.kpx-nav__links { display: none; }
.kpx-body {
grid-template-columns: 1fr;
padding: 48px 36px 60px;
gap: 36px;
align-items: start;
}
.kpx-prop { padding: 16px 20px; gap: 14px; }
.kpx-prop__thumb { width: 72px; height: 52px; }
.kpx-prop__name { font-size: 14px; }
.kpx-prop__loc { font-size: 11px; }
.kpx-prop__arrow { width: 28px; height: 28px; }
.kpx-prop__arrow svg { width: 13px; height: 13px; }
}

@media (max-width: 640px) {
.kpx-hero {
height: var(--kpx-vh, 100svh);
min-height: var(--kpx-vh, 100svh);
max-height: var(--kpx-vh, 100svh);
}

.kpx-nav { padding: 0 20px; height: 60px; }

.kpx-body {
display: flex;
flex-direction: column;
justify-content: flex-end;
padding: 32px 20px 36px;
gap: 0;
align-items: stretch;
overflow: hidden;
}

.kpx-headline { margin-bottom: 20px; }

.kpx-info {
gap: 24px;
padding-bottom: 0;
}

.kpx-title { font-size: clamp(38px, 11vw, 58px); }
.kpx-actions { flex-direction: column; align-items: flex-start; }

.kpx-bar__props { grid-template-columns: 1fr; }

.kpx-prop:not(:last-child) {
border-right: none;
border-bottom: 1px solid rgba(245,243,239,0.1);
}

.kpx-prop {
padding: 14px 20px;
gap: 14px;
align-items: center;
}

/* ── Вертикальная прогресс-полоска на мобильных ── */
.kpx-prop__progress {
top: 0; left: 0;
width: 2px; height: 100%;
background: rgba(245,243,239,0.08);
}

/* Сбрасываем горизонтальный масштаб и переключаемся на вертикальный */
.kpx-prop__progress-fill {
transform: scaleY(0);
transform-origin: top center;
}

.kpx-prop__progress-fill.kpx-progress--running {
animation: kpx-progress-y-u0s96 var(--kpx-progress-dur) linear forwards;
}

@keyframes kpx-progress-y-u0s96 {
from { transform: scaleY(0); }
to { transform: scaleY(1); }
}

.kpx-prop__thumb { width: 64px; height: 48px; border-radius: 3px; }
.kpx-prop__info { gap: 2px; }

.kpx-prop__name {
font-size: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.kpx-prop__loc { font-size: 12px; display: block; }
.kpx-prop__arrow { width: 32px; height: 32px; flex-shrink: 0; }
.kpx-prop__arrow svg { width: 14px; height: 14px; }
}

@media (max-width: 480px) {
.kpx-title { font-size: 46px; }
.kpx-prop__thumb { width: 56px; height: 42px; }
.kpx-prop__name { font-size: 14px; }
}

@media (max-width: 360px) {
.kpx-title { font-size: 42px; }
.kpx-prop__thumb { display: none; }
.kpx-prop__name { font-size: 13px; }
.kpx-desc { width: fit-content; }
}
</style>

<div class="kpx-curtain" aria-hidden="true"></div>

<div class="kpx-slides" aria-hidden="true">
<div class="kpx-slide kpx-slide--active" data-slide="0"><img src="" alt=""></div>
<div class="kpx-slide" data-slide="1"><img src="" alt=""></div>
<div class="kpx-slide" data-slide="2"><img src="" alt=""></div>
</div>

<nav class="kpx-nav" aria-label="Site navigation">
<div class="kpx-logo">Verdur</div>
<ul class="kpx-nav__links">
<li><a href="#">Residences</a></li>
<li><a href="#">Locations</a></li>
<li><a href="#">Studio</a></li>
</ul>
<a href="#" class="kpx-nav__action">+1 000 000 00 00</a>
</nav>

<main class="kpx-body">
<div class="kpx-headline">
<h1 class="kpx-title" id="kpx-heading-u0s96">Built to Belong,
Designed to Last,
Made to Inspire</h1>
</div>

<div class="kpx-info">
<p class="kpx-desc">We select residences where architecture and location are&nbsp;irreplaceable. Not listed elsewhere. Not rushed. Properties that hold their meaning over decades.</p>
<div class="kpx-actions">
<a href="#" class="kpx-btn" id="kpx-cta-u0s96">View Collection</a>
</div>
</div>
</main>

<div class="kpx-bar" id="kpx-bar-u0s96" aria-label="Properties">
<div class="kpx-bar__props" role="list">

<!-- ══ Card 1 ══ -->
<div class="kpx-prop kpx-prop--active" role="listitem" tabindex="0" data-index="0">
<img class="kpx-field js-card-img" src="https://static.tildacdn.com/tild6238-3234-4363-a131-313231343564/photo-1702411200201-.jpg" alt="Meridian Penthouse" data-field="image">
<span class="kpx-field js-card-title" data-field="title">Meridian Penthouse</span>
<span class="kpx-field js-card-location" data-field="location">Tbilisi, Georgia</span>
<a class="kpx-field js-card-url" href="#" data-field="url">Go to property page</a>
<div class="kpx-prop__progress" aria-hidden="true">
<div class="kpx-prop__progress-fill"></div>
</div>
<img class="kpx-prop__thumb" src="" alt="">
<div class="kpx-prop__info">
<div class="kpx-prop__name"></div>
<div class="kpx-prop__loc"></div>
</div>
<a href="#" class="kpx-prop__arrow" aria-label="Go to property page">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true">
<path d="M2 7h10M8 3l4 4-4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</a>
</div>

<!-- ══ Card 2 ══ -->
<div class="kpx-prop" role="listitem" tabindex="0" data-index="1">
<img class="kpx-field js-card-img" src="https://static.tildacdn.com/tild3266-3637-4763-b131-633337623461/5226.jpg" alt="Corten House" data-field="image">
<span class="kpx-field js-card-title" data-field="title">Corten House</span>
<span class="kpx-field js-card-location" data-field="location">Lisbon, Portugal</span>
<a class="kpx-field js-card-url" href="#" data-field="url">Go to property page</a>
<div class="kpx-prop__progress" aria-hidden="true">
<div class="kpx-prop__progress-fill"></div>
</div>
<img class="kpx-prop__thumb" src="" alt="">
<div class="kpx-prop__info">
<div class="kpx-prop__name"></div>
<div class="kpx-prop__loc"></div>
</div>
<a href="#" class="kpx-prop__arrow" aria-label="Go to property page">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true">
<path d="M2 7h10M8 3l4 4-4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</a>
</div>

<!-- ══ Card 3 ══ -->
<div class="kpx-prop" role="listitem" tabindex="0" data-index="2">
<img class="kpx-field js-card-img" src="https://static.tildacdn.com/tild3438-3838-4632-a536-663237373330/photo-1532888277436-.jpg" alt="Glass Residency" data-field="image">
<span class="kpx-field js-card-title" data-field="title">Glass Residency</span>
<span class="kpx-field js-card-location" data-field="location">Vienna, Austria</span>
<a class="kpx-field js-card-url" href="#" data-field="url">Go to property page</a>
<div class="kpx-prop__progress" aria-hidden="true">
<div class="kpx-prop__progress-fill"></div>
</div>
<img class="kpx-prop__thumb" src="" alt="">
<div class="kpx-prop__info">
<div class="kpx-prop__name"></div>
<div class="kpx-prop__loc"></div>
</div>
<a href="#" class="kpx-prop__arrow" aria-label="Go to property page">
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true">
<path d="M2 7h10M8 3l4 4-4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</a>
</div>

</div>
</div>

<script>
(function () {

/* ── Lock viewport height once on load ── */
var hero = document.querySelector('.kpx-hero');

function setVh() {
if (window.innerWidth <= 640) {
hero.style.setProperty('--kpx-vh', window.innerHeight + 'px');
} else {
hero.style.removeProperty('--kpx-vh');
}
}

setVh();

var lastW = window.innerWidth;
window.addEventListener('resize', function () {
if (window.innerWidth !== lastW) {
lastW = window.innerWidth;
setVh();
}
});

/* ── Slideshow ── */
var DURATION = 5000;

var slides = hero.querySelectorAll('.kpx-slide');
var props = hero.querySelectorAll('.kpx-prop');
var bar = hero.querySelector('#kpx-bar-u0s96');

var current = 0;
var timer = null;
var paused = false;

function populateTabs() {
props.forEach(function (prop, i) {
var imgEl = prop.querySelector('.js-card-img');
var titleEl = prop.querySelector('.js-card-title');
var locEl = prop.querySelector('.js-card-location');
var urlEl = prop.querySelector('.js-card-url');

var img = imgEl ? imgEl.src : '';
var name = titleEl ? titleEl.textContent.trim() : '';
var loc = locEl ? locEl.textContent.trim() : '';
var url = urlEl ? urlEl.href : '#';

var slideImg = slides[i] && slides[i].querySelector('img');
if (slideImg) { slideImg.src = img; slideImg.alt = name; }

var thumb = prop.querySelector('.kpx-prop__thumb');
if (thumb) { thumb.src = img; thumb.alt = name; }

var nameEl2 = prop.querySelector('.kpx-prop__name');
var locEl2 = prop.querySelector('.kpx-prop__loc');
if (nameEl2) nameEl2.textContent = name;
if (locEl2) locEl2.textContent = loc;

var arrow = prop.querySelector('.kpx-prop__arrow');
if (arrow) {
arrow.href = url;
arrow.setAttribute('aria-label', 'Go to: ' + name);
}

prop.setAttribute('aria-label', name + (loc ? ', ' + loc : ''));
});
}

function getProgressFill(prop) {
return prop.querySelector('.kpx-prop__progress-fill');
}

function resetProgress(prop) {
var fill = getProgressFill(prop);
fill.classList.remove('kpx-progress--running');
fill.style.animationPlayState = '';
void fill.offsetWidth; /* force reflow */
}

function startProgress(prop) {
resetProgress(prop);
getProgressFill(prop).classList.add('kpx-progress--running');
}

function goTo(idx) {
if (idx === current) return;

slides[current].classList.remove('kpx-slide--active');
props[current].classList.remove('kpx-prop--active');
resetProgress(props[current]);

current = idx;

slides[current].classList.add('kpx-slide--active');
props[current].classList.add('kpx-prop--active');
startProgress(props[current]);
}

function scheduleNext() {
clearTimeout(timer);
timer = setTimeout(function () {
if (!paused) {
goTo((current + 1) % slides.length);
scheduleNext();
}
}, DURATION);
}

function startAutoplay() {
clearTimeout(timer);
scheduleNext();
}

props.forEach(function (prop) {
function activate(e) {
if (e.target.closest('.kpx-prop__arrow')) return;
var idx = parseInt(prop.dataset.index, 10);
if (idx === current) return;
goTo(idx);
startAutoplay();
}
prop.addEventListener('click', activate);
prop.addEventListener('keydown', function (e) {
if (e.key === 'Enter' || e.key === ' ') {
if (e.target.closest('.kpx-prop__arrow')) return;
e.preventDefault();
activate(e);
}
});
});

bar.addEventListener('mouseenter', function () {
paused = true;
clearTimeout(timer);
getProgressFill(props[current]).style.animationPlayState = 'paused';
});

bar.addEventListener('mouseleave', function () {
paused = false;
getProgressFill(props[current]).style.animationPlayState = 'running';
scheduleNext();
});

populateTabs();

setTimeout(function () {
startProgress(props[current]);
startAutoplay();
}, 1300);

})();
</script>

</section>
<style data-vb-overrides="true">
#kpx-heading-u0s96 {
font-size: 72px;
}

.kpx-desc {
color: #ffffff99;
}

.kpx-info {
gap: 40px 32px;
}

@media (max-width: 640px) {
#kpx-heading-u0s96 {
font-size: 60px;
}
}

@media (max-width: 480px) {
#kpx-heading-u0s96 {
font-size: 44px;
}
}

@media (max-width: 360px) {
#kpx-heading-u0s96 {
font-size: 40px;
width: fit-content;
}

.kpx-desc {
font-size: calc(16px);
}
}
</style>
Скопировать код
Что выбрать, промпт или код?
Копируйте промпт, если хотите получить похожий результат, но ввести информацию о своём бизнесе и задать свои требования. Например, изменить кнопки, тексты, цвета, фотографии или другие элементы.
Копируйте код, если хотите получить точно такой же блок. Чтобы его изменить, придётся отредактировать html-код.
Начните создание сайта на Тильде с простой регистрации на платформе
Made on
Tilda