diff --git a/src/components/common/SearchDialog.vue b/src/components/common/SearchDialog.vue index 03e7a91..d2d9fc7 100644 --- a/src/components/common/SearchDialog.vue +++ b/src/components/common/SearchDialog.vue @@ -132,7 +132,7 @@ const keyboardNav = ref(false); const topGradientOpacity = ref(0); const bottomGradientOpacity = ref(1); const searchValue = ref(''); -let debounceTimer: any = null; +let debounceTimer: ReturnType | null = null; interface SearchResult { categoryName: string; diff --git a/src/content/Components/CircularGallery/CircularGallery.vue b/src/content/Components/CircularGallery/CircularGallery.vue index 6dbc450..a8943f1 100644 --- a/src/content/Components/CircularGallery/CircularGallery.vue +++ b/src/content/Components/CircularGallery/CircularGallery.vue @@ -42,12 +42,16 @@ function lerp(p1: number, p2: number, t: number): number { return p1 + (p2 - p1) * t; } -function autoBind(instance: Record): void { - const proto = Object.getPrototypeOf(instance); +function autoBind(instance: T): void { + const proto = Object.getPrototypeOf(instance) as Record | null; + if (!proto) return; Object.getOwnPropertyNames(proto).forEach(key => { - if (key !== 'constructor' && typeof instance[key] === 'function') { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - instance[key] = (instance[key] as any).bind(instance); + if (key !== 'constructor') { + const desc = Object.getOwnPropertyDescriptor(proto, key); + if (desc && typeof desc.value === 'function') { + const fn = desc.value as (...args: unknown[]) => unknown; + (instance as Record)[key] = fn.bind(instance); + } } }); } @@ -107,8 +111,7 @@ class Title { mesh!: Mesh; constructor({ gl, plane, renderer, text, textColor = '#545050', font = '30px sans-serif' }: TitleProps) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - autoBind(this as any); + autoBind(this); this.gl = gl; this.plane = plane; this.renderer = renderer; @@ -590,8 +593,9 @@ class App { onWheel(e: Event) { const wheelEvent = e as WheelEvent; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const delta = wheelEvent.deltaY || (wheelEvent as any).wheelDelta || (wheelEvent as any).detail; + // Support legacy wheel events if present + const legacy = wheelEvent as unknown as { wheelDelta?: number; detail?: number }; + const delta = wheelEvent.deltaY ?? legacy.wheelDelta ?? legacy.detail ?? 0; this.scroll.target += delta > 0 ? this.scrollSpeed : -this.scrollSpeed; this.onCheckDebounce(); } diff --git a/src/content/Components/FlyingPosters/FlyingPosters.vue b/src/content/Components/FlyingPosters/FlyingPosters.vue index c8036dc..e5878eb 100644 --- a/src/content/Components/FlyingPosters/FlyingPosters.vue +++ b/src/content/Components/FlyingPosters/FlyingPosters.vue @@ -156,8 +156,11 @@ void main() { } `; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function AutoBind(self: any, { include, exclude }: AutoBindOptions = {}) { +type MethodNames = { + [K in keyof T]: T[K] extends (...args: unknown[]) => unknown ? K : never; +}[keyof T]; + +function AutoBind(self: T, { include, exclude }: AutoBindOptions = {}) { const getAllProperties = (object: object): Set<[object, string | symbol]> => { const properties = new Set<[object, string | symbol]>(); let currentObject: object | null = object; @@ -178,11 +181,18 @@ function AutoBind(self: any, { include, exclude }: AutoBindOptions = {}) { return true; }; - for (const [object, key] of getAllProperties(self.constructor.prototype)) { + const proto = Object.getPrototypeOf(self); + if (!proto) return self; + for (const [object, key] of getAllProperties(proto)) { if (key === 'constructor' || !filter(key)) continue; const descriptor = Reflect.getOwnPropertyDescriptor(object, key); if (descriptor && typeof descriptor.value === 'function' && typeof key === 'string') { - self[key] = self[key].bind(self); + const current = (self as Record)[key]; + if (typeof current === 'function') { + (self as Record, unknown>)[key as MethodNames] = ( + current as (...a: unknown[]) => unknown + ).bind(self); + } } } return self; diff --git a/src/content/TextAnimations/RotatingText/RotatingText.vue b/src/content/TextAnimations/RotatingText/RotatingText.vue index bc71ef0..b7ba28c 100644 --- a/src/content/TextAnimations/RotatingText/RotatingText.vue +++ b/src/content/TextAnimations/RotatingText/RotatingText.vue @@ -59,14 +59,20 @@ let intervalId: ReturnType | null = null; const splitIntoCharacters = (text: string): string[] => { if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const segmenter = new (Intl as any).Segmenter('en', { granularity: 'grapheme' }); + const IntlWithSegmenter = Intl as typeof Intl & { + Segmenter: new ( + locales?: string | string[], + options?: { granularity: 'grapheme' | 'word' | 'sentence' } + ) => { + segment: (text: string) => Iterable<{ segment: string }>; + }; + }; + const segmenter = new IntlWithSegmenter.Segmenter('en', { granularity: 'grapheme' }); return [...segmenter.segment(text)].map(({ segment }) => segment); } return [...text]; }; - const elements = computed((): WordElement[] => { const currentText = props.texts[currentTextIndex.value]; diff --git a/src/css/category.css b/src/css/category.css index 8e6d95e..2f837bd 100644 --- a/src/css/category.css +++ b/src/css/category.css @@ -86,12 +86,10 @@ } .demo-container { - min-height: 500px; position: relative; width: 100%; background: #0b0b0b; border: 1px solid #333; - padding: 1em; margin-top: 1.4rem; border-radius: 20px; display: flex; diff --git a/src/demo/Animations/AnimatedContentDemo.vue b/src/demo/Animations/AnimatedContentDemo.vue index d0346c2..feb71ee 100644 --- a/src/demo/Animations/AnimatedContentDemo.vue +++ b/src/demo/Animations/AnimatedContentDemo.vue @@ -1,7 +1,7 @@