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

1 line
12 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.utils\",\"commonjs\":\"./foundation.core.utils\",\"commonjs2\":\"./foundation.core.utils\"}","webpack://__FOUNDATION_EXTERNAL__.[name]/./js/entries/plugins/foundation.util.motion.js","webpack://__FOUNDATION_EXTERNAL__.[name]/./js/foundation.util.motion.js","webpack://__FOUNDATION_EXTERNAL__.[name]/external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}"],"names":["Foundation","Motion","Move","initClasses","activeClasses","animateIn","element","animation","cb","animate","animateOut","duration","elem","fn","anim","prog","start","apply","trigger","triggerHandler","move","ts","window","requestAnimationFrame","cancelAnimationFrame","isIn","$","eq","length","initClass","activeClass","reset","addClass","css","show","offsetWidth","one","transitionend","finish","hide","style","transitionDuration","removeClass"],"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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H,CAEO,YAFP,EAEqB,MAFrB;AAIAV,uBAAqB,CAAC,YAAM;AAC1BjB,WAAO,CAAC0B,QAAR,CAAiBH,SAAjB;AACA,QAAIJ,IAAJ,EAAUnB,OAAO,CAAC4B,IAAR;AACX,GAHoB,CAArB,CAf6C,CAoB7C;;AACAX,uBAAqB,CAAC,YAAM;AAC1BjB,WAAO,CAAC,CAAD,CAAP,CAAW6B,WAAX;AACA7B,WAAO,CACJ2B,GADH,CACO,YADP,EACqB,EADrB,EAEGD,QAFH,CAEYF,WAFZ;AAGD,GALoB,CAArB,CArB6C,CA4B7C;;AACAxB,SAAO,CAAC8B,GAAR,CAAYC,4EAAa,CAAC/B,OAAD,CAAzB,EAAoCgC,MAApC,EA7B6C,CA+B7C;;AACA,WAASA,MAAT,GAAkB;AAChB,QAAI,CAACb,IAAL,EAAWnB,OAAO,CAACiC,IAAR;AACXR,SAAK;AACL,QAAIvB,EAAJ,EAAQA,EAAE,CAACS,KAAH,CAASX,OAAT;AACT,GApC4C,CAsC7C;;;AACA,WAASyB,KAAT,GAAiB;AACfzB,WAAO,CAAC,CAAD,CAAP,CAAWkC,KAAX,CAAiBC,kBAAjB,GAAsC,CAAtC;AACAnC,WAAO,CAACoC,WAAR,WAAuBb,SAAvB,cAAoCC,WAApC,cAAmDvB,SAAnD;AACD;AACF;;;;;;;;;;;;;;;;;;;;;;;;;ACpGD,oD","file":"foundation.util.motion.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.utils\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"./foundation.core.utils\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.util.motion\"] = factory(require(\"./foundation.core\"), require(\"./foundation.core.utils\"), require(\"jquery\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.motion\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_core_utils__, __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 = 25);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;","module.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core_utils__;","import { Foundation } from './foundation.core';\nimport { Motion, Move } from '../../foundation.util.motion';\n\nFoundation.Motion = Motion;\nFoundation.Move = Move;\n\nexport { Foundation, Motion, Move };\n","'use strict';\n\nimport $ from 'jquery';\nimport { transitionend } from './foundation.core.utils';\n\n/**\n * Motion module.\n * @module foundation.motion\n */\n\nconst initClasses = ['mui-enter', 'mui-leave'];\nconst activeClasses = ['mui-enter-active', 'mui-leave-active'];\n\nconst Motion = {\n animateIn: function(element, animation, cb) {\n animate(true, element, animation, cb);\n },\n\n animateOut: function(element, animation, cb) {\n animate(false, element, animation, cb);\n }\n}\n\nfunction Move(duration, elem, fn){\n var anim, prog, start = null;\n // console.log('called');\n\n if (duration === 0) {\n fn.apply(elem);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n return;\n }\n\n function move(ts){\n if(!start) start = ts;\n // console.log(start, ts);\n prog = ts - start;\n fn.apply(elem);\n\n if(prog < duration){ anim = window.requestAnimationFrame(move, elem); }\n else{\n window.cancelAnimationFrame(anim);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n }\n }\n anim = window.requestAnimationFrame(move);\n}\n\n/**\n * Animates an element in or out using a CSS transition class.\n * @function\n * @private\n * @param {Boolean} isIn - Defines if the animation is in or out.\n * @param {Object} element - jQuery or HTML object to animate.\n * @param {String} animation - CSS class to use.\n * @param {Function} cb - Callback to run when animation is finished.\n */\nfunction animate(isIn, element, animation, cb) {\n element = $(element).eq(0);\n\n if (!element.length) return;\n\n var initClass = isIn ? initClasses[0] : initClasses[1];\n var activeClass = isIn ? activeClasses[0] : activeClasses[1];\n\n // Set up the animation\n reset();\n\n element\n .addClass(animation)\n .css('transition', 'none');\n\n requestAnimationFrame(() => {\n element.addClass(initClass);\n if (isIn) element.show();\n });\n\n // Start the animation\n requestAnimationFrame(() => {\n element[0].offsetWidth;\n element\n .css('transition', '')\n .addClass(activeClass);\n });\n\n // Clean up the animation when it finishes\n element.one(transitionend(element), finish);\n\n // Hides the element (for out animations), resets the element, and runs a callback\n function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }\n\n // Resets transitions and removes motion-specific classes\n function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(`${initClass} ${activeClass} ${animation}`);\n }\n}\n\nexport { Move, Motion };\n\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"],"sourceRoot":""}