/* ----- BASE (DESKTOP) ----- */
.hcbk-hero-wrapper {
position: relative;
width: 100%;
aspect-ratio: 21 / 9;
overflow: hidden;
background: #ffffff;
font-family: 'Poppins', sans-serif;
min-height: 320px;
max-height: 750px;
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}
.hcbk-hero-wrapper * {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.hcbk-slider-track {
display: flex;
width: 100%;
height: 100%;
transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
will-change: transform;
}
.hcbk-slide {
flex: 0 0 100%;
height: 100%;
position: relative;
overflow: hidden;
background: #ffffff;
}
.hcbk-slide .hcbk-bg-img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: center 30%;
z-index: 1;
display: block;
}
/* Desktop overlay: WHITE RIGHT-TO-LEFT gradient */
.hcbk-slide .hcbk-overlay {
position: absolute;
inset: 0;
z-index: 2;
background:
linear-gradient(270deg,
rgba(255, 255, 255, 0.96) 0%,
rgba(255, 255, 255, 0.90) 22%,
rgba(255, 255, 255, 0.70) 40%,
rgba(255, 255, 255, 0.30) 58%,
rgba(255, 255, 255, 0) 78%);
pointer-events: none;
}
.hcbk-slide .hcbk-content {
position: absolute;
inset: 0;
z-index: 3;
width: 100%;
max-width: min(640px, 46%);
padding: clamp(32px, 5vw, 56px) clamp(36px, 6vw, 64px) 80px;
margin-left: auto;
margin-right: 5%;
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
pointer-events: none;
text-align: right;
align-items: flex-end;
}
.hcbk-slide .hcbk-content>* {
pointer-events: auto;
}
.hcbk-slide .hcbk-headline {
margin: 0 0 16px;
line-height: 1.2;
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: 14px;
row-gap: 4px;
justify-content: flex-end;
}
.hcbk-slide .hcbk-headline .line1 {
display: inline;
color: #1a1a1a;
font-size: clamp(24px, 3.2vw, 42px);
font-weight: 800;
letter-spacing: -0.5px;
white-space: nowrap;
}
.hcbk-slide .hcbk-headline .line2 {
display: inline-flex;
align-items: baseline;
color: #5E0F24;
font-size: clamp(14px, 1.6vw, 19px);
font-weight: 500;
letter-spacing: 0.3px;
}
.hcbk-slide .hcbk-headline .line2::before {
content: "";
display: inline-block;
width: 1px;
height: 0.9em;
background: rgba(0, 0, 0, 0.15);
margin-right: 14px;
transform: translateY(0.05em);
}
.hcbk-slide .hcbk-line {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 22px;
flex-shrink: 0;
}
.hcbk-slide .hcbk-line::before {
content: "◆";
color: #5E0F24;
font-size: 12px;
line-height: 1;
}
.hcbk-slide .hcbk-line span {
width: 64px;
height: 4px;
background: #5E0F24;
border-radius: 30px;
display: block;
}
.hcbk-slide .hcbk-desc {
margin: 0 0 22px;
color: rgba(0, 0, 0, 0.82);
font-size: clamp(14px, 1.4vw, 16px);
font-weight: 400;
line-height: 1.8;
max-width: 520px;
text-align: right;
}
.hcbk-slide .hcbk-desc strong {
font-weight: 600;
color: #5E0F24;
}
.hcbk-slide .hcbk-cta-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16px;
justify-content: flex-end;
}
.hcbk-slide .hcbk-btn-primary,
.hcbk-slide .hcbk-btn-secondary {
display: inline-flex;
align-items: center;
gap: 12px;
padding: 14px 32px;
border-radius: 4px;
text-decoration: none;
font-family: 'Poppins', sans-serif;
font-size: 13px;
font-weight: 600;
letter-spacing: 0.5px;
text-transform: uppercase;
transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
cursor: pointer;
justify-content: center;
white-space: nowrap;
border: 2px solid transparent;
}
.hcbk-slide .hcbk-btn-primary {
background: #5E0F24;
color: #ffffff;
border-color: #5E0F24;
box-shadow: 0 12px 30px rgba(94, 15, 36, 0.25);
}
.hcbk-slide .hcbk-btn-primary:hover {
background: #3d0a17;
border-color: #3d0a17;
color: #ffffff;
transform: translateY(-4px);
box-shadow: 0 16px 40px rgba(94, 15, 36, 0.30);
}
.hcbk-slide .hcbk-btn-primary svg {
width: 16px;
height: 16px;
transition: transform 0.3s ease;
flex-shrink: 0;
stroke: currentColor;
fill: none;
stroke-width: 2.5;
stroke-linecap: round;
stroke-linejoin: round;
}
.hcbk-slide .hcbk-btn-primary:hover svg {
transform: translateX(5px);
}
.hcbk-slide .hcbk-btn-secondary {
background: transparent;
color: #5E0F24;
border-color: #5E0F24;
}
.hcbk-slide .hcbk-btn-secondary:hover {
background: #5E0F24;
color: #ffffff;
border-color: #5E0F24;
transform: translateY(-4px);
box-shadow: 0 10px 28px rgba(94, 15, 36, 0.15);
}
/* Arrows: brand color on white */
.hcbk-nav-arrow {
position: absolute;
top: 50%;
z-index: 10;
transform: translateY(-50%);
width: 48px;
height: 48px;
border-radius: 4px;
background: rgba(255, 255, 255, 0.90);
color: #1a1a1a;
border: 2px solid #5E0F24;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.hcbk-nav-arrow:hover {
background: #5E0F24;
transform: translateY(-50%) scale(1.05);
color: #ffffff;
border-color: #5E0F24;
box-shadow: 0 8px 30px rgba(94, 15, 36, 0.25);
}
.hcbk-nav-arrow.prev {
left: 24px;
}
.hcbk-nav-arrow.next {
right: 24px;
}
.hcbk-nav-arrow svg {
width: 22px;
height: 22px;
stroke: currentColor;
fill: none;
stroke-width: 2.5;
stroke-linecap: round;
stroke-linejoin: round;
}
/* Dots: diamond-shaped, brand color active */
.hcbk-dots {
position: absolute;
bottom: 30px;
left: clamp(32px, 5vw, 60px);
z-index: 10;
display: flex;
gap: 14px;
}
.hcbk-dot {
width: 12px;
height: 12px;
border-radius: 2px;
background: rgba(0, 0, 0, 0.12);
border: none;
cursor: pointer;
transition: all 0.4s ease;
padding: 0;
transform: rotate(45deg);
}
.hcbk-dot.active {
background: #5E0F24;
width: 28px;
border-radius: 2px;
transform: rotate(0deg);
}
.hcbk-dot:hover {
background: #5E0F24;
}
.hcbk-autoplay-toggle {
position: absolute;
bottom: 26px;
right: 26px;
z-index: 10;
background: rgba(255, 255, 255, 0.90);
color: #1a1a1a;
border: 2px solid #5E0F24;
width: 38px;
height: 38px;
border-radius: 4px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.hcbk-autoplay-toggle:hover {
background: #5E0F24;
color: #ffffff;
border-color: #5E0F24;
transform: scale(1.05);
}
.hcbk-autoplay-toggle svg {
width: 18px;
height: 18px;
fill: currentColor;
}
.hcbk-slide .hcbk-content {
opacity: 1;
transition: opacity 0.3s ease 0.1s;
}
.hcbk-slide .hcbk-content.fading {
opacity: 0;
transition: opacity 0.18s ease;
}
/* =========================================================
TABLET
========================================================= */
@media (max-width:1024px) {
.hcbk-hero-wrapper {
min-height: 340px;
max-height: 620px;
}
.hcbk-slide .hcbk-content {
max-width: 62%;
margin-right: 3%;
padding-bottom: 68px;
}
.hcbk-slide .hcbk-headline .line1 {
font-size: clamp(22px, 2.8vw, 32px);
white-space: normal;
}
.hcbk-slide .hcbk-desc {
max-width: 100%;
}
.hcbk-slide .hcbk-line span {
width: 54px;
}
.hcbk-nav-arrow {
width: 42px;
height: 42px;
}
.hcbk-nav-arrow.prev {
left: 14px;
}
.hcbk-nav-arrow.next {
right: 14px;
}
}
/* =========================================================
MOBILE — AUTO HEIGHT BASED ON CONTENT
========================================================= */
@media (max-width:767px) {
.hcbk-hero-wrapper {
aspect-ratio: auto;
min-height: 0;
max-height: none;
height: auto;
overflow: hidden;
background: #ffffff;
border-radius: 0;
box-shadow: none;
}
.hcbk-slider-track {
height: auto;
display: flex;
align-items: stretch;
}
.hcbk-slide {
flex: 0 0 100%;
height: auto;
display: flex;
flex-direction: column;
position: relative;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
background: #ffffff;
scroll-behavior: smooth;
}
/* ---- IMAGE: full width, containing the 1080x1080 square ---- */
.hcbk-slide .hcbk-bg-img {
position: relative;
inset: auto;
width: 100%;
height: auto;
max-height: 45vh;
object-fit: contain;
object-position: center;
z-index: 1;
flex-shrink: 0;
background: #ffffff;
display: block;
margin: 0;
border-radius: 0;
box-shadow: none;
}
/* ---- HIDE overlay on mobile ---- */
.hcbk-slide .hcbk-overlay {
display: none;
}
/* ---- CONTENT: pure white background with brand accents ---- */
.hcbk-slide .hcbk-content {
position: relative;
inset: auto;
z-index: 3;
width: 100%;
max-width: 100%;
margin: 0;
padding: 24px 22px 80px;
display: flex;
flex-direction: column;
justify-content: flex-start;
height: auto;
flex: 1 1 auto;
pointer-events: none;
background: #ffffff;
text-shadow: none;
opacity: 1 !important;
transition: none !important;
text-align: left;
align-items: flex-start;
border-radius: 0;
box-shadow: none;
}
.hcbk-slide .hcbk-content>* {
pointer-events: auto;
}
.hcbk-slide .hcbk-content.fading {
opacity: 1 !important;
transition: none !important;
}
.hcbk-slide .hcbk-headline {
flex-direction: column;
align-items: flex-start;
row-gap: 4px;
margin-bottom: 12px;
justify-content: flex-start;
}
.hcbk-slide .hcbk-headline .line1 {
font-size: clamp(28px, 7vw, 38px);
white-space: normal;
color: #1a1a1a;
text-shadow: none;
letter-spacing: -0.3px;
}
.hcbk-slide .hcbk-headline .line2 {
font-size: clamp(16px, 3.6vw, 20px);
color: #5E0F24;
text-shadow: none;
font-weight: 500;
letter-spacing: 0.2px;
}
.hcbk-slide .hcbk-headline .line2::before {
display: none;
}
.hcbk-slide .hcbk-line {
margin-bottom: 16px;
gap: 10px;
}
.hcbk-slide .hcbk-line::before {
font-size: 14px;
color: #5E0F24;
}
.hcbk-slide .hcbk-line span {
width: 60px;
height: 4px;
background: #5E0F24;
border-radius: 30px;
}
.hcbk-slide .hcbk-desc {
font-size: clamp(14px, 2.2vw, 16px);
line-height: 1.7;
max-width: 100%;
margin-bottom: 16px;
color: rgba(0, 0, 0, 0.82);
text-shadow: none;
text-align: left;
}
.hcbk-slide .hcbk-desc strong {
color: #5E0F24;
font-weight: 600;
}
.hcbk-slide .hcbk-cta-row {
flex-direction: row;
flex-wrap: wrap;
gap: 12px;
width: 100%;
margin-top: 4px;
justify-content: flex-start;
}
.hcbk-slide .hcbk-btn-primary,
.hcbk-slide .hcbk-btn-secondary {
flex: 1 1 auto;
min-width: 130px;
padding: 15px 24px;
font-size: 12px;
letter-spacing: 0.8px;
text-shadow: none;
border-radius: 4px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
border-width: 2px;
text-transform: uppercase;
}
.hcbk-slide .hcbk-btn-primary {
background: #5E0F24;
color: #ffffff;
border-color: #5E0F24;
box-shadow: 0 8px 28px rgba(94, 15, 36, 0.20);
}
.hcbk-slide .hcbk-btn-primary:hover {
background: #3d0a17;
border-color: #3d0a17;
color: #ffffff;
transform: translateY(-3px);
box-shadow: 0 12px 36px rgba(94, 15, 36, 0.25);
}
.hcbk-slide .hcbk-btn-secondary {
background: transparent;
color: #5E0F24;
border-color: #5E0F24;
}
.hcbk-slide .hcbk-btn-secondary:hover {
background: #5E0F24;
color: #ffffff;
border-color: #5E0F24;
transform: translateY(-3px);
box-shadow: 0 8px 24px rgba(94, 15, 36, 0.12);
}
/* ---- Navigation arrows: brand border over image ---- */
.hcbk-nav-arrow {
position: absolute;
top: 22%;
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.92);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
border: 2px solid #5E0F24;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
color: #1a1a1a;
z-index: 20;
border-radius: 4px;
}
.hcbk-nav-arrow.prev {
left: 12px;
}
.hcbk-nav-arrow.next {
right: 12px;
}
.hcbk-nav-arrow svg {
width: 18px;
height: 18px;
stroke: #1a1a1a;
}
.hcbk-nav-arrow:hover {
background: #5E0F24;
border-color: #5E0F24;
color: #ffffff;
transform: translateY(-50%) scale(1.05);
box-shadow: 0 8px 30px rgba(94, 15, 36, 0.20);
}
.hcbk-nav-arrow:hover svg {
stroke: #ffffff;
}
/* ---- Dots: diamond on white ---- */
.hcbk-dots {
position: absolute;
bottom: 20px;
left: 22px;
gap: 12px;
z-index: 20;
}
.hcbk-dot {
width: 10px;
height: 10px;
border-radius: 2px;
background: rgba(0, 0, 0, 0.12);
transform: rotate(45deg);
}
.hcbk-dot.active {
background: #5E0F24;
width: 28px;
border-radius: 2px;
transform: rotate(0deg);
}
.hcbk-dot:hover {
background: #5E0F24;
}
.hcbk-autoplay-toggle {
position: absolute;
bottom: 16px;
right: 16px;
width: 36px;
height: 36px;
background: rgba(255, 255, 255, 0.92);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
border: 2px solid #5E0F24;
color: #1a1a1a;
border-radius: 4px;
z-index: 20;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.hcbk-autoplay-toggle:hover {
background: #5E0F24;
color: #ffffff;
border-color: #5E0F24;
transform: scale(1.05);
}
.hcbk-autoplay-toggle svg {
fill: currentColor;
width: 16px;
height: 16px;
}
/* small advisory text - subtle on white */
.hcbk-slide .hcbk-desc[style*="font-size:11px"] {
font-size: 11px !important;
color: rgba(0, 0, 0, 0.50) !important;
text-shadow: none;
margin-top: -4px !important;
background: rgba(94, 15, 36, 0.05);
padding: 6px 14px;
border-radius: 4px;
display: inline-block;
width: auto;
border-left: 2px solid #5E0F24;
}
}
/* =========================================================
SMALL MOBILE (≤400px)
========================================================= */
@media (max-width:400px) {
.hcbk-slide .hcbk-bg-img {
max-height: 38vh;
}
.hcbk-slide .hcbk-content {
padding: 18px 16px 70px;
}
.hcbk-slide .hcbk-headline .line1 {
font-size: clamp(24px, 6vw, 30px);
}
.hcbk-slide .hcbk-headline .line2 {
font-size: 15px;
}
.hcbk-slide .hcbk-desc {
font-size: 13px;
line-height: 1.6;
margin-bottom: 12px;
}
.hcbk-slide .hcbk-cta-row {
flex-direction: column;
align-items: stretch;
gap: 10px;
}
.hcbk-slide .hcbk-btn-primary,
.hcbk-slide .hcbk-btn-secondary {
width: 100%;
min-width: unset;
padding: 14px 18px;
font-size: 12px;
justify-content: center;
}
.hcbk-nav-arrow {
width: 34px;
height: 34px;
top: 18%;
}
.hcbk-nav-arrow.prev {
left: 8px;
}
.hcbk-nav-arrow.next {
right: 8px;
}
.hcbk-nav-arrow svg {
width: 16px;
height: 16px;
}
.hcbk-dots {
bottom: 16px;
left: 16px;
gap: 10px;
}
.hcbk-dot {
width: 8px;
height: 8px;
}
.hcbk-dot.active {
width: 22px;
}
.hcbk-autoplay-toggle {
bottom: 14px;
right: 14px;
width: 32px;
height: 32px;
}
}
Welcome to Harry's Cake & Bake
Where timeless tradition meets modern artistry
Celebrate with our exclusive collection of cakes, brownies, cookies, cupcakes, and chocolates.
Every piece is perfected with timeless craftsmanship and designed for those who value elegance.
Timeless Luxury Gift Hampers
Perfect for Every Occasion
Our hampers bring together luxurious brownies, chocolates, muffins, cookies, tea cakes, and more.
Carefully crafted and elegantly presented, they are the perfect choice for extraordinary gifting.
The Art of Handcrafted Cakes
Luxury Creations for Every Celebration
Our custom cakes are not mere desserts — they are couture creations of edible art.
Each masterpiece is adorned with luxurious detailing, breathtaking beauty, and unforgettable flavour.
(function() {
'use strict';
const track = document.getElementById('hcbkSliderTrack');
const slides = track.querySelectorAll('.hcbk-slide');
const dots = document.querySelectorAll('.hcbk-dot');
const prevBtn = document.getElementById('hcbkPrevBtn');
const nextBtn = document.getElementById('hcbkNextBtn');
const autoplayToggle =
document.getElementById('hcbkAutoplayToggle');
const autoplayIcon =
document.getElementById('hcbkAutoplayIcon');
const wrapper =
document.getElementById('hcbkHeroSlider');
let currentIndex = 0;
const totalSlides = slides.length;
let isTransitioning = false;
let autoplayInterval = null;
let isAutoplay = true;
const AUTOPLAY_DELAY = 2800;
function goToSlide(index, animate = true) {
if (
isTransitioning ||
index === currentIndex
) {
return;
}
if (index = totalSlides) {
index = 0;
}
isTransitioning = true;
currentIndex = index;
slides.forEach(function(slide) {
const content =
slide.querySelector('.hcbk-content');
if (content) {
content.classList.add('fading');
}
});
track.style.transition = animate ?
'transform 0.45s cubic-bezier(0.22,1,0.36,1)' :
'none';
track.style.transform =
'translateX(-' +
(currentIndex * 100) +
'%)';
dots.forEach(function(dot, i) {
dot.classList.toggle(
'active',
i === currentIndex
);
});
setTimeout(function() {
slides.forEach(function(slide) {
const content =
slide.querySelector('.hcbk-content');
if (content) {
content.classList.remove('fading');
}
});
}, 200);
setTimeout(function() {
isTransitioning = false;
}, 480);
}
function nextSlide() {
if (isTransitioning) {
return;
}
goToSlide(currentIndex + 1);
}
function prevSlide() {
if (isTransitioning) {
return;
}
goToSlide(currentIndex - 1);
}
function startAutoplay() {
if (autoplayInterval) {
clearInterval(autoplayInterval);
}
autoplayInterval =
setInterval(
nextSlide,
AUTOPLAY_DELAY
);
isAutoplay = true;
updateAutoplayIcon();
}
function stopAutoplay() {
if (autoplayInterval) {
clearInterval(
autoplayInterval
);
autoplayInterval = null;
}
isAutoplay = false;
updateAutoplayIcon();
}
function toggleAutoplay() {
if (isAutoplay) {
stopAutoplay();
} else {
startAutoplay();
}
}
function updateAutoplayIcon() {
if (!autoplayIcon) {
return;
}
if (isAutoplay) {
autoplayIcon.innerHTML =
'' +
'';
} else {
autoplayIcon.innerHTML =
'';
}
}
wrapper.querySelectorAll('.hcbk-cta-row, .hcbk-nav-arrow, .hcbk-dots, .hcbk-autoplay-toggle').forEach(function(el) {
el.addEventListener('mouseenter', function() {
if (isAutoplay && autoplayInterval) {
clearInterval(autoplayInterval);
autoplayInterval = null;
}
});
el.addEventListener('mouseleave', function() {
if (isAutoplay && !autoplayInterval) {
autoplayInterval = setInterval(nextSlide, AUTOPLAY_DELAY);
}
});
});
document.addEventListener('visibilitychange', function() {
if (!isAutoplay) return;
if (document.hidden) {
if (autoplayInterval) {
clearInterval(autoplayInterval);
autoplayInterval = null;
}
} else if (!autoplayInterval) {
autoplayInterval = setInterval(nextSlide, AUTOPLAY_DELAY);
}
});
dots.forEach(function(dot) {
dot.addEventListener(
'click',
function() {
const index =
parseInt(
this.getAttribute('data-index'),
10
);
if (
index !== currentIndex &&
!isTransitioning
) {
goToSlide(index);
if (isAutoplay) {
stopAutoplay();
startAutoplay();
}
}
}
);
});
prevBtn.addEventListener(
'click',
function(e) {
e.stopPropagation();
prevSlide();
if (isAutoplay) {
stopAutoplay();
startAutoplay();
}
}
);
nextBtn.addEventListener(
'click',
function(e) {
e.stopPropagation();
nextSlide();
if (isAutoplay) {
stopAutoplay();
startAutoplay();
}
}
);
autoplayToggle.addEventListener(
'click',
function(e) {
e.stopPropagation();
toggleAutoplay();
}
);
document.addEventListener(
'keydown',
function(e) {
if (e.key === 'ArrowLeft') {
e.preventDefault();
prevSlide();
if (isAutoplay) {
stopAutoplay();
startAutoplay();
}
} else if (e.key === 'ArrowRight') {
e.preventDefault();
nextSlide();
if (isAutoplay) {
stopAutoplay();
startAutoplay();
}
}
}
);
let touchStartX = 0;
let touchStartY = 0;
let touchEndX = 0;
let isSwiping = false;
wrapper.addEventListener('touchstart', function(e) {
touchStartX = e.changedTouches[0].screenX;
touchStartY = e.changedTouches[0].screenY;
isSwiping = true;
}, { passive: true });
wrapper.addEventListener('touchmove', function(e) {
if (!isSwiping) return;
const deltaX = e.changedTouches[0].screenX - touchStartX;
const deltaY = e.changedTouches[0].screenY - touchStartY;
if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > 10) {
e.preventDefault();
}
}, { passive: false });
wrapper.addEventListener(
'touchend',
function(e) {
if (!isSwiping) {
return;
}
touchEndX =
e.changedTouches[0].screenX;
const diff =
touchStartX -
touchEndX;
if (
Math.abs(diff) > 50
) {
if (diff > 0) {
nextSlide();
} else {
prevSlide();
}
if (isAutoplay) {
stopAutoplay();
startAutoplay();
}
}
isSwiping = false;
}, {
passive: true
}
);
track.style.transform =
'translateX(0%)';
dots.forEach(function(dot, i) {
dot.classList.toggle(
'active',
i === 0
);
});
startAutoplay();
let resizeTimeout;
window.addEventListener(
'resize',
function() {
clearTimeout(
resizeTimeout
);
resizeTimeout =
setTimeout(
function() {
track.style.transition =
'none';
track.style.transform =
'translateX(-' +
(currentIndex * 100) +
'%)';
setTimeout(
function() {
track.style.transition =
'transform 0.45s cubic-bezier(0.22,1,0.36,1)';
},
50
);
},
200
);
}
);
/* Unique global object to avoid conflict */
window.hcbkSlider = {
goTo: goToSlide,
next: nextSlide,
prev: prevSlide,
toggleAutoplay: toggleAutoplay,
currentIndex: function() {
return currentIndex;
},
isAutoplay: function() {
return isAutoplay;
}
};
})();