From fc87c009806dcc98867f6b58efe29b042aa01dee Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 18 May 2026 23:10:59 +0800 Subject: node: update --- node_modules/swup/src/modules/Classes.ts | 54 -------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 node_modules/swup/src/modules/Classes.ts (limited to 'node_modules/swup/src/modules/Classes.ts') diff --git a/node_modules/swup/src/modules/Classes.ts b/node_modules/swup/src/modules/Classes.ts deleted file mode 100644 index 7e034511..00000000 --- a/node_modules/swup/src/modules/Classes.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type Swup from '../Swup.js'; -import { queryAll } from '../utils.js'; - -export class Classes { - protected swup: Swup; - protected swupClasses = [ - 'to-', - 'is-changing', - 'is-rendering', - 'is-popstate', - 'is-animating', - 'is-leaving' - ]; - - constructor(swup: Swup) { - this.swup = swup; - } - - protected get selectors(): string[] { - const { scope } = this.swup.visit.animation; - if (scope === 'containers') return this.swup.visit.containers; - if (scope === 'html') return ['html']; - if (Array.isArray(scope)) return scope; - return []; - } - - protected get selector(): string { - return this.selectors.join(','); - } - - protected get targets(): HTMLElement[] { - if (!this.selector.trim()) return []; - return queryAll(this.selector); - } - - add(...classes: string[]): void { - this.targets.forEach((target) => target.classList.add(...classes)); - } - - remove(...classes: string[]): void { - this.targets.forEach((target) => target.classList.remove(...classes)); - } - - clear(): void { - this.targets.forEach((target) => { - const remove = target.className.split(' ').filter((c) => this.isSwupClass(c)); - target.classList.remove(...remove); - }); - } - - protected isSwupClass(className: string): boolean { - return this.swupClasses.some((c) => className.startsWith(c)); - } -} -- cgit v1.2.3