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KAAKgC,MAAwB,EAAhBN,KAAKE,SAAe5B,KAAKG,UACtCH,KAAKiC,KAAOjC,KAAKgC,MACjBhC,KAAKkC,KAAO,GAGhBZ,EAAUuC,UAAUf,OAAS,SAAU3B,GACnC,IAAI8C,EAAY9C,EAAI+C,qBAAqBlE,KAAKyB,EAAGzB,KAAK6B,EAAG,EAAG7B,KAAKyB,EAAGzB,KAAK6B,EAAG7B,KAAK8B,MACjFmC,EAAUE,aAAa,EAAG,4BAC1BF,EAAUE,aAAa,GAAI,4BAC3BF,EAAUE,aAAa,EAAG,0BAC1BhD,EAAIiD,OACJjD,EAAIkD,UAAYJ,EAChB9C,EAAImD,YACJnD,EAAIoD,IAAIvE,KAAKyB,EAAGzB,KAAK6B,EAAG7B,KAAK8B,KAAM,EAAa,EAAVJ,KAAK8C,IAC3CrD,EAAIsD,OACJtD,EAAIuD,WC7FG,IAAI5E,EAAS,CAAEG,SAAoB,QAH/B0E,KAAKC,OAAOC,OAG4B,IAAM,MACxDf","sources":["webpack://sakurairo-scripts/./src/app/falling_effect/yuki/yuki.js","webpack://sakurairo-scripts/./src/app/falling_effect/yuki/start.js"],"sourcesContent":["/* 控制下雪 */\nexport function snowFall(snow) {\n /* 可配置属性 */\n snow = snow || {};\n this.maxFlake = snow.maxFlake || 200; /* 最多片数 */\n this.flakeSize = snow.flakeSize || 10; /* 雪花形状 */\n this.fallSpeed = snow.fallSpeed || 1; /* 坠落速度 */\n}\n/* 兼容写法 */\nrequestAnimationFrame = window.requestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n function (callback) { setTimeout(callback, 1000 / 60); };\n\ncancelAnimationFrame = window.cancelAnimationFrame ||\n window.mozCancelAnimationFrame ||\n window.webkitCancelAnimationFrame ||\n window.msCancelAnimationFrame ||\n window.oCancelAnimationFrame;\n/* 开始下雪 */\nsnowFall.prototype.start = function () {\n /* 创建画布 */\n snowCanvas.apply(this);\n /* 创建雪花形状 */\n createFlakes.apply(this);\n /* 画雪 */\n drawSnow.apply(this)\n}\n/* 创建画布 */\nfunction snowCanvas() {\n /* 添加Dom结点 */\n var snowcanvas = document.createElement(\"canvas\");\n snowcanvas.id = \"snowfall\";\n snowcanvas.width = window.innerWidth;\n snowcanvas.height = document.body.clientHeight;\n snowcanvas.setAttribute(\"style\", \"position:absolute; top: 0; left: 0; z-index: 1; pointer-events: none;\");\n document.getElementsByTagName(\"body\")[0].appendChild(snowcanvas);\n this.canvas = snowcanvas;\n this.ctx = snowcanvas.getContext(\"2d\");\n /* 窗口大小改变的处理 */\n window.onresize = function () {\n snowcanvas.width = window.innerWidth;\n /* snowcanvas.height = window.innerHeight */\n }\n}\n/* 雪运动对象 */\nfunction flakeMove(canvasWidth, canvasHeight, flakeSize, fallSpeed) {\n this.x = Math.floor(Math.random() * canvasWidth); /* x坐标 */\n this.y = Math.floor(Math.random() * canvasHeight); /* y坐标 */\n this.size = Math.random() * flakeSize + 2; /* 形状 */\n this.maxSize = flakeSize; /* 最大形状 */\n this.speed = Math.random() * 1 + fallSpeed; /* 坠落速度 */\n this.fallSpeed = fallSpeed; /* 坠落速度 */\n this.velY = this.speed; /* Y方向速度 */\n this.velX = 0; /* X方向速度 */\n this.stepSize = Math.random() / 30; /* 步长 */\n this.step = 0 /* 步数 */\n}\nflakeMove.prototype.update = function () {\n var x = this.x,\n y = this.y;\n /* 左右摆动(余弦) */\n this.velX *= 0.98;\n if (this.velY <= this.speed) {\n this.velY = this.speed\n }\n this.velX += Math.cos(this.step += .05) * this.stepSize;\n\n this.y += this.velY;\n this.x += this.velX;\n /* 飞出边界的处理 */\n if (this.x >= canvas.width || this.x <= 0 || this.y >= canvas.height || this.y <= 0) {\n this.reset(canvas.width, canvas.height)\n }\n};\n/* 飞出边界-放置最顶端继续坠落 */\nflakeMove.prototype.reset = function (width, height) {\n this.x = Math.floor(Math.random() * width);\n this.y = 0;\n this.size = Math.random() * this.maxSize + 2;\n this.speed = Math.random() * 1 + this.fallSpeed;\n this.velY = this.speed;\n this.velX = 0;\n};\n// 渲染雪花-随机形状(此处可修改雪花颜色!!!)\nflakeMove.prototype.render = function (ctx) {\n var snowFlake = ctx.createRadialGradient(this.x, this.y, 0, this.x, this.y, this.size);\n snowFlake.addColorStop(0, \"rgba(255, 255, 255, 0.9)\"); /* 此处是雪花颜色,默认是白色 */\n snowFlake.addColorStop(.5, \"rgba(255, 255, 255, 0.5)\"); /* 若要改为其他颜色,请自行查 */\n snowFlake.addColorStop(1, \"rgba(255, 255, 255, 0)\"); /* 找16进制的RGB 颜色代码。 */\n ctx.save();\n ctx.fillStyle = snowFlake;\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\n ctx.fill();\n ctx.restore();\n};\n/* 创建雪花-定义形状 */\nfunction createFlakes() {\n var maxFlake = this.maxFlake,\n flakes = this.flakes = [],\n canvas = this.canvas;\n for (var i = 0; i < maxFlake; i++) {\n flakes.push(new flakeMove(canvas.width, canvas.height, this.flakeSize, this.fallSpeed))\n }\n}\n/* 画雪 */\nfunction drawSnow() {\n var maxFlake = this.maxFlake,\n flakes = this.flakes;\n ctx = this.ctx, canvas = this.canvas, that = this;\n /* 清空雪花 */\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n for (var e = 0; e < maxFlake; e++) {\n flakes[e].update();\n flakes[e].render(ctx);\n }\n /* 一帧一帧的画 */\n this.loop = requestAnimationFrame(function () {\n drawSnow.apply(that);\n });\n}\n/* 调用及控制方法 */\n/* var snow = new snowFall({ maxFlake: 500 });\nsnow.start(); */","import { snowFall } from './yuki'\nconst amount = _iro.effect.amount\n\n/* 调用及控制方法 */\nvar snow = new snowFall({ maxFlake: amount == 'half' ? 250 : 500 });\nsnow.start();"],"names":["snowFall","snow","this","maxFlake","flakeSize","fallSpeed","snowCanvas","snowcanvas","document","createElement","id","width","window","innerWidth","height","body","clientHeight","setAttribute","getElementsByTagName","appendChild","canvas","ctx","getContext","onresize","flakeMove","canvasWidth","canvasHeight","x","Math","floor","random","y","size","maxSize","speed","velY","velX","stepSize","step","createFlakes","flakes","i","push","drawSnow","that","clearRect","e","update","render","loop","requestAnimationFrame","apply","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","oRequestAnimationFrame","callback","setTimeout","cancelAnimationFrame","mozCancelAnimationFrame","webkitCancelAnimationFrame","msCancelAnimationFrame","oCancelAnimationFrame","prototype","start","cos","reset","snowFlake","createRadialGradient","addColorStop","save","fillStyle","beginPath","arc","PI","fill","restore","_iro","effect","amount"],"sourceRoot":""}