Ignore:
Timestamp:
12/12/24 17:06:06 (6 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Children:
79a0317
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified imaps-frontend/node_modules/konva/lib/Tween.js

    rd565449 r0c6b92a  
    66const Node_1 = require("./Node");
    77const Global_1 = require("./Global");
    8 var blacklist = {
     8let blacklist = {
    99    node: 1,
    1010    duration: 1,
     
    3232    }
    3333    fire(str) {
    34         var handler = this[str];
     34        const handler = this[str];
    3535        if (handler) {
    3636            handler();
     
    111111    }
    112112    onEnterFrame() {
    113         var t = this.getTimer() - this._startTime;
     113        const t = this.getTimer() - this._startTime;
    114114        if (this.state === PLAYING) {
    115115            this.setTime(t);
     
    129129class Tween {
    130130    constructor(config) {
    131         var that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;
     131        let that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;
    132132        if (typeof config.duration === 'undefined') {
    133133            duration = 0.3;
     
    141141        this.node = node;
    142142        this._id = idCounter++;
    143         var layers = node.getLayer() ||
     143        const layers = node.getLayer() ||
    144144            (node instanceof Global_1.Konva['Stage'] ? node.getLayers() : null);
    145145        if (!layers) {
     
    173173    }
    174174    _addAttr(key, end) {
    175         var node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;
     175        let node = this.node, nodeId = node._id, start, diff, tweenId, n, len, trueEnd, trueStart, endRGBA;
    176176        tweenId = Tween.tweens[nodeId][key];
    177177        if (tweenId) {
     
    198198                    }
    199199                    else {
    200                         var startRGBA = Util_1.Util.colorToRGBA(start[n]);
     200                        const startRGBA = Util_1.Util.colorToRGBA(start[n]);
    201201                        endRGBA = Util_1.Util.colorToRGBA(end[n]);
    202202                        start[n] = startRGBA;
     
    239239    }
    240240    _tweenFunc(i) {
    241         var node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;
     241        let node = this.node, attrs = Tween.attrs[node._id][this._id], key, attr, start, diff, newVal, n, len, end;
    242242        for (key in attrs) {
    243243            attr = attrs[key];
     
    301301        };
    302302        this.tween.onFinish = () => {
    303             var node = this.node;
    304             var attrs = Tween.attrs[node._id][this._id];
     303            const node = this.node;
     304            const attrs = Tween.attrs[node._id][this._id];
    305305            if (attrs.points && attrs.points.trueEnd) {
    306306                node.setAttr('points', attrs.points.trueEnd);
     
    311311        };
    312312        this.tween.onReset = () => {
    313             var node = this.node;
    314             var attrs = Tween.attrs[node._id][this._id];
     313            const node = this.node;
     314            const attrs = Tween.attrs[node._id][this._id];
    315315            if (attrs.points && attrs.points.trueStart) {
    316316                node.points(attrs.points.trueStart);
     
    351351    }
    352352    destroy() {
    353         var nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;
     353        let nodeId = this.node._id, thisId = this._id, attrs = Tween.tweens[nodeId], key;
    354354        this.pause();
    355355        for (key in attrs) {
     
    363363Tween.tweens = {};
    364364Node_1.Node.prototype.to = function (params) {
    365     var onFinish = params.onFinish;
     365    const onFinish = params.onFinish;
    366366    params.node = this;
    367367    params.onFinish = function () {
     
    371371        }
    372372    };
    373     var tween = new Tween(params);
     373    const tween = new Tween(params);
    374374    tween.play();
    375375};
    376376exports.Easings = {
    377377    BackEaseIn(t, b, c, d) {
    378         var s = 1.70158;
     378        const s = 1.70158;
    379379        return c * (t /= d) * t * ((s + 1) * t - s) + b;
    380380    },
    381381    BackEaseOut(t, b, c, d) {
    382         var s = 1.70158;
     382        const s = 1.70158;
    383383        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
    384384    },
    385385    BackEaseInOut(t, b, c, d) {
    386         var s = 1.70158;
     386        let s = 1.70158;
    387387        if ((t /= d / 2) < 1) {
    388388            return (c / 2) * (t * t * (((s *= 1.525) + 1) * t - s)) + b;
     
    391391    },
    392392    ElasticEaseIn(t, b, c, d, a, p) {
    393         var s = 0;
     393        let s = 0;
    394394        if (t === 0) {
    395395            return b;
     
    413413    },
    414414    ElasticEaseOut(t, b, c, d, a, p) {
    415         var s = 0;
     415        let s = 0;
    416416        if (t === 0) {
    417417            return b;
     
    435435    },
    436436    ElasticEaseInOut(t, b, c, d, a, p) {
    437         var s = 0;
     437        let s = 0;
    438438        if (t === 0) {
    439439            return b;
Note: See TracChangeset for help on using the changeset viewer.