Global Scripts & Interactions
Another advanced area that can confuse both beginners and experienced users is Lumio’s client-side behavior.
A lot of interaction logic is centralized in:
src/layouts/components/widgets/GlobalScripts.astro
What It Does
This file bootstraps interactive behavior for the whole site, including:
- Lucide icon hydration
- dynamic Preline component loading
- AOS animation setup
- smooth scrolling
- button hover effects
- magnetic interactions
- horizontal-scroll helpers
Why It Is Structured This Way
Lumio avoids eagerly loading all client-side features up front. Instead, GlobalScripts.astro waits for:
DOMContentLoaded- idle time
- or the first meaningful interaction
before importing heavier client modules.
That keeps initial page load lighter than putting every script on every page immediately.
Example Pattern Used
const loadDynamicModule = async (key, importer) => { const mod = await importer(); return mod;};Then features are loaded only if the DOM needs them, for example:
- AOS if
[data-aos]elements exist - Preline overlay if
.hs-overlayexists - Lucide only if
[data-lucide]exists
Why This Matters When Debugging
If an interaction appears “broken,” it may not be a markup problem alone. The issue could be:
- missing DOM selectors
- reduced-motion conditions
- viewport conditions
- a missing dynamic import
- a feature only initializing after user interaction
Related Files You May Need
src/layouts/components/widgets/Search.astrosrc/layouts/components/widgets/ContactForm.astrosrc/layouts/components/global/header/*.astrosrc/plugins/
Rule Of Thumb
If the problem is visual structure, start in the Astro component.
If the problem is hydration, animations, dynamic imports, or interaction timing, check GlobalScripts.astro and the specific widget file next.