Skip to content

Commit 3d655eb

Browse files
committed
build error fixes
1 parent d1811f0 commit 3d655eb

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/components/image/ImageCarousel.astro

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,19 @@ const carouselId = `carousel-${Math.random().toString(36).substr(2, 9)}`;
6262

6363
<script>
6464
class ImageCarousel {
65-
constructor(element) {
65+
element: HTMLElement;
66+
currentIndex: number;
67+
interval: number;
68+
autoplay: boolean;
69+
isPlaying: boolean;
70+
timer: NodeJS.Timeout | null;
71+
slides: NodeListOf<Element>;
72+
dots: NodeListOf<Element>;
73+
74+
constructor(element: HTMLElement) {
6675
this.element = element;
6776
this.currentIndex = 0;
68-
this.interval = parseInt(element.dataset.interval) * 1000 || 2000;
77+
this.interval = parseInt(element.dataset.interval || '2') * 1000 || 2000;
6978
this.autoplay = element.dataset.autoplay !== 'false'; // Default to true unless explicitly false
7079
this.isPlaying = false;
7180
this.timer = null;
@@ -84,7 +93,7 @@ const carouselId = `carousel-${Math.random().toString(36).substr(2, 9)}`;
8493

8594
init() {
8695
// Add event listeners for dots
87-
this.dots.forEach((dot, index) => {
96+
this.dots.forEach((dot: Element, index: number) => {
8897
dot.addEventListener('click', () => this.goToSlide(index));
8998
});
9099

@@ -101,7 +110,7 @@ const carouselId = `carousel-${Math.random().toString(36).substr(2, 9)}`;
101110
}
102111
}
103112

104-
goToSlide(index) {
113+
goToSlide(index: number) {
105114
// Remove active class from current slide and dot
106115
this.slides[this.currentIndex]?.classList.remove('active');
107116
this.dots[this.currentIndex]?.classList.remove('active');
@@ -158,9 +167,9 @@ const carouselId = `carousel-${Math.random().toString(36).substr(2, 9)}`;
158167
const carousels = document.querySelectorAll('.image-carousel:not(.single-image):not([data-initialized])');
159168
console.log('Found carousels to initialize:', carousels.length);
160169

161-
carousels.forEach(carousel => {
170+
carousels.forEach((carousel: Element) => {
162171
carousel.setAttribute('data-initialized', 'true');
163-
new ImageCarousel(carousel);
172+
new ImageCarousel(carousel as HTMLElement);
164173
});
165174
}
166175

src/pages/404.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const tags = [
2525
url={url}
2626
tags={tags}
2727
>
28-
<Navigation />
28+
<Navigation activeSlug="404" />
2929

3030
<main id="error-page">
3131
<FlexibleSection

0 commit comments

Comments
 (0)