current progress
This commit is contained in:
219
assets/js/index.js
Normal file
219
assets/js/index.js
Normal file
@@ -0,0 +1,219 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./src/modules/CollapsePanel.js":
|
||||
/*!**************************************!*\
|
||||
!*** ./src/modules/CollapsePanel.js ***!
|
||||
\**************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
class CollapsePanel {
|
||||
constructor() {
|
||||
this.toggles = document.querySelectorAll('.accordion-toggle');
|
||||
this.toggleCollapse();
|
||||
}
|
||||
toggleCollapse() {
|
||||
this.toggles.forEach(toggle => {
|
||||
toggle.addEventListener('click', () => {
|
||||
toggle.parentNode.parentNode.classList.toggle('active');
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CollapsePanel);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/modules/NavControl.js":
|
||||
/*!***********************************!*\
|
||||
!*** ./src/modules/NavControl.js ***!
|
||||
\***********************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
class Nav {
|
||||
constructor() {
|
||||
this.toggleMenuBtn = document.getElementById('toggle-nav');
|
||||
this.toggleSlideOutMenu = document.getElementById('slide-out-menu');
|
||||
this.accordions = document.querySelectorAll('.accordion');
|
||||
this.toggleCollapse();
|
||||
this.events();
|
||||
}
|
||||
events() {
|
||||
// Open and Close the Nav Menu
|
||||
this.toggleMenuBtn.addEventListener('click', () => this.toggleNavMenu());
|
||||
}
|
||||
toggleNavMenu() {
|
||||
this.toggleMenuBtn.classList.toggle('active');
|
||||
this.toggleSlideOutMenu.classList.toggle('open');
|
||||
document.body.classList.toggle('noScroll');
|
||||
this.toggleCollapse();
|
||||
}
|
||||
toggleCollapse() {
|
||||
setTimeout(() => {
|
||||
this.accordions.forEach(accordion => {
|
||||
accordion.classList.remove('active');
|
||||
});
|
||||
}, 600);
|
||||
}
|
||||
}
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Nav);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/modules/SplashScreen.js":
|
||||
/*!*************************************!*\
|
||||
!*** ./src/modules/SplashScreen.js ***!
|
||||
\*************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
class SplashScreen {
|
||||
constructor() {
|
||||
this.enterBtn = document.getElementById('app-enter');
|
||||
this.splashScreen = document.getElementById('splash-screen');
|
||||
this.headerNav = document.getElementById('header-nav');
|
||||
this.footerNav = document.getElementById('footer-nav');
|
||||
this.events();
|
||||
}
|
||||
events() {
|
||||
// Open and Close the Nav Menu
|
||||
if (this.enterBtn) {
|
||||
this.enterBtn.addEventListener('click', () => this.enterApp());
|
||||
}
|
||||
}
|
||||
enterApp() {
|
||||
this.splashScreen.classList.add('close');
|
||||
setTimeout(() => {
|
||||
this.headerNav.classList.add('in-view');
|
||||
this.footerNav.classList.add('in-view');
|
||||
this.splashScreen.classList.add('hidden');
|
||||
}, 600);
|
||||
setTimeout(() => {
|
||||
this.headerNav.classList.remove('out-of-view');
|
||||
this.footerNav.classList.remove('out-of-view');
|
||||
this.headerNav.classList.remove('in-view');
|
||||
this.footerNav.classList.remove('in-view');
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SplashScreen);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/modules/TestModule.js":
|
||||
/*!***********************************!*\
|
||||
!*** ./src/modules/TestModule.js ***!
|
||||
\***********************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
class Test {
|
||||
constructor() {
|
||||
console.log('This Module is for testing purposes');
|
||||
}
|
||||
}
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Test);
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
||||
(() => {
|
||||
/*!**********************!*\
|
||||
!*** ./src/index.js ***!
|
||||
\**********************/
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _modules_TestModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modules/TestModule */ "./src/modules/TestModule.js");
|
||||
/* harmony import */ var _modules_NavControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modules/NavControl */ "./src/modules/NavControl.js");
|
||||
/* harmony import */ var _modules_CollapsePanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modules/CollapsePanel */ "./src/modules/CollapsePanel.js");
|
||||
/* harmony import */ var _modules_SplashScreen__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/SplashScreen */ "./src/modules/SplashScreen.js");
|
||||
// Our modules / classes
|
||||
// Import modules e.g import MobileMenu from "./modules/MobileMenu"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Instantiate a new object using our modules/classes
|
||||
// e.g var mobileMenu = new MobileMenu()
|
||||
|
||||
var testModule = new _modules_TestModule__WEBPACK_IMPORTED_MODULE_0__["default"]();
|
||||
var navControl = new _modules_NavControl__WEBPACK_IMPORTED_MODULE_1__["default"]();
|
||||
var collapsePanel = new _modules_CollapsePanel__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
||||
var splashScreen = new _modules_SplashScreen__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
||||
})();
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=index.js.map
|
Reference in New Issue
Block a user