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