From 3c949f552969b65ef6d4d03944ee2d3e37aba356 Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 28 Feb 2024 21:53:30 -0800 Subject: [PATCH] #61 updates main.js --- assets/js/main.js | 50 +++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 79f34ee63..63fb93922 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,23 +1,35 @@ -// IMPORTS GO HERE -import accessibleMenu from "../../views/components/header/accessible-menu"; -import navigation from "../../views/components/header/navigation"; -import skipLinkFocusFix from "./components/skip-link-focus-fix"; +/* IMPORTS GO HERE */ +import accessibleMenu from "../../views/organisms/header/display/accessible-menu"; +import mobileMenu from "../../views/organisms/header/display/mobile-menu"; +import skipLinkFocusFix from "../../views/organisms/header/display/skip-link-focus-fix"; -async function init () { - /* Load JS for blocks only if they exist on the page */ - // https://parceljs.org/features/code-splitting/ - // Accordion - const accordionsList = document.querySelector(".accordion"); - if (accordionsList) { - const accordionsJS = await import('../../views/blocks/accordion/accordion'); - accordionsJS.render(); - } +async function init() { + /* Load JS for blocks only if they exist on the page */ + /* https://parceljs.org/features/code-splitting/ */ + /* Accordion */ + const accordionsList = document.querySelector(".accordion"); + if (accordionsList) { + const accordionsJS = await import( '../../views/organisms/blocks/accordion/display/accordion' ); + accordionsJS.render(); + } + /* People Cards */ + const peopleCardsGrid = document.querySelector(".people-cards"); + if (peopleCardsGrid) { + const peopleCardsJS = await import('../../views/organisms/blocks/people-cards/display/people-cards.js'); + peopleCardsJS.render(); + } + /* Video Element */ + const videoElement = document.querySelector('.video-container'); + if (videoElement) { + const videoJS = await import("../../views/organisms/blocks/banner/display/banner.js"); + videoJS.render(); + } - // Global Components - skipLinkFocusFix(); - accessibleMenu(); - navigation(); + /* Global Components */ + skipLinkFocusFix(); + accessibleMenu(); + mobileMenu(); } -// Initialize Site Scripts -init(); \ No newline at end of file +/* Initialize Site Scripts */ +init();