biofriction-wp-theme/node_modules/foundation-sites/dist/js/plugins/foundation.magellan.js.map

1 line
22 KiB
Plaintext

{"version":3,"sources":["webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/universalModuleDefinition","webpack://__FOUNDATION_EXTERNAL__.[name]/webpack/bootstrap","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core.plugin\",\"commonjs\":\"./foundation.core.plugin\",\"commonjs2\":\"./foundation.core.plugin\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core.utils\",\"commonjs\":\"./foundation.core.utils\",\"commonjs2\":\"./foundation.core.utils\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.smoothScroll\"],\"amd\":\"./foundation.smoothScroll\",\"commonjs\":\"./foundation.smoothScroll\",\"commonjs2\":\"./foundation.smoothScroll\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/./js/entries/plugins/foundation.magellan.js","webpack://__FOUNDATION_EXTERNAL__.[name]/./js/foundation.magellan.js","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}"],"names":["Foundation","plugin","Magellan","element","options","$element","$","extend","defaults","data","className","_init","calcPoints","id","GetYoDigits","_this","$targets","$links","find","attr","$active","scrollPos","parseInt","window","pageYOffset","_events","body","document","html","documentElement","points","winHeight","Math","round","max","innerHeight","clientHeight","docHeight","scrollHeight","offsetHeight","each","$tar","pt","offset","top","threshold","targetPoint","push","$body","opts","duration","animationDuration","easing","animationEasing","one","deepLinking","location","hash","scrollToLoc","_updateActive","onLoadListener","onLoad","on","reflow","bind","e","preventDefault","arrival","getAttribute","_deepLinkScroll","loc","_inTransition","SmoothScroll","newScrollPos","isScrollingUp","activeIdx","length","visibleLinks","filter","p","i","$oldActive","activeHash","eq","isNewActive","is","isNewHash","removeClass","activeClass","addClass","history","pushState","url","pathname","search","trigger","off","replace","Plugin"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA,8D;;;;;;;;;;;ACAA,qE;;;;;;;;;;;ACAA,oE;;;;;;;;;;;ACAA,sE;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACAA,2DAAU,CAACC,MAAX,CAAkBC,6DAAlB,EAA4B,UAA5B;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAa;;;;;;;;;;;;;;;;;;;;AAGb;AACA;AACA;AACA;AAEA;;;;;;IAMMA,Q;;;;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AAaoF,WADnE;;AAGA,UAAG,KAAKpF,OAAL,CAAamD,WAAhB,EAA4B;AAC1B,YAAIE,IAAI,GAAG,KAAKrC,OAAL,CAAa,CAAb,EAAgBgD,YAAhB,CAA6B,MAA7B,CAAX;AACA7C,cAAM,CAACiC,QAAP,CAAgBC,IAAhB,CAAqBwC,OAArB,CAA6BxC,IAA7B,EAAmC,EAAnC;AACD;;AAEDnD,mDAAC,CAACiB,MAAD,CAAD,CAAUyE,GAAV,CAAc,YAAd,EAA4B,KAAK3B,eAAjC;AACA,UAAI,KAAKT,cAAT,EAAyBtD,6CAAC,CAACiB,MAAD,CAAD,CAAUyE,GAAV,CAAc,KAAKpC,cAAnB;AAC1B;;;;EArNoBsC,8D;AAwNvB;;;;;AAGAhG,QAAQ,CAACM,QAAT,GAAoB;AAClB;;;;;;AAMA2C,mBAAiB,EAAE,GAPD;;AAQlB;;;;;;;AAOAE,iBAAe,EAAE,QAfC;;AAgBlB;;;;;;AAMAR,WAAS,EAAE,EAtBO;;AAuBlB;;;;;;AAMA2C,aAAW,EAAE,WA7BK;;AA8BlB;;;;;;AAMAjC,aAAW,EAAE,KApCK;;AAqClB;;;;;;AAMAZ,QAAM,EAAE;AA3CU,CAApB;;;;;;;;;;;;;;;;;;;;;;;;ACzOA,oD","file":"foundation.magellan.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.core\"), require(\"./foundation.core.plugin\"), require(\"./foundation.core.utils\"), require(\"./foundation.smoothScroll\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"./foundation.core.plugin\", \"./foundation.core.utils\", \"./foundation.smoothScroll\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.magellan\"] = factory(require(\"./foundation.core\"), require(\"./foundation.core.plugin\"), require(\"./foundation.core.utils\"), require(\"./foundation.smoothScroll\"), require(\"jquery\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.magellan\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.smoothScroll\"], root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_core_plugin__, __WEBPACK_EXTERNAL_MODULE__foundation_core_utils__, __WEBPACK_EXTERNAL_MODULE__foundation_smoothScroll__, __WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core_plugin__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core_utils__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_smoothScroll__;","import { Foundation } from './foundation.core';\n\nimport { Magellan } from '../../foundation.magellan';\nFoundation.plugin(Magellan, 'Magellan');\n\nexport { Foundation, Magellan };\n","'use strict';\n\n\nimport $ from 'jquery';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\nimport { SmoothScroll } from './foundation.smoothScroll';\n\n/**\n * Magellan module.\n * @module foundation.magellan\n * @requires foundation.smoothScroll\n */\n\nclass Magellan extends Plugin {\n /**\n * Creates a new instance of Magellan.\n * @class\n * @name Magellan\n * @fires Magellan#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Magellan.defaults, this.$element.data(), options);\n this.className = 'Magellan'; // ie9 back compat\n\n this._init();\n this.calcPoints();\n }\n\n /**\n * Initializes the Magellan plugin and calls functions to get equalizer functioning on load.\n * @private\n */\n _init() {\n var id = this.$element[0].id || GetYoDigits(6, 'magellan');\n var _this = this;\n this.$targets = $('[data-magellan-target]');\n this.$links = this.$element.find('a');\n this.$element.attr({\n 'data-resize': id,\n 'data-scroll': id,\n 'id': id\n });\n this.$active = $();\n this.scrollPos = parseInt(window.pageYOffset, 10);\n\n this._events();\n }\n\n /**\n * Calculates an array of pixel values that are the demarcation lines between locations on the page.\n * Can be invoked if new elements are added or the size of a location changes.\n * @function\n */\n calcPoints() {\n var _this = this,\n body = document.body,\n html = document.documentElement;\n\n this.points = [];\n this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));\n this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));\n\n this.$targets.each(function(){\n var $tar = $(this),\n pt = Math.round($tar.offset().top - _this.options.threshold);\n $tar.targetPoint = pt;\n _this.points.push(pt);\n });\n }\n\n /**\n * Initializes events for Magellan.\n * @private\n */\n _events() {\n var _this = this,\n $body = $('html, body'),\n opts = {\n duration: _this.options.animationDuration,\n easing: _this.options.animationEasing\n };\n\n $(window).one('load', function(){\n if(_this.options.deepLinking){\n if(location.hash){\n _this.scrollToLoc(location.hash);\n }\n }\n _this.calcPoints();\n _this._updateActive();\n });\n\n _this.onLoadListener = onLoad($(window), function () {\n _this.$element\n .on({\n 'resizeme.zf.trigger': _this.reflow.bind(_this),\n 'scrollme.zf.trigger': _this._updateActive.bind(_this)\n })\n .on('click.zf.magellan', 'a[href^=\"#\"]', function (e) {\n e.preventDefault();\n var arrival = this.getAttribute('href');\n _this.scrollToLoc(arrival);\n });\n });\n\n this._deepLinkScroll = function(e) {\n if(_this.options.deepLinking) {\n _this.scrollToLoc(window.location.hash);\n }\n };\n\n $(window).on('hashchange', this._deepLinkScroll);\n }\n\n /**\n * Function to scroll to a given location on the page.\n * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo'\n * @function\n */\n scrollToLoc(loc) {\n this._inTransition = true;\n var _this = this;\n\n var options = {\n animationEasing: this.options.animationEasing,\n animationDuration: this.options.animationDuration,\n threshold: this.options.threshold,\n offset: this.options.offset\n };\n\n SmoothScroll.scrollToLoc(loc, options, function() {\n _this._inTransition = false;\n })\n }\n\n /**\n * Calls necessary functions to update Magellan upon DOM change\n * @function\n */\n reflow() {\n this.calcPoints();\n this._updateActive();\n }\n\n /**\n * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled.\n * @private\n * @function\n * @fires Magellan#update\n */\n _updateActive(/*evt, elem, scrollPos*/) {\n if(this._inTransition) return;\n\n const newScrollPos = parseInt(window.pageYOffset, 10);\n const isScrollingUp = this.scrollPos > newScrollPos;\n this.scrollPos = newScrollPos;\n\n let activeIdx;\n // Before the first point: no link\n if(newScrollPos < this.points[0]){ /* do nothing */ }\n // At the bottom of the page: last link\n else if(newScrollPos + this.winHeight === this.docHeight){ activeIdx = this.points.length - 1; }\n // Otherwhise, use the last visible link\n else{\n const visibleLinks = this.points.filter((p, i) => {\n return (p - this.options.offset - (isScrollingUp ? this.options.threshold : 0)) <= newScrollPos;\n });\n activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0;\n }\n\n // Get the new active link\n const $oldActive = this.$active;\n let activeHash = '';\n if(typeof activeIdx !== 'undefined'){\n this.$active = this.$links.filter('[href=\"#' + this.$targets.eq(activeIdx).data('magellan-target') + '\"]');\n if (this.$active.length) activeHash = this.$active[0].getAttribute('href');\n }else{\n this.$active = $();\n }\n const isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive);\n const isNewHash = activeHash !== window.location.hash;\n\n // Update the active link element\n if(isNewActive) {\n $oldActive.removeClass(this.options.activeClass);\n this.$active.addClass(this.options.activeClass);\n }\n\n // Update the hash (it may have changed with the same active link)\n if(this.options.deepLinking && isNewHash){\n if(window.history.pushState){\n // Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384\n const url = activeHash ? activeHash : window.location.pathname + window.location.search;\n window.history.pushState(null, null, url);\n }else{\n window.location.hash = activeHash;\n }\n }\n\n if (isNewActive) {\n /**\n * Fires when magellan is finished updating to the new active element.\n * @event Magellan#update\n */\n \tthis.$element.trigger('update.zf.magellan', [this.$active]);\n\t }\n }\n\n /**\n * Destroys an instance of Magellan and resets the url of the window.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.trigger .zf.magellan')\n .find(`.${this.options.activeClass}`).removeClass(this.options.activeClass);\n\n if(this.options.deepLinking){\n var hash = this.$active[0].getAttribute('href');\n window.location.hash.replace(hash, '');\n }\n\n $(window).off('hashchange', this._deepLinkScroll)\n if (this.onLoadListener) $(window).off(this.onLoadListener);\n }\n}\n\n/**\n * Default settings for plugin\n */\nMagellan.defaults = {\n /**\n * Amount of time, in ms, the animated scrolling should take between locations.\n * @option\n * @type {number}\n * @default 500\n */\n animationDuration: 500,\n /**\n * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.\n * @option\n * @type {string}\n * @default 'linear'\n * @see {@link https://api.jquery.com/animate|Jquery animate}\n */\n animationEasing: 'linear',\n /**\n * Number of pixels to use as a marker for location changes.\n * @option\n * @type {number}\n * @default 50\n */\n threshold: 50,\n /**\n * Class applied to the active locations link on the magellan container.\n * @option\n * @type {string}\n * @default 'is-active'\n */\n activeClass: 'is-active',\n /**\n * Allows the script to manipulate the url of the current page, and if supported, alter the history.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLinking: false,\n /**\n * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.\n * @option\n * @type {number}\n * @default 0\n */\n offset: 0\n}\n\nexport {Magellan};\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"],"sourceRoot":""}