Released New Website

This commit is contained in:
2026-08-21 14:48:57 -07:00
parent e58db3d719
commit ade74f1280
86 changed files with 3683 additions and 276 deletions

29
src/scripts/utils/dom.js Normal file
View File

@@ -0,0 +1,29 @@
export function prefersReducedMotion() {
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
}
export function isMobileViewport() {
return window.matchMedia('(max-width: 768px)').matches;
}
export function qs(selector, root = document) {
return root.querySelector(selector);
}
export function qsa(selector, root = document) {
return Array.from(root.querySelectorAll(selector));
}
export function createElement(tag, className) {
const el = document.createElement(tag);
if (className) el.className = className;
return el;
}
export function debounce(fn, delay) {
let timeoutId = null;
return (...args) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => fn(...args), delay);
};
}