vendor: 91 bytes, lines 1-4
1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ "./src/
4js/theme.js": 5/*!*************************!*\ 6 !*** ./src/js/theme.js ***! 7 \*************************/ 8/***/ (() => { 9 10function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 11function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 12function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 13function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 14function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 15function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 16/* *** 17 * Class: Accordion 18 * Description: Adds a simple animation to the WP details block, so it opens and closes smoothly 19 * Ref: https://css-tricks.com/how-to-animate-the-details-element-using-waapi/ 20 * ***/ 21var Accordion = /*#__PURE__*/function () { 22 function Accordion(el) { 23 var _this = this; 24 _classCallCheck(this, Accordion); 25 // Store the <details> element 26 this.el = el; 27 // Store the <summary> element 28 this.summary = el.querySelector('summary'); 29 // Store the <div class="content"> element 30 this.content = el.querySelector('.wp-block-details__content'); 31 32 // Store the animation object (so we can cancel it if needed) 33 this.animation = null; 34 // Store if the element is closing 35 this.isClosing = false; 36 // Store if the element is expanding 37 this.isExpanding = false; 38 // Detect user clicks on the summary element 39 this.summary.addEventListener('click', function (e) { 40 return _this.onClick(e); 41 }); 42 } 43 return _createClass(Accordion, [{ 44 key: "onClick", 45 value: function onClick(e) { 46 // Stop default behaviour from the browser 47 e.preventDefault(); 48 // Add an overflow on the <details> to avoid content overflowing 49 this.el.style.overflow = 'hidden'; 50 // Check if the element is being closed or is already closed 51 if (this.isClosing || !this.el.open) { 52 this.open(); 53 // Check if the element is being openned or is already open 54 } else if (this.isExpanding || this.el.open) { 55 this.shrink(); 56 } 57 } 58 }, { 59 key: "shrink", 60 value: function shrink() { 61 var _this2 = this; 62 // Set the element as "being closed" 63 this.isClosing = true; 64 65 // Store the current height of the element 66 var startHeight = "".concat(this.el.offsetHeight, "px"); 67 // Calculate the height of the summary 68 var endHeight = "".concat(this.summary.offsetHeight, "px"); 69 70 // If there is already an animation running 71 if (this.animation) { 72 // Cancel the current animation 73 this.animation.cancel(); 74 } 75 76 // Start a WAAPI animation 77 this.animation = this.el.animate({ 78 // Set the keyframes from the startHeight to endHeight 79 height: [startHeight, endHeight] 80 }, { 81 duration: 400, 82 easing: 'ease-out' 83 }); 84 85 // When the animation is complete, call onAnimationFinish() 86 this.animation.onfinish = function () { 87 return _this2.onAnimationFinish(false); 88 }; 89 // If the animation is cancelled, isClosing variable is set to false 90 this.animation.oncancel = function () { 91 return _this2.isClosing = false; 92 }; 93 } 94 }, { 95 key: "open", 96 value: function open() { 97 var _this3 = this; 98 // Apply a fixed height on the element 99 this.el.style.height = "".concat(this.el.offsetHeight, "px"); 100 // Force the [open] attribute on the details element 101 this.el.open = true; 102 // Wait for the next frame to call the expand function 103 window.requestAnimationFrame(function () { 104 return _this3.expand(); 105 }); 106 } 107 }, { 108 key: "expand", 109 value: function expand() { 110 var _this4 = this; 111 // Set the element as "being expanding" 112 this.isExpanding = true; 113 // Get the current fixed height of the element 114 var startHeight = "".concat(this.el.offsetHeight, "px"); 115 // Calculate the open height of the element (summary height + content height) 116 var endHeight = "".concat(this.summary.offsetHeight + this.content.offsetHeight, "px"); 117 118 // If there is already an animation running 119 if (this.animation) { 120 // Cancel the current animation 121 this.animation.cancel(); 122 } 123 124 // Start a WAAPI animation 125 this.animation = this.el.animate({ 126 // Set the keyframes from the startHeight to endHeight 127 height: [startHeight, endHeight] 128 }, { 129 duration: 400, 130 easing: 'ease-out' 131 }); 132 // When the animation is complete, call onAnimationFinish() 133 this.animation.onfinish = function () { 134 return _this4.onAnimationFinish(true); 135 }; 136 // If the animation is cancelled, isExpanding variable is set to false 137 this.animation.oncancel = function () { 138 return _this4.isExpanding = false;
139 }; 140 } 141 }, { 142 key: "onAnimationFinish", 143 value: function onAnimationFinish(open) { 144 // Set the open attribute based on the parameter 145 this.el.open = open; 146 // Clear the stored animation 147 this.animation = null; 148 // Reset isClosing & isExpanding 149 this.isClosing = false; 150 this.isExpanding = false; 151 // Remove the overflow hidden and the fixed height 152 this.el.style.height = this.el.style.overflow = ''; 153 } 154 }]); 155}(); 156document.addEventListener("DOMContentLoaded", function () { 157 // Close open dialogs by clicking on their backdrop 158 if (document.getElementsByName('dialog').length) { 159 document.querySelector('dialog').addEventListener('mousedown', function (event) { 160 if (event.target === event.currentTarget) { 161 event.currentTarget.close(); 162 } 163 }); 164 } 165 166 /* *** 167 * Target/Focus: GP Popups 168 * Description: Make all popups scrollable 169 * ***/ 170 document.querySelectorAll('[class*="open-popup--"]').forEach(function (el) { 171 el.addEventListener('click', function (ev) { 172 setTimeout(function () { 173 // A setTimeout with a time of zero will run after all synchronous click handlers finish 174 document.querySelectorAll('.gp-popup__iframe').forEach(function (obj) { 175 obj.setAttribute('scrolling', 'yes'); 176 }); 177 }); 178 }); 179 }); 180 var menu_test = document.getElementById('menu_test'); 181 if (menu_test) { 182 menu_test.addEventListener('click', function (event) { 183 var main_menu = document.querySelector('nav.wp-block-navigation[aria-label="Main Menu"]'); 184 main_menu.classList.add('is-menu-open'); 185 var main_menu_first_item_toggle = main_menu.querySelector('li:first-child > button.wp-block-navigation-submenu__toggle'); 186 main_menu_first_item_toggle.setAttribute('aria-expanded', 'true'); 187 }); 188 } 189 190 /* *** 191 * Target/Focus: WP Navigation Block 192 * Description: Update aria label on sub-menu toggles so it matches what we're after. 193 * ***/ 194 document.querySelectorAll('button.wp-block-navigation-submenu__toggle').forEach(function (el) { 195 var aria_label = el.getAttribute('aria-label'); 196 el.setAttribute('aria-label', aria_label.replace(' submenu', '')); 197 }); 198 var main_menu_toggle = document.querySelector('#menu-toggle--custom > a'); 199 if (main_menu_toggle) { 200 main_menu_toggle.addEventListener('click', function (ev) { 201 ev.preventDefault(); 202 var main_menu = document.querySelector('nav.wp-block-navigation[aria-label="Main Menu"]'); 203 204 // Check if menu is open 205 var open_sub_menu_toggle = main_menu.querySelector('button.wp-block-navigation-submenu__toggle[aria-expanded="true"]'); 206 if (main_menu.classList.contains('is-menu-open')) { 207 // Menu is open -> close it. We can safely update the attributes and classes here, as WP seems to respect everything in this case 208 main_menu.classList.add('nav--closing'); 209 main_menu.classList.remove('is-menu-open'); 210 if (open_sub_menu_toggle) { 211 open_sub_menu_toggle.setAttribute('aria-expanded', "false"); 212 } 213 setTimeout(function () { 214 main_menu.classList.remove('nav--opening', 'nav--closing', 'nav--switching'); 215 }, 1000); 216 } else { 217 // Menu is closed -> open it. Don't try to mess around with updating any of the classes or attributes, just fire the click event on the main menu's first item toggle. Let WP handle it from there. 218 var main_menu_first_item_toggle = main_menu.querySelector('li:first-child > button.wp-block-navigation-submenu__toggle'); 219 main_menu_first_item_toggle.click(); 220 } 221 }); 222 } 223 224 // This event fires alongside the WP nav menu click event. Will need to ensure that event order is consistent. 225 document.querySelectorAll('button.wp-block-navigation-submenu__toggle').forEach(function (el) { 226 el.addEventListener('click', function () { 227 // There's a bit happening here: 228 // 1. First, we need to determine if the menu is open already. 229 // a. If it is, move to step 2. If not, just open it and end. 230 // 2. OK, so the menu is open. Next thing we want to know is which menu is open? Is it the menu associated with the item clicked? 231 // a. If not, move to step 3. If yes, then close it and end. 232 // 3. In this step, we need to close the menu that was open, and open the target menu. Once that's done, we're finished. 233
234 // Now the tricky part. WordPress is going to take care of at least some of this for us. If we're jumping ahead of WP, we need to ensure that we don't do work that WP will then undo. 235 // If you want to do our work after the WP click event, use this: 236 /* 237 setTimeout(function() { 238 // Runs after all synchronous click handlers finish 239 myHandler(e); 240 }, 0); 241 */ 242 243 setTimeout(function () { 244 // A setTimeout with a time of zero will run after all synchronous click handlers finish 245 /* 246 In this frame, we can ensure that our function *always* runs after the WP event 247 This has the following implications: 248 - The state indicators shown on any WP-updated element are *always* up to date 249 - If we want any WP-updated elements to behave differently than WP makes them, we can be sure that WP is finished with it's work, so any change we make are final (in the given context) 250 Now that we know that WP is done before we start, we can change our goals from above to be more specific: 251 1. Determine is the menu is open already (use the clicked element's aria-expanded attribute) 252 1.1 This attribute alone will tell you whether the main menu is open or not, as WP takes care of the opening and closing of related sub-menus for you. 253 1.2 Ensure that you're setting the additional properties (the main menu's "is-menu-open" class) that you need to set for the custom toggle button to function 254 2. This step may be dealt with thanks to WP 255 3. This step may be dealt with thanks to WP. 256 257 */ 258 259 /* 260 New requirement: 261 We want to know, within this context, which transition is currently happening. It will be one of three: 262 - No menu was open before, and we're opening the menu now 263 - The menu was already open, and we're now closing it 264 - A menu was already open, and we're moving to a different menu 265 Those are the only options in this context. However, as we've relied on WP to manage the menu state and it doesn't tell us this, we're going to need to do it ourselves. 266 */ 267 268 var main_menu = document.querySelector('nav.wp-block-navigation[aria-label="Main Menu"]'); 269 if (el.getAttribute('aria-expanded') == "false") { 270 // 271 // the menu is closed 272 main_menu.classList.remove('is-menu-open'); // I'm not sure we want this... 273 } else { 274 // the menu is open 275 main_menu.classList.add('is-menu-open'); 276 } 277 }, 0); 278 }); 279 }); 280 var main_menu = document.querySelector('nav.wp-block-navigation[aria-label="Main Menu"]'); 281 var stateClass = null; 282 main_menu.addEventListener('mousedown', function (e) { 283 var toggle = e.target.closest('.wp-block-navigation-submenu__toggle'); 284 if (!toggle) return; 285 var currentlyOpen = main_menu.querySelector('.wp-block-navigation-submenu__toggle[aria-expanded="true"]'); 286 var isClosing = currentlyOpen === toggle; 287 var isSwitching = currentlyOpen && !isClosing; 288 var isOpening = !currentlyOpen; 289 if (isClosing) stateClass = 'nav--closing';else if (isSwitching) stateClass = 'nav--switching';else stateClass = 'nav--opening'; 290 main_menu.classList.remove('nav--opening', 'nav--closing', 'nav--switching'); 291 main_menu.classList.add(stateClass); 292 if (isSwitching) { 293 // We're switching â snapshot the current computed colour 294 var computed = getComputedStyle(main_menu, '::after'); 295 var currentColour = computed.backgroundColor; 296 // Write it back as an inline style so it persists when the CSS rule drops off 297 main_menu.style.setProperty('--submenu-bg-hold', currentColour); 298 } 299 }); 300 main_menu.addEventListener('click', function (e) { 301 var toggle = e.target.closest('.wp-block-navigation-submenu__toggle'); 302 if (!toggle || !stateClass) return; 303 stateClass = null; 304 setTimeout(function () { 305 main_menu.classList.remove('nav--opening', 'nav--closing', 'nav--switching'); 306 }, 1000); 307 }); 308 window.addEventListener('scroll', function () { 309 // If scrollY is less than 5, dataset.atTop becomes true 310 document.documentElement.dataset.atTop = window.scrollY < 5; // Allow for some amount of mushiness on the 'top' due to bounce on upwards scrolling 311 }, { 312 passive: true 313 }); 314 315 // Run the scroll check on document load 316 document.documentElement.dataset.atTop = window.scrollY < 5; 317 318 // Click event timing tests: 319 /* 320 // OK, testing time. Using our body class, determine when our function runs... before or after the WP event 321 var bodyEl = document.querySelector( 'body' ); 322 323 if ( el.getAttribute( 'aria-expanded' ) == 'false' ) { // The clicked element state is showing that the menu is closed 324 if ( bodyEl.classList.contains( 'main-menu-open' ) ) { // Our state indicator is showing that the menu is open (and should be closed) 325 // Therefore, the clicked element changed state before this event 326 console.log( 'Our event fired last.' ); 327 } else { // Our state indicator is showing that the menu is closed (and should be open) 328 // Therefore, our indicator will change before the clicked element's will 329 console.log( 'Our event fired first.' ); 330 } 331 } else { // The clicked element state is showing that the menu is open 332 if ( bodyEl.classList.contains( 'main-menu-open' ) ) { // Our state indicator is showing that the menu is open (and should be closed) 333 // Therefore, our indicator will change before the clicked element's will 334 console.log( 'Our event fired first.' ); 335 } else { // Our state indicator is showing that the menu is closed (and should be open) 336 // Therefore, the clicked element changed state before this event 337 console.log( 'Our event fired last.' ); 338 } 339 } 340 // Toggle body class 341 if ( bodyEl.classList.contains( 'main-menu-open' ) ) { 342 bodyEl.classList.remove( 'main-menu-open' ); 343 } else { 344 bodyEl.classList.add( 'main-menu-open' ); 345 } 346 */ 347 348 /* 349 const footer_hover_element = document.querySelector( 'footer.wp-block-template-part > .wp-block-cover > .wp-block-cover__background' ); 350 if ( footer_hover_element ) { 351 let mouseX = 0, mouseY = 0; // real cursor position 352 let currentX = 0, currentY = 0; // lagging gradient position 353 const speed = 0.08; // 0 = frozen, 1 = instant. Try 0.05â0.15 354 window.addEventListener( 'mousemove', (e) => { 355 const rect = footer_hover_element.getBoundingClientRect(); 356 const x = e.clientX - rect.left; 357 const y = e.clientY - rect.top; 358 const inside = x >= 0 && y >= 0 && x <= rect.width && y <= rect.height; 359 if (inside) {
360 mouseX = x; 361 mouseY = y; 362 footer_hover_element.classList.add('active'); 363 } else { 364 footer_hover_element.classList.remove('active'); 365 } 366 }); 367 function animate() { 368 // Lerp current position toward mouse position 369 currentX += (mouseX - currentX) * speed; 370 currentY += (mouseY - currentY) * speed; 371 footer_hover_element.style.setProperty('--mouse-x', `${currentX}px`); 372 footer_hover_element.style.setProperty('--mouse-y', `${currentY}px`); 373 requestAnimationFrame( animate ); 374 } 375 animate(); 376 } 377 */ 378}); 379 380/***/ }), 381
382/***/ "./src/sass/theme.scss": 383/*!*****************************!*\ 384 !*** ./src/sass/theme.scss ***! 385 \*****************************/ 386/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 387 388"use strict"; 389__webpack_require__.r(__webpack_exports__); 390// extracted by mini-css-extract-plugin 391 392 393/***/ }), 394
395/***/ "./src/sass/editor.scss": 396/*!******************************!*\ 397 !*** ./src/sass/editor.scss ***! 398 \******************************/ 399/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 400 401"use strict"; 402__webpack_require__.r(__webpack_exports__); 403// extracted by mini-css-extract-plugin 404 405 406/***/ })
vendor: 5,716 bytes, lines 406-546
406 407 408/******/ }); 409/************************************************************************/ 410/******/ // The module cache 411/******/ var __webpack_module_cache__ = {}; 412/******/ 413/******/ // The require function 414/******/ function __webpack_require__(moduleId) { 415/******/ // Check if module is in cache 416/******/ var cachedModule = __webpack_module_cache__[moduleId]; 417/******/ if (cachedModule !== undefined) { 418/******/ return cachedModule.exports; 419/******/ } 420/******/ // Create a new module (and put it into the cache) 421/******/ var module = __webpack_module_cache__[moduleId] = { 422/******/ // no module.id needed 423/******/ // no module.loaded needed 424/******/ exports: {} 425/******/ }; 426/******/ 427/******/ // Execute the module function 428/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 429/******/ 430/******/ // Return the exports of the module 431/******/ return module.exports; 432/******/ } 433/******/ 434/******/ // expose the modules object (__webpack_modules__) 435/******/ __webpack_require__.m = __webpack_modules__; 436/******/ 437/************************************************************************/ 438/******/ /* webpack/runtime/chunk loaded */ 439/******/ (() => { 440/******/ var deferred = []; 441/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { 442/******/ if(chunkIds) { 443/******/ priority = priority || 0; 444/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; 445/******/ deferred[i] = [chunkIds, fn, priority]; 446/******/ return; 447/******/ } 448/******/ var notFulfilled = Infinity; 449/******/ for (var i = 0; i < deferred.length; i++) { 450/******/ var [chunkIds, fn, priority] = deferred[i]; 451/******/ var fulfilled = true; 452/******/ for (var j = 0; j < chunkIds.length; j++) { 453/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { 454/******/ chunkIds.splice(j--, 1); 455/******/ } else { 456/******/ fulfilled = false; 457/******/ if(priority < notFulfilled) notFulfilled = priority; 458/******/ } 459/******/ } 460/******/ if(fulfilled) { 461/******/ deferred.splice(i--, 1) 462/******/ var r = fn(); 463/******/ if (r !== undefined) result = r; 464/******/ } 465/******/ } 466/******/ return result; 467/******/ }; 468/******/ })(); 469/******/ 470/******/ /* webpack/runtime/hasOwnProperty shorthand */ 471/******/ (() => { 472/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 473/******/ })(); 474/******/ 475/******/ /* webpack/runtime/make namespace object */ 476/******/ (() => { 477/******/ // define __esModule on exports 478/******/ __webpack_require__.r = (exports) => { 479/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 480/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 481/******/ } 482/******/ Object.defineProperty(exports, '__esModule', { value: true }); 483/******/ }; 484/******/ })(); 485/******/ 486/******/ /* webpack/runtime/jsonp chunk loading */ 487/******/ (() => { 488/******/ // no baseURI 489/******/ 490/******/ // object to store loaded and loading chunks 491/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched 492/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded 493/******/ var installedChunks = { 494/******/ "/dist/js/theme": 0, 495/******/ "dist/css/editor": 0, 496/******/ "dist/css/theme": 0 497/******/ }; 498/******/ 499/******/ // no chunk on demand loading 500/******/ 501/******/ // no prefetching 502/******/ 503/******/ // no preloaded 504/******/ 505/******/ // no HMR 506/******/ 507/******/ // no HMR manifest 508/******/ 509/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); 510/******/ 511/******/ // install a JSONP callback for chunk loading 512/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { 513/******/ var [chunkIds, moreModules, runtime] = data; 514/******/ // add "moreModules" to the modules object, 515/******/ // then flag all "chunkIds" as loaded and fire callback 516/******/ var moduleId, chunkId, i = 0; 517/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { 518/******/ for(moduleId in moreModules) { 519/******/ if(__webpack_require__.o(moreModules, moduleId)) { 520/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; 521/******/ } 522/******/ } 523/******/ if(runtime) var result = runtime(__webpack_require__); 524/******/ } 525/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); 526/******/ for(;i < chunkIds.length; i++) { 527/******/ chunkId = chunkIds[i]; 528/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { 529/******/ installedChunks[chunkId][0](); 530/******/ } 531/******/ installedChunks[chunkId] = 0; 532/******/ } 533/******/ return __webpack_require__.O(result); 534/******/ } 535/******/ 536/******/ var chunkLoadingGlobal = self["webpackChunkeurekatheme"] = self["webpackChunkeurekatheme"] || []; 537/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); 538/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); 539/******/ })(); 540/******/ 541/************************************************************************/ 542/******/ 543/******/ // startup 544/******/ // Load entry module and return exports 545/******/ // This entry module depends on other loaded chunks and execution need to be delayed 546/******/ __webpack_require__.O(undefined, ["dist/css/editor","dist/css/theme"], (
546) => (__webpack_require__("./src/js/theme.js"))) 547/******/ __webpack_require__.O(undefined, ["dist/css/editor","dist/css/theme"], () => (__webpack_require__("./src/sass/theme.scss"))) 548/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["dist/css/editor","dist/css/theme"], () => (__webpack_require__("./src/sass/editor.scss"))) 549/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); 550/******/ 551/******/ })() 552;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.