-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.js.map
1 lines (1 loc) · 32.7 KB
/
bundle.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap b83cc36fd3c7dfed3c32","webpack:///./app.js","webpack:///../topiary/dist/bundle.js","webpack:///(webpack)/buildin/module.js"],"names":["HEIGHT","THICKNESS","HUE","SATURATION","LIGHTNESS","LEFT_ANGLE","RIGHT_ANGLE","HEIGHT_CHANGE","THICKNESS_CHANGE","PHASE_INHALE","PHASE_HOLD_IN","PHASE_EXHALE","PHASE_HOLD_OUT","deterministicTree","canvas","treeArray","limitArray","treeOptions","startPoint","Vector2d","new","width","height","color","Color","Math","floor","thickness","depth","rainbow","colorShiftRate","delay","mutationOptions","minLeftAngle","maxLeftAngle","minRightAngle","maxRightAngle","minHeightChange","maxHeightChange","minThicknessChange","maxThicknessChange","clamp","n","min","max","undefined","getBreathPoint","time","breathCycle","b","BREATH","inhale","holdIn","exhale","holdOut","t","breath","phase","value","arrayOfRandomFloats","num","floats","i","random","change","array","runtime","length","updatePrompt","prompt","breathPoint","message","innerText","seed","fitCanvasToWindow","window","innerWidth","innerHeight","addEventListener","total","interval","document","getElementById","ctx","getContext","skyGradient","createLinearGradient","addColorStop","drawLeaf","id","fillStyle","roots","colors","beginPath","arc","x","y","leafAngle","PI","fill","randomizeTree","toStyle","limits","draw","cos","tree","on","fillRect","setInterval","webpackUniversalModuleDefinition","root","factory","exports","module","modules","installedModules","__webpack_require__","moduleId","loaded","call","m","c","p","Object","defineProperty","randomBetween","prototype","to","angle","DEG_TO_RAD","toX","sin","toY","default","_math_helpers","h","s","l","parseInt","style","split","darker","shiftHue","newH","_color","_color2","_interopRequireDefault","_vector2d","_vector2d2","obj","__esModule","TopiaryObject","_this","subscribers","event","callback","push","trigger","params","alive","mutate","isRightBranch","mOpts","tOpts","drawTree","opts","branch","drawBranch","leftOptions","rightOptions","endPoint","endColor","timeout","setTimeout","assign","nextColor","gradient","strokeStyle","lineWidth","move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;AACA","file":"./bundle.js","sourcesContent":[" \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\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b83cc36fd3c7dfed3c32","import Topiary from '@walsh9/topiary';\n\nconst HEIGHT = 0;\nconst THICKNESS = 1;\nconst HUE = 2;\nconst SATURATION = 3;\nconst LIGHTNESS = 4;\nconst LEFT_ANGLE = 5;\nconst RIGHT_ANGLE = 6;\nconst HEIGHT_CHANGE = 7;\nconst THICKNESS_CHANGE = 8;\n\nconst PHASE_INHALE = 1;\nconst PHASE_HOLD_IN = 2;\nconst PHASE_EXHALE = 3;\nconst PHASE_HOLD_OUT = 4;\n\nvar deterministicTree = function(canvas, treeArray, limitArray) {\n var treeOptions = {\n canvas: canvas,\n startPoint: Topiary.Vector2d.new(canvas.width / 2 , canvas.height),\n color: Topiary.Color.new(Math.floor(treeArray[HUE] * 360 + 70), 20, 20),\n height: treeArray[HEIGHT] * 100 + 20,\n thickness: treeArray[THICKNESS] * 8 + 2,\n depth: 7,\n rainbow: false,\n colorShiftRate: 0,\n delay: 0,\n };\n var mutationOptions = {\n minLeftAngle: treeArray[LEFT_ANGLE] * limitArray[LEFT_ANGLE],\n maxLeftAngle: treeArray[LEFT_ANGLE] * limitArray[LEFT_ANGLE],\n minRightAngle: treeArray[RIGHT_ANGLE] * limitArray[RIGHT_ANGLE],\n maxRightAngle: treeArray[RIGHT_ANGLE] * limitArray[RIGHT_ANGLE],\n minHeightChange: treeArray[HEIGHT_CHANGE] * 0.1 + 0.6,\n maxHeightChange: treeArray[HEIGHT_CHANGE] * 0.1 + 0.6,\n minThicknessChange: treeArray[THICKNESS_CHANGE] * 0.1 + 0.7,\n maxThicknessChange: treeArray[THICKNESS_CHANGE] * 0.1 + 0.7,\n };\n return Topiary.new(treeOptions, mutationOptions);\n};\n\nvar clamp = function(n, min, max) {\n if (min === undefined) {min = 0;}\n if (max === undefined) {max = 1;}\n if (n < min) {return min;}\n if (n > max) {return max;}\n return n;\n};\n\nlet getBreathPoint = function(time, breathCycle) {\n const b = breathCycle;\n const BREATH = b.inhale + b.holdIn + b.exhale + b.holdOut;\n const t = time % BREATH;\n\n let breath = {};\n if (t <= b.inhale) {\n breath.phase = PHASE_INHALE;\n breath.value = t / b.inhale;\n } else if (t <= b.inhale + b.holdIn) {\n breath.phase = PHASE_HOLD_IN;\n breath.value = 1;\n } else if (t <= b.inhale + b.holdIn + b.exhale) {\n breath.phase = PHASE_EXHALE;\n breath.value = 1 - ((t - (b.inhale + b.holdIn)) / b.exhale);\n } else {\n breath.phase = PHASE_HOLD_OUT;\n breath.value = 0;\n }\n return breath;\n};\n\nvar arrayOfRandomFloats = function(num) {\n var floats = [];\n for (let i = 0; i < num; i++) {\n floats[i] = Math.random();\n }\n return floats;\n};\n\nvar change = function(array, runtime, breathCycle) {\n for (let i = 0; i < array.length; i++) {\n array[i] = getBreathPoint(runtime, breathCycle).value;\n }\n return array;\n};\n\nlet updatePrompt = function(prompt, breathPoint) {\n let message;\n switch(breathPoint.phase) {\n case PHASE_INHALE:\n message = 'INHALE';\n break;\n case PHASE_HOLD_IN:\n message = 'HOLD';\n break;\n case PHASE_EXHALE:\n message = 'EXHALE';\n break;\n case PHASE_HOLD_OUT:\n message = 'HOLD';\n break;\n }\n prompt.innerText = message;\n};\n\nvar seed = arrayOfRandomFloats(9);\n \nvar fitCanvasToWindow = function() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n};\n\nwindow.addEventListener('resize', fitCanvasToWindow);\n\nlet breathCycle = {};\nbreathCycle.inhale = 5000;\nbreathCycle.holdIn = 0;\nbreathCycle.exhale = 4200;\nbreathCycle.holdOut = 0;\nbreathCycle.total = breathCycle.inhale + breathCycle.holdIn + breathCycle.exhale + breathCycle.holdOut;\n\nlet runtime = 0;\nlet interval = 50;\n\nlet canvas = document.getElementById(\"canvas\");\nlet prompt = document.getElementById('prompt');\nlet ctx = canvas.getContext(\"2d\");\n\n\nlet skyGradient = ctx.createLinearGradient(0, canvas.height, 0, 0);\nskyGradient.addColorStop(0, \"#00ffff\");\nskyGradient.addColorStop(1, \"#0066ff\");\n\nlet drawLeaf = function({startPoint, depth, thickness, id}) {\n if (depth < 4) {\n ctx.fillStyle = roots.colors[id % 3];\n ctx.beginPath();\n ctx.arc(startPoint.x, startPoint.y, 20 * breathPoint.value, leafAngle, Math.PI + leafAngle);\n ctx.fill();\n }\n};\n\nlet randomizeTree = function(roots) {\n roots.colors = roots.colors || [];\n roots.colors[0] = Topiary.Color.random().toStyle();\n roots.colors[1] = Topiary.Color.random().toStyle();\n roots.colors[2] = Topiary.Color.random().toStyle();\n roots.limits = roots.limits || [];\n roots.limits[LEFT_ANGLE] = Math.random() * 80;\n roots.limits[RIGHT_ANGLE] = Math.random() * 80;\n};\n\nlet roots = {};\nrandomizeTree(roots);\nlet breathPoint = 0;\nlet leafAngle = 0;\nlet draw = function () {\n if (runtime % breathCycle.total - interval < 0) {\n randomizeTree(roots);\n }\n runtime += interval;\n breathPoint = getBreathPoint(runtime, breathCycle);\n leafAngle = Math.cos(runtime) * 0.2;\n let tree = deterministicTree(canvas, change(seed, runtime, breathCycle), roots.limits);\n tree.on('leafcreated', drawLeaf);\n tree.on('branchcreated', drawLeaf);\n updatePrompt(prompt, breathPoint);\n\n ctx.fillStyle = skyGradient;\n ctx.fillRect(0,0,canvas.width, canvas.height);\n tree.draw();\n};\n\nfitCanvasToWindow();\nsetInterval(draw, interval);\n\n\n\n// WEBPACK FOOTER //\n// ./app.js","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Topiary\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Topiary\"] = factory();\n\telse\n\t\troot[\"Topiary\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \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/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t__webpack_require__(1);\n\t__webpack_require__(2);\n\t__webpack_require__(3);\n\tmodule.exports = __webpack_require__(4);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar randomBetween = function randomBetween(min, max) {\n\t return Math.random() * (max - min) + min;\n\t};\n\texports.randomBetween = randomBetween;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar Vector2d = function Vector2d(x, y) {\n\t this.x = x;\n\t this.y = y;\n\t};\n\t\n\tVector2d.prototype.to = function (angle, length) {\n\t var DEG_TO_RAD = Math.PI / 180;\n\t var toX = this.x + Math.sin(angle * DEG_TO_RAD) * length;\n\t var toY = this.y + Math.cos(angle * DEG_TO_RAD) * length;\n\t return new Vector2d(toX, toY);\n\t};\n\t\n\texports.default = Vector2d;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _math_helpers = __webpack_require__(1);\n\t\n\tvar Color = function Color(h, s, l) {\n\t if (typeof h == \"string\" && s === undefined) {\n\t this.h = parseInt(style.split(\"(\")[1]);\n\t this.s = parseInt(style.split(\",\")[1]);\n\t this.l = parseInt(style.split(\",\")[2]);\n\t } else {\n\t this.h = h;\n\t this.s = s;\n\t this.l = l;\n\t }\n\t}; // HSL colors\n\t\n\t\n\tColor.prototype.toStyle = function () {\n\t return \"hsl(\" + this.h + \",\" + this.s + \"%,\" + this.l + \"%)\";\n\t};\n\t\n\tColor.prototype.darker = function (n) {\n\t return new Color(this.h, this.s, Math.max(0, this.l - n));\n\t};\n\t\n\tColor.prototype.shiftHue = function (n) {\n\t var newH = this.h + n % 359;\n\t return new Color(newH, this.s, this.l);\n\t};\n\t\n\tColor.random = function () {\n\t var h = (0, _math_helpers.randomBetween)(0, 359);\n\t var s = (0, _math_helpers.randomBetween)(0, 100);\n\t var l = (0, _math_helpers.randomBetween)(0, 100);\n\t return new Color(h, s, l);\n\t};\n\t\n\texports.default = Color;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _color = __webpack_require__(3);\n\t\n\tvar _color2 = _interopRequireDefault(_color);\n\t\n\tvar _vector2d = __webpack_require__(2);\n\t\n\tvar _vector2d2 = _interopRequireDefault(_vector2d);\n\t\n\tvar _math_helpers = __webpack_require__(1);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar TopiaryObject = function TopiaryObject(treeOptions, mutationOptions) {\n\t var _this = this;\n\t\n\t this.id = 0;\n\t this.subscribers = [];\n\t this.on = function (event, callback) {\n\t this.subscribers.push({ event: event, callback: callback });\n\t };\n\t this.trigger = function (event, params) {\n\t for (var i = 0; i < this.subscribers.length; i++) {\n\t if (this.subscribers[i].event === event) {\n\t this.subscribers[i].callback.call(undefined, params);\n\t }\n\t }\n\t };\n\t\n\t this.alive = true;\n\t var mutate = function mutate(treeOptions, isRightBranch) {\n\t var mOpts = _this.mutationOptions;\n\t var tOpts = treeOptions;\n\t return {\n\t canvas: tOpts.canvas,\n\t depth: tOpts.depth - 1,\n\t angle: isRightBranch ? tOpts.angle + (0, _math_helpers.randomBetween)(mOpts.minRightAngle, mOpts.maxRightAngle) : tOpts.angle - (0, _math_helpers.randomBetween)(mOpts.minLeftAngle, mOpts.maxLeftAngle),\n\t height: tOpts.height * (0, _math_helpers.randomBetween)(mOpts.minHeightChange, mOpts.maxHeightChange),\n\t thickness: tOpts.thickness * (0, _math_helpers.randomBetween)(mOpts.minThicknessChange, mOpts.maxThicknessChange),\n\t delay: tOpts.delay,\n\t color: tOpts.color,\n\t rainbow: tOpts.rainbow,\n\t colorShiftRate: tOpts.colorShiftRate\n\t };\n\t };\n\t\n\t var drawTree = function drawTree(treeOptions) {\n\t var opts = treeOptions;\n\t if (opts.depth > 0 && _this.alive) {\n\t (function () {\n\t if (opts.angle === undefined) {\n\t opts.angle = 180;\n\t }\n\t var branch = drawBranch(opts);\n\t var leftOptions = mutate(opts, false);\n\t var rightOptions = mutate(opts, true);\n\t leftOptions.startPoint = rightOptions.startPoint = branch.endPoint;\n\t leftOptions.color = rightOptions.color = branch.endColor;\n\t if (opts.delay) {\n\t var timeout = window.setTimeout(function () {\n\t drawTree(leftOptions);\n\t drawTree(rightOptions);\n\t }, opts.delay);\n\t } else {\n\t drawTree(leftOptions);\n\t drawTree(rightOptions);\n\t }\n\t _this.id++;\n\t _this.trigger('branchcreated', Object.assign(treeOptions, { id: _this.id }));\n\t })();\n\t } else if (_this.alive) {\n\t _this.id++;\n\t _this.trigger('leafcreated', Object.assign(treeOptions, { id: _this.id }));\n\t }\n\t };\n\t\n\t var drawBranch = function drawBranch(treeOptions) {\n\t var opts = treeOptions;\n\t var ctx = opts.canvas.getContext(\"2d\");\n\t var endPoint = opts.startPoint.to(opts.angle, opts.height);\n\t var color = void 0,\n\t nextColor = void 0;\n\t if (opts.rainbow) {\n\t nextColor = opts.color.shiftHue(opts.colorShiftRate);\n\t var gradient = ctx.createLinearGradient(opts.startPoint.x, opts.startPoint.y, endPoint.x, endPoint.y);\n\t gradient.addColorStop(0, opts.color.toStyle());\n\t gradient.addColorStop(1, nextColor.toStyle());\n\t color = gradient;\n\t } else {\n\t nextColor = opts.color;\n\t color = opts.color.toStyle();\n\t }\n\t ctx.strokeStyle = color;\n\t ctx.lineWidth = opts.thickness;\n\t ctx.beginPath();\n\t ctx.moveTo(opts.startPoint.x, opts.startPoint.y);\n\t ctx.lineTo(endPoint.x, endPoint.y);\n\t ctx.stroke();\n\t return { endPoint: endPoint, endColor: nextColor };\n\t };\n\t\n\t var mutationDefaults = {\n\t minLeftAngle: 10,\n\t maxLeftAngle: 40,\n\t minRightAngle: 10,\n\t maxRightAngle: 40,\n\t minHeightChange: 0.6,\n\t maxHeightChange: 0.9,\n\t minThicknessChange: 0.6,\n\t maxThicknessChange: 0.9\n\t };\n\t\n\t this.treeOptions = treeOptions;\n\t this.mutationOptions = mutationOptions || mutationDefaults;\n\t this.draw = function () {\n\t drawTree(this.treeOptions);\n\t };\n\t this.kill = function () {\n\t this.alive = false;\n\t };\n\t return this;\n\t};\n\tvar Topiary = {};\n\tTopiary.new = function (treeOptions, mutationOptions) {\n\t return new TopiaryObject(treeOptions, mutationOptions);\n\t};\n\tTopiary.Color = {};\n\tTopiary.Vector2d = {};\n\tTopiary.Color.new = function (h, s, l) {\n\t return new _color2.default(h, s, l);\n\t};\n\tTopiary.Color.random = function () {\n\t return _color2.default.random();\n\t};\n\tTopiary.Vector2d.new = function (x, y) {\n\t return new _vector2d2.default(x, y);\n\t};\n\t\n\texports.default = Topiary;\n\n/***/ }\n/******/ ])\n});\n;\n//# sourceMappingURL=bundle.js.map\n\n\n// WEBPACK FOOTER //\n// ../topiary/dist/bundle.js","module.exports = function(module) {\n\tif(!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tmodule.children = [];\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 2\n// module chunks = 0"],"sourceRoot":""}