PageSourceSearch

https://grandblue-anime.com/core_sys/images/others/js/particlejs_images.js

js grandblue-anime.com collected 2026-10-02 07:41:13 UTC 47,541 bytes, 1,378 lines download raw bytes

1(function webpackUniversalModuleDefinition(root, factory) {
2  if(typeof exports === 'object' && typeof module === 'object')
3    module.exports = factory();
4  else if(typeof define === 'function' && define.amd)
5    define([], factory);
6  else if(typeof exports === 'object')
7    exports["particlejs"] = factory();
8  else
9    root["particlejs"] = factory();
10})(window, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/   // The module cache
13/******/   var installedModules = {};
14/******/
15/******/   // The require function
16/******/   function __webpack_require__(moduleId) {
17/******/
18/******/     // Check if module is in cache
19/******/     if(installedModules[moduleId]) {
20/******/       return installedModules[moduleId].exports;
21/******/     }
22/******/     // Create a new module (and put it into the cache)
23/******/     var module = installedModules[moduleId] = {
24/******/       i: moduleId,
25/******/       l: false,
26/******/       exports: {}
27/******/     };
28/******/
29/******/     // Execute the module function
30/******/     modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/     // Flag the module as loaded
33/******/     module.l = true;
34/******/
35/******/     // Return the exports of the module
36/******/     return module.exports;
37/******/   }
38/******/
39/******/
40/******/   // expose the modules object (__webpack_modules__)
41/******/   __webpack_require__.m = modules;
42/******/
43/******/   // expose the module cache
44/******/   __webpack_require__.c = installedModules;
45/******/
46/******/   // define getter function for harmony exports
47/******/   __webpack_require__.d = function(exports, name, getter) {
48/******/     if(!__webpack_require__.o(exports, name)) {
49/******/       Object.defineProperty(exports, name, {
50/******/         configurable: false,
51/******/         enumerable: true,
52/******/         get: getter
53/******/       });
54/******/     }
55/******/   };
56/******/
57/******/   // define __esModule on exports
58/******/   __webpack_require__.r = function(exports) {
59/******/     Object.defineProperty(exports, '__esModule', { value: true });
60/******/   };
61/******/
62/******/   // getDefaultExport function for compatibility with non-harmony modules
63/******/   __webpack_require__.n = function(module) {
64/******/     var getter = module && module.__esModule ?
65/******/       function getDefault() { return module['default']; } :
66/******/       function getModuleExports() { return module; };
67/******/     __webpack_require__.d(getter, 'a', getter);
68/******/     return getter;
69/******/   };
70/******/
71/******/   // Object.prototype.hasOwnProperty.call
72/******/   __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
73/******/
74/******/   // __webpack_public_path__
75/******/   __webpack_require__.p = "";
76/******/
77/******/
78/******/   // Load entry module and return exports
79/******/   return __webpack_require__(__webpack_require__.s = 1);
80/******/ })
81/************************************************************************/
82/******/ ([
83/* 0 */
84/***/ (function(module, __webpack_exports__, __webpack_require__) {
85
86"use strict";
87__webpack_require__.r(__webpack_exports__);
88
89// CONCATENATED MODULE: ./src/asset-shapes.ts
90/**
91 * アセットを含むオブジェクトです。このクラスは将来変更する可能性が高いので deprecated とします。
92 * 利用しないでください。
93 * @type {{}}
94 */
95var Assets = {};
96var asset_shapes_images = {};
97var asset_shapes_createjs = window["createjs"];
98var ss = {};
99(function (lib, img, cjs, ss) {
100    var p; // shortcut to reference prototypes
101    // library properties:
102    lib.properties = {
103        width: 550,
104        height: 400,
105        fps: 24,
106        color: "#999999",
107        manifest: []
108    };
109    // symbols:
110
111    for(let i=0;i<particleImgList.length;i++){
112      (lib[particleImgList[i].name] = function() {
113        this.initialize();
114          
115        this.shape = new cjs.Bitmap(particleImgList[i].img);
116  
117        this.addChild(this.shape);
118      }).prototype = p = new cjs.Container();
119      p.nominalBounds = new cjs.Rectangle(-120, -120, 120, 120);
120    }
121
122    // stage content:
123    (lib.assetshapes = function () {
124        this.initialize();
125
126        this.instance_1 = new lib.featherImg();
127        this.instance_1.setTransform(30, 30);
128
129        this.instance_2 = new lib.featherImgCont();
130        this.instance_2.setTransform(30, 30);
131
132        this.addChild(  this.instance_2, this.instance_1 );
133    }).prototype = p = new cjs.Container();
134    p.nominalBounds = new cjs.Rectangle(275, 200, 554, 187.5);
135})((Assets = Assets || {}), (asset_shapes_images = asset_shapes_images || {}), (asset_shapes_createjs = asset_shapes_createjs || {}), (ss = ss || {}));
136
137
138// CONCATENATED MODULE: ./src/assets/shape-generator.ts
139
140/**
141 * シェイプをインスタンス化するクラスです。
142 * ParticleJSの内部的な利用以外では使用しないことをオススメします。
143 */
144var shape_generator_ShapeGenerator = /** @class */ (function () {
145    function ShapeGenerator() {
146    }
147    /**
148     * シェイプインスタンスを作成します。
149     * @param {string} id
150     * @returns {createjs.Container}
151     * @see data-shape.ts
152     */
153    ShapeGenerator.prototype.generateShape = function (id) {
154        var cls = Assets[id];
155        return new cls();
156    };
157    return ShapeGenerator;
158}());
159
160
161// CONCATENATED MODULE: ./src/data/data-color.ts
162/**
163 * 色の情報を扱うデータ型クラスです。
164 */
165var ColorData = /** @class */ (function () {
166    function ColorData() {
167        /**
168         * 色相を表します(0-360)。
169         * @type {number}
170         */
171        this.hue = 0;
172        /**
173         * 色相のばらつきを示します。
174         * @type {number}
175         */
176        this.hueVariance = 0;
177        /**
178         * 彩度です(0-100)。
179         * @type {number}
180         */
181        this.saturation = 0;
182        /**
183         * 彩度のばらつきです。
184         * @type {number}
185         */
186        this.saturationVariance = 0;
187        /**
188         * 輝度です(0-100)。
189         * @type {number}
190         */
191        this.luminance = 0;
192        /**
193         * 輝度のばらつきです。
194         * @type {number}
195         */
196        this.luminanceVariance = 0;
197    }
198    return ColorData;
199}());
200
201
202// CONCATENATED MODULE: ./src/enum/alpha-curve-type.ts
203/**
204 * 透明度の計算式の種類です。
205 */
206var AlphaCurveType;
207(function (AlphaCurveType) {
208    /**
209     * 通常の透明度の計算式です。
210     */
211    AlphaCurveType[AlphaCurveType["Normal"] = 0] = "Normal";
212    /**
213     * ランダムです。
214     */
215    AlphaCurveType[AlphaCurveType["Random"] = 1] = "Random";
216})(AlphaCurveType || (AlphaCurveType = {}));
217
218// CONCATENATED MODULE: ./src/data/data-drawing.ts
219
220
221/**
222 * パーティクルの描画情報を扱うデータ型クラスです。
223 */
224var data_drawing_DrawingData = /** @class */ (function () {
225    /**
226     * コンストラクターです。
227     * @param json
228     */
229    function DrawingData(json) {
230        if (json === void 0) { json = null; }
231        /**
232         * 背景色です。
233         * @type {string}
234         */
235        this.bgColor = "";
236        /**
237         * 幅です。
238         * @type {number}
239         */
240        this.width = 0.0;
241        /**
242         * 高さです。
243         * @type {number}
244         */
245        this.height = 0.0;
246        /**
247         * 1秒あたりの発生数です。
248         * @type {number}
249         */
250        this.emitFrequency = 0;
251        /**
252         *  発生基準位置 - X座標 (px)です。
253         * @type {number}
254         */
255        this.startX = 0;
256        /**
257         * 発生基準位置 - X座標のばらつき (px)です。
258         * @type {number}
259         */
260        this.startXVariance = 0;
261        /**
262         * 発生位置 - Y座標 (px)です。
263         * @type {number}
264         */
265        this.startY = 0;
266        /**
267         * 発生位置 - Y座標のばらつき (px)です。
268         * @type {number}
269         */
270        this.startYVariance = 0;
271        /**
272         * 初期速度 - 方向 (度)です。
273         * @type {number}
274         */
275        this.initialDirection = 0;
276        /**
277         * 初期速度 - 方向のばらつき (度)です。
278         * @type {number}
279         */
280        this.initialDirectionVariance = 0;
281        /** 初期速度 (px)です。
282         * @type {number}
283         */
284        this.initialSpeed = 0;
285        /** 初期速度のばらつきです。
286         * @type {number}
287         */
288        this.initialSpeedVariance = 0;
289        /** 摩擦です。
290         * @type {number}
291         */
292        this.friction = 0;
293        /** 重力です。
294         * @type {number}
295         */
296        this.accelerationSpeed = 0;
297        /** 重力方向 (度)です。
298         * @type {number}
299         */
300        this.accelerationDirection = 0;
301        /** 開始時のスケールです。
302         * @type {number}
303         */
304        this.startScale = 0;
305        /** 開始時のスケールのばらつきです。 */
306        this.startScaleVariance = 0;
307        /** 終了時のスケールです。
308         * @type {number}
309         */
310        this.finishScale = 0;
311        /** 終了時のスケールのばらつきです。
312         * @type {number}
313         */
314        this.finishScaleVariance = 0;
315        /**
316         * ライフ(フレーム数)です。
317         * @type {number}
318         */
319        this.lifeSpan = 0; /**
320         * ライフのばらつき(フレーム数)です。
321         * @type {number}
322         */
323        /**  */ this.lifeSpanVariance = 0;
324        /**
325         *  開始時の透明度です。
326         * @type {number}
327         */
328        this.startAlpha = 0;
329        /**
330         * 開始時の透明度のばらつきです。
331         * @type {number}
332         */
333        this.startAlphaVariance = 0;
334        /**
335         * 終了時の透明度です。
336         * @type {number}
337         */
338        this.finishAlpha = 0;
339        /**
340         * 終了時の透明度のばらつきです。
341         * @type {number}
342         */
343        this.finishAlphaVariance = 0;
344        /**
345         * 使用するシェイプID設定です。
346         * @type {string[]}
347         */
348        this.shapeIdList = [""];
349        /**
350         * 初期カラーの設定です。
351         * @type {ColorData}
352         */
353        this.startColor = new ColorData();
354        /**
355         * シェイプを加算合成します。
356         * @type {boolean}
357         */
358        this.blendMode = true;
359        /**
360         * 透明度の計算式の設定です。
361         * @type {AlphaCurveType.Normal}
362         */
363        this.alphaCurveType = AlphaCurveType.Normal;
364        if (json) {
365            this.importFromJson(json);
366        }
367    }
368    /**
369     * パーティクルの設定をJSON形式のオブジェクトから読み込みます。
370     * @param json
371     */
372    DrawingData.prototype.importFromJson = function (json) {
373        var checkSkipKey = function (key) {
374            return key == "width" || key == "height" || key == "bgColor";
375        };
376        this.setData(json, checkSkipKey);
377    };
378    /**
379     * パーティクルの設定をDrawingDataオブジェクトから読み込みます
380     * @param {DrawingData} obj
381     */
382    DrawingData.prototype.importData = function (obj) {
383        var checkSkipKey = function (key) {
384            return (key == "width" || key == "height" || key == "startX" || key == "startY");
385        };
386        this.setData(obj, checkSkipKey);
387    };
388    DrawingData.checkReflectEnable = function () {
389        try {
390            var result = !!(Reflect && Reflect.has);
391            return result;
392        }
393        catch (e) {
394            return false;
395        }
396    };
397    DrawingData.prototype.setData = function (obj, checkSkipKey) {
398        if (DrawingData.ENABLE_REFLECT) {
399            for (var key in obj) {
400                // 無視するプロパティー
401                if (checkSkipKey(key)) {
402                    continue;
403                }
404                if (Reflect.has(this, key) == true) {
405                    var val = obj[key];
406                    // イマドキなプロパティー反映方法を適用 ICS-Ikeda 2016-01-22
407                    Reflect.set(this, key, val);
408                }
409            }
410        }
411        else {
412            var self_1 = this;
413            for (var key in obj) {
414                // 無視するプロパティー
415                if (checkSkipKey(key)) {
416                    continue;
417                }
418                if (this.hasOwnProperty(key)) {
419                    self_1[key] = obj[key];
420                }
421            }
422        }
423    };
424    DrawingData.ENABLE_REFLECT = DrawingData.checkReflectEnable();
425    return DrawingData;
426}());
427
428
429// CONCATENATED MODULE: ./src/data/data-shape.ts
430/**
431 * Created by 「asset-shapes.fla」/「generate-assets.jsfl」 on Wed Jan 20 2016
432 * !!!!!このコードはJSFLから自動生成されたコードです。修正する場合はご注意ください。!!!!!
433 */
434var ShapeData = /** @class */ (function () {
435    function ShapeData() {
436        this.assetList = [
437            "featherImg",
438            "featherImgCont",
439        ];
440    }
441    return ShapeData;
442}());
443
444
445// CONCATENATED MODULE: ./src/enum/shape-type.ts
446/**
447 * シェイプの種類を定義したクラスです。
448 */
449var ShapeType = /** @class */ (function () {
450    function ShapeType() {
451    }
452    ShapeType.FEATHERIMG  = "featherImg";
453    ShapeType.FEATHERIMGCONT  = "featherImgCont";
454
455    return ShapeType;
456}());
457
458
459// CONCATENATED MODULE: ./src/particle/particle.ts
460
461/**
462 * パーティクルエミッターのバリューオブジェクトのクラスです。
463 */
464var particle_Particle = /** @class */ (function () {
465    /**
466     * コンストラクターです。
467     */
468    function Particle() {
469        this.particleShape = new createjs.Container();
470        this.startColor = new ColorData();
471    }
472    return Particle;
473}());
474
475
476// CONCATENATED MODULE: ./src/particle/particle-system.ts
477
478
479
480
481/**
482 * ParticleJSのバージョン情報を示します。
483 * @type {string}
484 */
485var VERSION = "1.0.0";
486/**
487 * 現在のバージョンと互換性があるかどうかをチェックします。
488 * @param value
489 */
490function checkVersion(value) {
491    var currentVersion = VERSION.split(".");
492    //  ここはそもそもこない想定だけれども。
493    if (currentVersion.length <= 2) {
494        console.log("バージョン表記エラーが発生しました。");
495        return false;
496    }
497    //  versionが空の場合
498    if (!value) {
499        if (currentVersion[0] == "0" && currentVersion[1] == "1") {
500            //「0.1.▲」のバージョンのParticleSystemは問題なく動作させる
501            return true;
502        }
503        else {
504            //  バージョンが空の場合はエラー
505            return false;
506        }
507    }
508    var jsonVersion = value.split(".");
509    //  メジャーバージョンのチェック
510    if (currentVersion[0] != jsonVersion[0]) {
511        return false;
512    }
513    //  マイナーバージョンのチェック
514    if (currentVersion[1] != jsonVersion[1]) {
515        return false;
516    }
517    //  リビジョン番号が同じなら互換性があると行って良い
518    return true;
519}
520/**
521 * パーティクルの制御クラスです。
522 */
523var particle_system_ParticleSystem = /** @class */ (function () {
524    function ParticleSystem() {
525        /** @private  */
526        this._frameCount = 0;
527        this._drawingData = new data_drawing_DrawingData();
528        this._particlesPool = [];
529        this._activeParticles = [];
530        this.container = new createjs.Container();
531        // パフォーマンス向上の基本テクニック
532        this.container.mouseChildren = false;
533        this.container.mouseEnabled = false;
534        this._playing = true;
535        this.shapeGenerator = new shape_generator_ShapeGenerator();
536    }
537    /**
538     * パーティクルのアニメーションが再生されているかどうかを示します。
539     * @returns {boolean}
540     */
541    ParticleSystem.prototype.isPlaying = function () {
542        return this._playing;
543    };
544    /**
545     * パーティクルの設定データを取り込みます。
546     */
547    ParticleSystem.prototype.setData = function (drawingData) {
548        this._drawingData = drawingData;
549    };
550    /**
551     * パーティクルの設定データをJson形式のオブジェクトで取り込みます。
552     */
553    ParticleSystem.prototype.importFromJson = function (jsonObject) {
554        if (!checkVersion(jsonObject["VERSION"] || "")) {
555            console.warn("読み込んだJSONファイルとParticleJSのバージョンが異なります。\n" +
556                "https://github.com/ics-creative/ParticleJS");
557        }
558        this._drawingData.importFromJson(jsonObject);
559    };
560    /**
561     * パーティクルシステムの更新を行います。
562     */
563    ParticleSystem.prototype.update = function () {
564        if (!this._playing) {
565            return;
566        }
567        this.emit();
568        this.animate();
569        this.lifeCheck();
570    };
571    /**
572     * パーティクルの動きを更新します。
573     */
574    ParticleSystem.prototype.animate = function () {
575        var rad = createjs.Matrix2D.DEG_TO_RAD * this._drawingData.accelerationDirection;
576        var accX = Math.cos(rad) * this._drawingData.accelerationSpeed;
577        var accY = Math.sin(rad) * this._drawingData.accelerationSpeed;
578        for (var i = 0; i < this._activeParticles.length; i++) {
579            var particle = this._activeParticles[i];
580            // 加速度計算 (重力)
581            particle.vx += accX;
582            particle.vy += accY;
583            // 摩擦計算
584            particle.vx *= 1 - this._drawingData.friction;
585            particle.vy *= 1 - this._drawingData.friction;
586            // 座標計算
587            particle.x += particle.vx;
588            particle.y += particle.vy;
589
590/*
591            // 回転
592            particle.particleShape.rotation += this._drawingData.accelerationSpeed*1;
593            particle.particleShape.skewX += this._drawingData.accelerationSpeed*2;
594            particle.particleShape.skewY -= this._drawingData.accelerationSpeed*1;
595*/
596            // 座標の適用
597            particle.particleShape.x = particle.x;
598            particle.particleShape.y = particle.y;
599
600            var lifeParcent = particle.currentLife / particle.totalLife;
601            switch (Number(particle.alphaCurveType)) {
602                case AlphaCurveType.Random:
603                    var min = Math.min(particle.finishAlpha, particle.startAlpha);
604                    var max = Math.max(particle.finishAlpha, particle.startAlpha);
605                    particle.particleShape.alpha = Math.random() * (max - min) + min;
606                    break;
607                case AlphaCurveType.Normal:
608                default:
609                    var alpha = this.calcCurrentValue(particle.startAlpha, particle.finishAlpha, lifeParcent);
610                    particle.particleShape.alpha = alpha;
611                    break;
612            }
613            var scale = this.calcCurrentValue(particle.startScale, particle.finishScale, lifeParcent);
614            particle.particleShape.scaleX = particle.particleShape.scaleY = scale;
615            //  パーティクルが死んでいたら、オブジェクトプールに移動
616            if (particle.currentLife < 0) {
617                particle.isAlive = false;
618            }
619            // 年齢追加
620            particle.currentLife--;
621        }
622    };
623    /**
624     * パーティクルが生きているか確認します。
625     */
626    ParticleSystem.prototype.lifeCheck = function () {
627        for (var i = 0; i < this._activeParticles.length; i++) {
628            // もしも死んでいたら、アクティブリストから外してプールに保存する。
629            if (!this._activeParticles[i].isAlive) {
630                var particle = this._activeParticles[i];
631                this.container.removeChild(particle.particleShape);
632                this._activeParticles.splice(i, 1);
633                this._particlesPool.push(particle);
634                i--;
635            }
636        }
637    };
638    /**
639     * パーティクルを全て削除します。
640     */
641    ParticleSystem.prototype.clear = function () {
642        for (var i = 0; i < this._activeParticles.length; i++) {
643            var particle = this._activeParticles[i];
644            particle.isAlive = false;
645            this.container.removeChild(particle.particleShape);
646            this._activeParticles.splice(i, 1);
647            this._particlesPool.push(particle);
648            i--;
649        }
650    };
651    /**
652     * パーティクルシステムを破棄します。
653     */
654    ParticleSystem.prototype.dispose = function () {
655        for (var i = 0; i < this._activeParticles.length; i++) {
656            var particle = this._activeParticles[i];
657            particle.isAlive = false;
658            this.container.removeChild(particle.particleShape);
659        }
660        this._activeParticles.splice(0, this._activeParticles.length);
661        this._particlesPool.splice(0, this._particlesPool.length);
662        this._activeParticles = null;
663        this._particlesPool = null;
664        this.container = null;
665    };
666    /**
667     * パーティクルの生成を行います。
668     */
669    ParticleSystem.prototype.emit = function () {
670        // インターバルチェック
671        var framerate = Math.round(createjs.Ticker.framerate*10);//7秒単位に変更
672        var frameInSec = this._frameCount % framerate;
673        var emitPerSec = this._drawingData.emitFrequency;
674        var loopInt = emitPerSec == 0 ? 0 : Math.floor(emitPerSec / framerate);
675        // ① 整数分の実行回数
676        for (var i = 0; i < loopInt; i++) {
677            this.emitParticle();
678        }
679        // ② 小数点分の実行回数
680        var loopFloat = emitPerSec / framerate - loopInt;
681        // フレームレートより少ない場合、かつ、生成persecが0ではないとき
682        if (emitPerSec != 0 && frameInSec % Math.floor(1 / loopFloat) == 0) {
683            this.emitParticle();
684        }
685        this._frameCount++;
686        if (this._frameCount >= framerate) {
687            this._frameCount = 0;
688        }
689    };
690    /**
691     * 個々のパーティクルを生成し、パーティクルシステムに登録します。
692     * @returns {Particle}
693     */
694    ParticleSystem.prototype.emitParticle = function () {
695        var particle = this.generateParticle();
696        this.container.addChild(particle.particleShape);
697        this._activeParticles.push(particle);
698    };
699    /**
700     * パーティクルを生成し、パラメーターを設定します。
701     * @returns {Particle}
702     */
703    ParticleSystem.prototype.generateParticle = function () {
704        var particle = null;
705        if (this._particlesPool.length >= 1) {
706            particle = this._particlesPool.shift();
707        }
708        else {
709            particle = new particle_Particle();
710        }
711        this.setParticleParameter(particle);
712        return particle;
713    };
714    /**
715     * パーティクルパラメータの設定を行います。
716     * @param particle
717     */
718    ParticleSystem.prototype.setParticleParameter = function (particle) {
719        particle.particleShape.removeAllChildren();
720        particle.isAlive = true;
721        particle.x = this.calcRandomValueWithVariance(this._drawingData.startX, this._drawingData.startXVariance, false);
722        particle.y = this.calcRandomValueWithVariance(this._drawingData.startY, this._drawingData.startYVariance, false);
723        this.generateShape(particle, this._drawingData.shapeIdList);
724        //  生存期間
725        particle.totalLife = Math.max(1, this.calcRandomValueWithVariance(this._drawingData.lifeSpan, this._drawingData.lifeSpanVariance, true));
726        particle.currentLife = particle.totalLife;
727        //  スピード
728        var speed = Math.max(0, this.calcRandomValueWithVariance(this._drawingData.initialSpeed, this._drawingData.initialSpeedVariance, false));
729        var angle = createjs.Matrix2D.DEG_TO_RAD *
730            this.calcRandomValueWithVariance(this._drawingData.initialDirection, this._drawingData.initialDirectionVariance, false);
731        particle.vx = Math.cos(angle) * speed;
732        particle.vy = Math.sin(angle) * speed;
733        //  アルファ
734        particle.startAlpha = this.calcRandomValueWithRange(0.0, 1.0, this.calcRandomValueWithVariance(this._drawingData.startAlpha, this._drawingData.startAlphaVariance, false));
735        particle.finishAlpha = this.calcRandomValueWithRange(0.0, 1.0, this.calcRandomValueWithVariance(this._drawingData.finishAlpha, this._drawingData.finishAlphaVariance, false));
736        //  スケール
737        particle.startScale = Math.max(0, this.calcRandomValueWithVariance(this._drawingData.startScale, this._drawingData.startScaleVariance, false));
738        particle.finishScale = Math.max(0, this.calcRandomValueWithVariance(this._drawingData.finishScale, this._drawingData.finishScaleVariance, false));
739        // ブレンドモードを設定
740        particle.particleShape.compositeOperation =
741            this._drawingData.blendMode == true ? "lighter" : null;
742        particle.alphaCurveType = this._drawingData.alphaCurveType;
743    };
744    /**
745     * パーティクルに使用するシェイプを生成します。
746     * @param particle
747     * @param shapeIdList
748     */
749    ParticleSystem.prototype.generateShape = function (particle, shapeIdList) {
750
751        /* ===== add ===== */
752        var charaColorArray = [
753          { h: 330, s:  80, l: 92 },
754          { h:  47, s:  95, l: 83 },
755          { h: 104, s:  65, l: 78 },
756          { h: 353, s:  83, l: 84 },
757          { h: 218, s:  77, l: 88 },
758          { h: 196, s: 100, l: 82 },
759          { h: 253, s:  65, l: 80 }
760        ];
761        var randomColor = charaColorArray[Math.floor(Math.random() * charaColorArray.length)];
762        /* ===== add ===== */
763
764        particle.particleShape.removeAllChildren();
765        var startColor = this._drawingData.startColor;
766        /*
767        particle.startColor.hue =
768            this.calcRandomValueWithVariance(startColor.hue, startColor.hueVariance, false) % 360;
769        particle.startColor.luminance = this.calcRandomValueWithVariance(startColor.luminance, startColor.luminanceVariance, false);
770        particle.startColor.saturation = this.calcRandomValueWithVariance(startColor.saturation, startColor.saturationVariance, false);
771        var hue = Number(particle.startColor.hue);
772        var saturation = Number(particle.startColor.saturation);
773        var luminance = Number(particle.startColor.luminance);
774        */
775        // var color = "hsl(" + hue + ", " + saturation + "%, " + luminance + "%)";
776
777        /* ===== add ===== */
778        var color = "hsl(" + randomColor["h"] + ", " + randomColor["s"] + "%, " + randomColor["l"] + "%)";
779        /* ===== add ===== */
780
781        var r = Math.floor(Math.random() * this._drawingData.shapeIdList.length);
782        var shapeId = this._drawingData.shapeIdList.length == 0
783            ? ""
784            : this._drawingData.shapeIdList[r];
785        particle.colorCommand = null;
786        var container = this.shapeGenerator.generateShape(shapeId);
787        particle.particleShape.addChild(container);
788        var shape = container.getChildAt(0); // こういう作りにする
789        if (shape == null) {
790            return;
791        }
792/*
793        console.log(shape.graphics.instructions)
794        var instructions = shape.graphics.instructions;
795        if (instructions && instructions.length > 0) {
796            for (var i = 0; i < instructions.length; i++) {
797                var cmd = instructions[i];
798                if (cmd instanceof createjs.Graphics.Fill) {
799                    // 塗りのとき
800                    // グラデーション塗りだったら
801                    if (cmd.style instanceof CanvasGradient) {
802                        // 昔のグラデーションを保持
803                        var oldStyle = cmd.style;
804                        var g = ParticleSystem.HELPER_GRAPHICS;
805                        var newStyle = g.beginRadialGradientFill([color, "hsla(" + hue + ", " + saturation + "%, " + luminance + "%, 0)"], oldStyle.props.ratios, oldStyle.props.x0, oldStyle.props.y0, oldStyle.props.r0, oldStyle.props.x1, oldStyle.props.y1, oldStyle.props.r1).command;
806                        instructions[i] = newStyle;
807                    }
808                    else {
809                        // 単色塗りなら
810                        cmd.style = color;
811                        particle.colorCommand = cmd;
812                    }
813                }
814                else if (cmd instanceof createjs.Graphics.Stroke) {
815                    // 線のとき
816                    cmd.style = color;
817                    particle.colorCommand = cmd;
818                }
819            }
820        }			
821*/
822    };
823    /**
824     * 一時的にパーティクルの再生を停止します。
825     */
826    ParticleSystem.prototype.pause = function () {
827        this._playing = false;
828    };
829    /**
830     * pause()で停止したパーティクルの再生を再開します。
831     */
832    ParticleSystem.prototype.resume = function () {
833        this._playing = true;
834    };
835    /**
836     * 一定範囲の数値を計算します。
837     * @param minValue
838     * @param maxValue
839     * @param value
840     * @returns {number}
841     */
842    ParticleSystem.prototype.calcRandomValueWithRange = function (minValue, maxValue, value) {
843        return Math.min(maxValue, Math.max(minValue, value));
844    };
845    /**
846     * ばらつきのある値を計算し取得します。
847     * @param value 基準値です。
848     * @param variance バラつきの範囲です。
849     * @param isInteger 整数であるかを指定します。
850     * @returns {number}  数値を返します。
851     */
852    ParticleSystem.prototype.calcRandomValueWithVariance = function (value, variance, isInteger) {
853        var result = Number(value) + (Math.random() - 0.5) * variance;
854        if (isInteger == true) {
855            return Math.floor(result);
856        }
857        return result;
858    };
859    /**
860     * 現在の年齢依存の数値を計算します。
861     * @param start 開始時の値です。
862     * @param end 終了時の値です。
863     * @param life 現在の寿命を示します。開始時は1.0で、終了時は0.0の想定です。
864     * @returns {number} 現在の値です。
865     */
866    ParticleSystem.prototype.calcCurrentValue = function (start, end, life) {
867        return Number(start) * life + Number(end) * (1 - life);
868    };
869    Object.defineProperty(ParticleSystem.prototype, "emitFrequency", {
870        /**
871         * 1秒あたりの発生数です。
872         * @returns {number}
873         */
874        get: function () {
875            return this._drawingData.emitFrequency;
876        },
877        /**
878         * 1秒あたりの発生数です。
879         * @param value
880         */
881        set: function (value) {
882            this._drawingData.emitFrequency = value;
883        },
884        enumerable: true,
885        configurable: true
886    });
887    Object.defineProperty(ParticleSystem.prototype, "startX", {
888        /**
889         * 発生基準位置 - X座標 (px)です。
890         * @returns {number}
891         */
892        get: function () {
893            return this._drawingData.startX;
894        },
895        /**
896         * 発生基準位置 - X座標 (px)です。
897         * @param value
898         */
899        set: function (value) {
900            this._drawingData.startX = value;
901        },
902        enumerable: true,
903        configurable: true
904    });
905    Object.defineProperty(ParticleSystem.prototype, "startXVariance", {
906        /**
907         * 発生基準位置 - X座標のばらつき (px)です。
908         * @returns {number}
909         */
910        get: function () {
911            return this._drawingData.startX;
912        },
913        /**
914         * 発生基準位置 - X座標のばらつき (px)です。
915         * @param value
916         */
917        set: function (value) {
918            this._drawingData.startXVariance = value;
919        },
920        enumerable: true,
921        configurable: true
922    });
923    Object.defineProperty(ParticleSystem.prototype, "startY", {
924        /**
925         * 発生位置 - Y座標 (px)です。
926         * @returns {number}
927         */
928        get: function () {
929            return this._drawingData.startY;
930        },
931        /**
932         * 発生位置 - Y座標 (px)です。
933         * @param value
934         */
935        set: function (value) {
936            this._drawingData.startY = value;
937        },
938        enumerable: true,
939        configurable: true
940    });
941    Object.defineProperty(ParticleSystem.prototype, "startYVariance", {
942        /**
943         * 発生基準位置 - X座標のばらつき (px)です。
944         * @returns {number}
945         */
946        get: function () {
947            return this._drawingData.startYVariance;
948        },
949        /**
950         * 発生基準位置 - X座標のばらつき (px)です。
951         * @param value
952         */
953        set: function (value) {
954            this._drawingData.startYVariance = value;
955        },
956        enumerable: true,
957        configurable: true
958    });
959    Object.defineProperty(ParticleSystem.prototype, "initialDirection", {
960        /**
961         * 初期速度 - 方向 (度)です。
962         * @returns {number}
963         */
964        get: function () {
965            return this._drawingData.initialDirection;
966        },
967        /**
968         * 初期速度 - 方向 (度)です。
969         * @param value
970         */
971        set: function (value) {
972            this._drawingData.initialDirection = value;
973        },
974        enumerable: true,
975        configurable: true
976    });
977    Object.defineProperty(ParticleSystem.prototype, "initialDirectionVariance", {
978        /**
979         * 初期速度 - 方向のばらつき (度)です。
980         * @returns {number}
981         */
982        get: function () {
983            return this._drawingData.initialDirectionVariance;
984        },
985        /**
986         * 初期速度 - 方向のばらつき (度)です。
987         * @param value
988         */
989        set: function (value) {
990            this._drawingData.initialDirectionVariance = value;
991        },
992        enumerable: true,
993        configurable: true
994    });
995    Object.defineProperty(ParticleSystem.prototype, "initialSpeed", {
996        /**
997         * 初期速度 (px)です。
998         * @returns {number}
999         */
1000        get: function () {
1001            return this._drawingData.initialSpeed;
1002        },
1003        /**
1004         * 初期速度 (px)です。
1005         * @param value
1006         */
1007        set: function (value) {
1008            this._drawingData.initialSpeed = value;
1009        },
1010        enumerable: true,
1011        configurable: true
1012    });
1013    Object.defineProperty(ParticleSystem.prototype, "initialSpeedVariance", {
1014        /**
1015         * 初期速度のばらつきです。
1016         * @returns {number}
1017         */
1018        get: function () {
1019            return this._drawingData.initialSpeedVariance;
1020        },
1021        /**
1022         * 初期速度のばらつきです。
1023         * @param value
1024         */
1025        set: function (value) {
1026            this._drawingData.initialSpeedVariance = value;
1027        },
1028        enumerable: true,
1029        configurable: true
1030    });
1031    Object.defineProperty(ParticleSystem.prototype, "friction", {
1032        /**
1033         * 摩擦です。
1034         * @returns {number}
1035         */
1036        get: function () {
1037            return this._drawingData.friction;
1038        },
1039        /**
1040         * 摩擦です。
1041         * @param value
1042         */
1043        set: function (value) {
1044            this._drawingData.friction = value;
1045        },
1046        enumerable: true,
1047        configurable: true
1048    });
1049    Object.defineProperty(ParticleSystem.prototype, "accelerationSpeed", {
1050        /**
1051         * 重力です。
1052         * @returns {number}
1053         */
1054        get: function () {
1055            return this._drawingData.accelerationSpeed;
1056        },
1057        /**
1058         * 重力です。
1059         * @param value
1060         */
1061        set: function (value) {
1062            this._drawingData.accelerationSpeed = value;
1063        },
1064        enumerable: true,
1065        configurable: true
1066    });
1067    Object.defineProperty(ParticleSystem.prototype, "accelerationDirection", {
1068        /**
1069         * 重力です。
1070         * @returns {number}
1071         */
1072        get: function () {
1073            return this._drawingData.accelerationDirection;
1074        },
1075        /**
1076         * 重力方向 (度)です。
1077         * @param value
1078         */
1079        set: function (value) {
1080            this._drawingData.accelerationDirection = value;
1081        },
1082        enumerable: true,
1083        configurable: true
1084    });
1085    Object.defineProperty(ParticleSystem.prototype, "startScale", {
1086        /**
1087         * 開始時のスケールです。
1088         * @returns {number}
1089         */
1090        get: function () {
1091            return this._drawingData.startScale;
1092        },
1093        /**
1094         * 開始時のスケールです。
1095         * @param value
1096         */
1097        set: function (value) {
1098            this._drawingData.startScale = value;
1099        },
1100        enumerable: true,
1101        configurable: true
1102    });
1103    Object.defineProperty(ParticleSystem.prototype, "startScaleVariance", {
1104        /**
1105         * 開始時のスケールのばらつきです。
1106         * @returns {number}
1107         */
1108        get: function () {
1109            return this._drawingData.startScaleVariance;
1110        },
1111        /**
1112         * 開始時のスケールのばらつきです。
1113         * @param value
1114         */
1115        set: function (value) {
1116            this._drawingData.startScaleVariance = value;
1117        },
1118        enumerable: true,
1119        configurable: true
1120    });
1121    Object.defineProperty(ParticleSystem.prototype, "finishScale", {
1122        /**
1123         * 終了時のスケールです。
1124         * @returns {number}
1125         */
1126        get: function () {
1127            return this._drawingData.finishScale;
1128        },
1129        /**
1130         * 終了時のスケールです。
1131         * @param value
1132         */
1133        set: function (value) {
1134            this._drawingData.finishScale = value;
1135        },
1136        enumerable: true,
1137        configurable: true
1138    });
1139    Object.defineProperty(ParticleSystem.prototype, "finishScaleVariance", {
1140        /**
1141         * 終了時のスケールのばらつきです。
1142         * @returns {number}
1143         */
1144        get: function () {
1145            return this._drawingData.finishScaleVariance;
1146        },
1147        /**
1148         * 終了時のスケールのばらつきです。
1149         * @param value
1150         */
1151        set: function (value) {
1152            this._drawingData.finishScaleVariance = value;
1153        },
1154        enumerable: true,
1155        configurable: true
1156    });
1157    Object.defineProperty(ParticleSystem.prototype, "lifeSpan", {
1158        /**
1159         * ライフ(フレーム数)です。
1160         * @returns {number}
1161         */
1162        get: function () {
1163            return this._drawingData.lifeSpan;
1164        },
1165        /**
1166         * ライフ(フレーム数)です。
1167         * @param value
1168         */
1169        set: function (value) {
1170            this._drawingData.lifeSpan = value;
1171        },
1172        enumerable: true,
1173        configurable: true
1174    });
1175    Object.defineProperty(ParticleSystem.prototype, "lifeSpanVariance", {
1176        /**
1177         * ライフのばらつき(フレーム数)です。
1178         * @returns {number}
1179         */
1180        get: function () {
1181            return this._drawingData.lifeSpanVariance;
1182        },
1183        /**
1184         * ライフのばらつき(フレーム数)です。
1185         * @param value
1186         */
1187        set: function (value) {
1188            this._drawingData.lifeSpanVariance = value;
1189        },
1190        enumerable: true,
1191        configurable: true
1192    });
1193    Object.defineProperty(ParticleSystem.prototype, "startAlpha", {
1194        /**
1195         * 始時の透明度です。
1196         * @returns {number}
1197         */
1198        get: function () {
1199            return this._drawingData.startAlpha;
1200        },
1201        /**
1202         * 始時の透明度です。
1203         * @param value
1204         */
1205        set: function (value) {
1206            this._drawingData.startAlpha = value;
1207        },
1208        enumerable: true,
1209        configurable: true
1210    });
1211    Object.defineProperty(ParticleSystem.prototype, "startAlphaVariance", {
1212        /**
1213         * 開始時の透明度のばらつきです。
1214         * @returns {number}
1215         */
1216        get: function () {
1217            return this._drawingData.startAlphaVariance;
1218        },
1219        /**
1220         * 開始時の透明度のばらつきです。
1221         * @param value
1222         */
1223        set: function (value) {
1224            this._drawingData.startAlphaVariance = value;
1225        },
1226        enumerable: true,
1227        configurable: true
1228    });
1229    Object.defineProperty(ParticleSystem.prototype, "finishAlpha", {
1230        /**
1231         * 終了時の透明度です。
1232         * @returns {number}
1233         */
1234        get: function () {
1235            return this._drawingData.finishAlpha;
1236        },
1237        /**
1238         * 終了時の透明度です。
1239         * @param value
1240         */
1241        set: function (value) {
1242            this._drawingData.finishAlpha = value;
1243        },
1244        enumerable: true,
1245        configurable: true
1246    });
1247    Object.defineProperty(ParticleSystem.prototype, "finishAlphaVariance", {
1248        /**
1249         * 終了時の透明度のばらつきです。
1250         * @returns {number}
1251         */
1252        get: function () {
1253            return this._drawingData.finishAlphaVariance;
1254        },
1255        /**
1256         * 終了時の透明度のばらつきです。
1257         * @param value
1258         */
1259        set: function (value) {
1260            this._drawingData.finishAlphaVariance = value;
1261        },
1262        enumerable: true,
1263        configurable: true
1264    });
1265    Object.defineProperty(ParticleSystem.prototype, "shapeIdList", {
1266        /**
1267         * 使用するシェイプID設定です。
1268         * @returns {string[]}
1269         */
1270        get: function () {
1271            return this._drawingData.shapeIdList;
1272        },
1273        /**
1274         * 使用するシェイプID設定です。
1275         * @param string[]
1276         */
1277        set: function (value) {
1278            this._drawingData.shapeIdList = value;
1279        },
1280        enumerable: true,
1281        configurable: true
1282    });
1283    Object.defineProperty(ParticleSystem.prototype, "startColor", {
1284        /**
1285         * 初期カラーの設定です。
1286         * @returns {ColorData}
1287         */
1288        get: function () {
1289            return this._drawingData.startColor;
1290        },
1291        /**
1292         * 初期カラーの設定です。
1293         * @param value
1294         */
1295        set: function (value) {
1296            this._drawingData.startColor = value;
1297        },
1298        enumerable: true,
1299        configurable: true
1300    });
1301    Object.defineProperty(ParticleSystem.prototype, "blendMode", {
1302        /**
1303         * trueのときシェイプを加算合成します。
1304         * @returns {boolean}
1305         */
1306        get: function () {
1307            return this._drawingData.blendMode;
1308        },
1309        /**
1310         * trueのときシェイプを加算合成します。
1311         * @param value
1312         */
1313        set: function (value) {
1314            this._drawingData.blendMode = value;
1315        },
1316        enumerable: true,
1317        configurable: true
1318    });
1319    Object.defineProperty(ParticleSystem.prototype, "alphaCurveType", {
1320        /**
1321         * 透明度の計算式の設定です。
1322         * @returns {number}
1323         */
1324        get: function () {
1325            return this._drawingData.alphaCurveType;
1326        },
1327        /**
1328         * 透明度の計算式の設定です。
1329         * @param value - 0:通常, 1:ランダム
1330         */
1331        set: function (value) {
1332            this._drawingData.alphaCurveType = value;
1333        },
1334        enumerable: true,
1335        configurable: true
1336    });
1337    /**
1338     *  グラフィックオブジェクトです。内部計算に使用します。
1339     */
1340    ParticleSystem.HELPER_GRAPHICS = new createjs.Graphics();
1341    return ParticleSystem;
1342}());
1343
1344
1345// CONCATENATED MODULE: ./src/particlejs.ts
1346/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ParticleSystem", function() { return particle_system_ParticleSystem; });
1347/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "Particle", function() { return particle_Particle; });
1348/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
1349/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "DrawingData", function() { return data_drawing_DrawingData; });
1350/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ColorData", function() { return ColorData; });
1351/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ShapeData", function() { return ShapeData; });
1352/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ShapeGenerator", function() { return shape_generator_ShapeGenerator; });
1353/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "AlphaCurveType", function() { return AlphaCurveType; });
1354/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "ShapeType", function() { return ShapeType; });
1355/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "Assets", function() { return Assets; });
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368/***/ }),
1369/* 1 */
1370/***/ (function(module, exports, __webpack_require__) {
1371
1372module.exports = __webpack_require__(0);
1373
1374
1375/***/ })
1376/******/ ]);
1377});
1378//# sourceMappingURL=particlejs.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.