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M,EAAWxB,SAAUwB,EAAW/B,KAAKC,GAAagB,sBAAsB2B,UAAUC,OACxI,GACJ,CAQA,MAAMb,EACFvC,cACIM,KAAK+C,KAAO,EAChB,CACAJ,KAAKR,GACDnC,KAAK+C,KAAKJ,KAAKR,EACnB,CACA3B,SACI,IAAK,IAAI0B,EAAI,EAAGc,EAAMhD,KAAK+C,KAAKE,OAAQf,EAAIc,EAAKd,IAC7ClC,KAAK+C,KAAKb,GAAG1B,QACrB,CACAP,KAAKC,GACD,IAAK,IAAIgC,EAAI,EAAGc,EAAMhD,KAAK+C,KAAKE,OAAQf,EAAIc,EAAKd,IAC7ClC,KAAK+C,KAAKb,GAAGjC,KAAKC,EAC1B,CACAgD,IAAIhB,GACA,OAAOlC,KAAK+C,KAAKb,EACrB,CACAiB,OACI,OAAOnD,KAAK+C,KAAKE,MACrB,EAEJxC,OAAO2C,SAAW,WACG5B,SAAS6B,eAAe,cAE7C,EChGA,MAAMC,EAASC,KAAKC,OAAOF,OAC3B,IAAIG,EACJ,OAAQH,GACJ,IAAK,OACDG,EAAa,GACb,MACJ,IAAK,OACDA,EAAa,GACb,MACJ,IAAK,UACDA,EAAa,GACb,MACJ,IAAK,SACDA,EAAa,GACb,MACJ,QACIA,EAAaC,SAASJ,GAClBK,MAAMF,KACNG,QAAQC,MAAM,aACdJ,EAAa,KD+ElB,SAAeH,GAClB,cAAeA,GACX,IAAK,SACD9D,EAAeqB,KAAKiD,MAAMR,GAC1B,MACJ,IAAK,SACD9D,EAAekE,SAASJ,GACxB,MACJ,QACI,MAAM,IAAIS,UAAU,sCAAwCT,EAAS,YAE7EhE,EAAI0E,IAAM,IAAIC,IAAI,aAClB3E,EAAI4E,OAAS,WACTjD,GACJ,CAEJ,CC5FAkD,CAAMV,E","sources":["webpack://sakurairo-scripts/./src/app/falling_effect/sakura/sakura.js","webpack://sakurairo-scripts/./src/app/falling_effect/sakura/start.js"],"sourcesContent":["var stop, staticx, img = new Image;\r\nvar sakuraAmount = 50;\r\nclass Sakura {\r\n constructor(x, y, s, r, fn) {\r\n this.x = x, this.y = y, this.s = s, this.r = r, this.fn = fn;\r\n }\r\n draw(cxt) {\r\n cxt.save();\r\n var xc = 40 * this.s / 4;\r\n cxt.translate(this.x, this.y), cxt.rotate(this.r), cxt.drawImage(img, 0, 0, 40 * this.s, 40 * this.s), cxt.restore();\r\n }\r\n update() {\r\n this.x = this.fn.x(this.x, this.y), this.y = this.fn.y(this.y, this.y), this.r = this.fn.r(this.r), (this.x > window.innerWidth || this.x < 0 || this.y > window.innerHeight || this.y < 0) && (this.r = getRandom(\"fnr\"), Math.random() > .4 ? (this.x = getRandom(\"x\"), this.y = 0, this.s = getRandom(\"s\"), this.r = getRandom(\"r\")) : (this.x = window.innerWidth, this.y = getRandom(\"y\"), this.s = getRandom(\"s\"), this.r = getRandom(\"r\")));\r\n }\r\n}\r\n\r\nfunction getRandom(option) {\r\n var ret, random;\r\n switch (option) {\r\n case \"x\":\r\n ret = Math.random() * window.innerWidth;\r\n break;\r\n case \"y\":\r\n ret = Math.random() * window.innerHeight;\r\n break;\r\n case \"s\":\r\n ret = Math.random();\r\n break;\r\n case \"r\":\r\n ret = 6 * Math.random();\r\n break;\r\n case \"fnx\":\r\n random = 1 * Math.random() - .5, ret = function (x, y) {\r\n return x + .5 * random - 1.7\r\n };\r\n break;\r\n case \"fny\":\r\n random = 1.5 + .7 * Math.random(), ret = function (x, y) {\r\n return y + random\r\n };\r\n break;\r\n case \"fnr\":\r\n random = .03 * Math.random(), ret = function (r) {\r\n return r + random\r\n }\r\n }\r\n return ret\r\n}\r\n\r\nfunction startSakura() {\r\n requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame;\r\n var canvas = document.createElement(\"canvas\"),\r\n cxt;\r\n staticx = !0, canvas.height = window.innerHeight, canvas.width = window.innerWidth, canvas.setAttribute(\"style\", \"position: fixed;left: 0;top: 0;pointer-events: none;\"), canvas.setAttribute(\"id\", \"canvas_sakura\"), document.getElementsByTagName(\"body\")[0].appendChild(canvas), cxt = canvas.getContext(\"2d\");\r\n for (var sakuraList = new SakuraList, i = 0; i < sakuraAmount; i++) {\r\n var sakura, randomX, randomY, randomS, randomR, randomFnx, randomFny, randomFnR;\r\n randomX = getRandom(\"x\"), randomY = getRandom(\"y\"), randomR = getRandom(\"r\"), randomS = getRandom(\"s\"), randomFnx = getRandom(\"fnx\"), randomFny = getRandom(\"fny\"), randomFnR = getRandom(\"fnr\"), (sakura = new Sakura(randomX, randomY, randomS, randomR, {\r\n x: randomFnx,\r\n y: randomFny,\r\n r: randomFnR\r\n })).draw(cxt), sakuraList.push(sakura)\r\n }\r\n stop = requestAnimationFrame((function () {\r\n cxt.clearRect(0, 0, canvas.width, canvas.height), sakuraList.update(), sakuraList.draw(cxt), stop = requestAnimationFrame(arguments.callee)\r\n }))\r\n}\r\n\r\nfunction stopp() {\r\n if (staticx) {\r\n var child = document.getElementById(\"canvas_sakura\");\r\n child.parentNode.removeChild(child), window.cancelAnimationFrame(stop), staticx = !1\r\n } else startSakura()\r\n}\r\nclass SakuraList {\r\n constructor() {\r\n this.list = [];\r\n }\r\n push(sakura) {\r\n this.list.push(sakura);\r\n }\r\n update() {\r\n for (var i = 0, len = this.list.length; i < len; i++)\r\n this.list[i].update();\r\n }\r\n draw(cxt) {\r\n for (var i = 0, len = this.list.length; i < len; i++)\r\n this.list[i].draw(cxt);\r\n }\r\n get(i) {\r\n return this.list[i];\r\n }\r\n size() {\r\n return this.list.length;\r\n }\r\n}\r\nwindow.onresize = function () {\r\n var canvasSnow = document.getElementById(\"canvas_snow\")\r\n //TODO:FIX RESIZE\r\n}\r\n\r\nexport function start(amount) {\r\n switch (typeof amount) {\r\n case 'number':\r\n sakuraAmount = Math.floor(amount)\r\n break;\r\n case 'string':\r\n sakuraAmount = parseInt(amount)\r\n break;\r\n default:\r\n throw new TypeError('need a int as args, but get ' + typeof amount + ' instead')\r\n }\r\n img.src = new URL('sakura.png', import.meta.url)\r\n img.onload = function () {\r\n startSakura()\r\n };\r\n\r\n}","import { start } from \"./sakura\"\r\n\r\nconst amount = _iro.effect.amount\r\nlet sakura_num\r\nswitch (amount) {\r\n case 'half':\r\n sakura_num = 25\r\n break\r\n case 'less':\r\n sakura_num = 15\r\n break\r\n case 'quarter':\r\n sakura_num = 35\r\n break\r\n case 'native':\r\n sakura_num = 50\r\n break\r\n default:\r\n sakura_num = parseInt(amount)\r\n if (isNaN(sakura_num)) {\r\n console.error('wrong arg')\r\n sakura_num = 50\r\n }\r\n}\r\nstart(sakura_num)"],"names":["img","Image","sakuraAmount","Sakura","constructor","x","y","s","r","fn","this","draw","cxt","save","translate","rotate","drawImage","restore","update","window","innerWidth","innerHeight","getRandom","Math","random","option","ret","startSakura","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","oRequestAnimationFrame","canvas","document","createElement","height","width","setAttribute","getElementsByTagName","appendChild","getContext","sakuraList","SakuraList","i","sakura","randomX","randomY","randomS","randomR","randomFnx","randomFny","randomFnR","push","clearRect","arguments","callee","list","len","length","get","size","onresize","getElementById","amount","_iro","effect","sakura_num","parseInt","isNaN","console","error","floor","TypeError","src","URL","onload","start"],"sourceRoot":""}