ziko 0.48.1 → 0.48.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ziko.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Mon Nov 10 2025 12:43:12 GMT+0100 (UTC+01:00)
5
+ Date : Fri Nov 21 2025 22:08:16 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -3787,27 +3787,27 @@
3787
3787
  this.b=a.b;
3788
3788
  }
3789
3789
  else if(typeof(a)==="object"){
3790
- if(("a" in b && "b" in a)){
3790
+ if(("a" in a && "b" in a)){
3791
3791
  this.a=a.a;
3792
3792
  this.b=a.b;
3793
3793
  }
3794
- else if(("a" in b && "z" in a)){
3794
+ else if(("a" in a && "z" in a)){
3795
3795
  this.a=a.a;
3796
3796
  this.b=sqrt$2((a.z**2)-(a.a**2));
3797
3797
  }
3798
- else if(("a" in b && "phi" in a)){
3798
+ else if(("a" in a && "phi" in a)){
3799
3799
  this.a=a.a;
3800
3800
  this.b=a.a*tan(a.phi);
3801
3801
  }
3802
- else if(("b" in b && "z" in a)){
3802
+ else if(("b" in a && "z" in a)){
3803
3803
  this.b=a.b;
3804
3804
  this.a=sqrt$2((a.z**2)-(a.b**2));
3805
3805
  }
3806
- else if(("b" in b && "phi" in a)){
3806
+ else if(("b" in a && "phi" in a)){
3807
3807
  this.b=b;
3808
3808
  this.a=a.b/tan(a.phi);
3809
3809
  }
3810
- else if(("z" in b && "phi" in a)){
3810
+ else if(("z" in a && "phi" in a)){
3811
3811
  this.a=a.z*cos$2(a.phi);
3812
3812
  this.a=a.z*sin$2(a.phi);
3813
3813
  }
@@ -3946,17 +3946,6 @@
3946
3946
  const de=cos$2(this.a*2)+cosh$1(this.b*2);
3947
3947
  return complex(sin$2(2*this.a)/de,sinh$1(2*this.b)/de);
3948
3948
  }
3949
- printInConsole() {
3950
- let string = this.a + " + " + this.b + " * i";
3951
- console.log(string);
3952
- return string;
3953
- }
3954
- print() {
3955
- //return text(this.a + " + i * " + this.b);
3956
- }
3957
- UI() {
3958
- return "<span>" + this.a + " + i * " + this.b + "</span>";
3959
- }
3960
3949
  }
3961
3950
  const complex=(a,b)=>{
3962
3951
  if((a instanceof Array||ArrayBuffer.isView(a)) && (b instanceof Array||ArrayBuffer.isView(a)))return a.map((n,i)=>complex(a[i],b[i]));
@@ -4084,86 +4073,127 @@
4084
4073
  )
4085
4074
  };
4086
4075
 
4087
- const {PI, sqrt: sqrt$1, cos: cos$1, sin: sin$1, acos, pow} = Math;
4088
-
4089
- const Linear = t => t;
4090
- const InSin = t => 1 - cos$1((t * PI) / 2);
4091
- const OutSin = t => sin$1((t * PI) / 2);
4092
- const InOutSin = t => -(cos$1(PI * t) - 1) / 2;
4093
-
4094
- const InQuad = t => t**2;
4095
- const OutQuad = t => 1 - (1-t)**2;
4096
- const InOutQuad = t => t < 0.5 ? 2 * (t**2) : 1 - (-2 * t + 2)**2 / 2;
4097
-
4098
- const InCubic = t => t**3;
4099
- const OutCubic = t => 1 - (1-t)**3;
4100
- const InOutCubic = t => t < 0.5 ? 4 * (t**3) : 1 - (-2 * t + 2)**3 / 2;
4101
-
4102
- const InQuart = t => t**4;
4103
- const OutQuart = t => 1 - (1-t)**4;
4104
- const InOutQuart = t => t < 0.5 ? 8 * (t**4) : 1 - (-2 * t + 2)**4 / 2;
4105
-
4106
- const InQuint = t => t**5;
4107
- const OutQuint = t => 1 - (1-t)**5;
4108
- const InOutQuint = t => t < 0.5 ? 16 * (t**5) : 1 - (-2 * t + 2)**5 / 2;
4109
-
4110
- const InExpo = t => t === 0 ? 0 : 2**(10*t - 10);
4111
- const OutExpo = t => t === 1 ? 1 : 1 - 2**(-10 * t);
4112
- const InOutExpo = t => t === 0? 0: t === 1? 1: t < 0.5 ? 2**(20 * t - 10) / 2: (2 - 2**(-20 * t + 10)) / 2;
4113
-
4114
- const InCirc = t => 1 - sqrt$1(1 - t**2);
4115
- const OutCirc = t => sqrt$1(1 - (t-1)**2);
4116
- const InOutCirc = t => t < 0.5? (1 - sqrt$1(1 - (2*t)**2)) / 2: (sqrt$1(1 - (-2*t+2)**2) + 1) / 2;
4117
-
4118
- const Arc = t => 1 - sin$1(acos(t));
4119
- const Back = (t, x = 1) => (t**2) * ((x+1)*t - x);
4120
- const Elastic = t => -2*pow(2, 10 * (t - 1)) * cos$1(20 * PI * t / 3 * t);
4121
-
4122
- const InBack = (t, c1 = 1.70158, c3 = c1 + 1) => c3 * pow(t,3)- c1 * (t**2);
4123
- const OutBack = (t, c1 = 1.70158, c3 = c1 + 1) => 1 + c3 * pow(t - 1, 3) + c1 * pow(t - 1, 2);
4124
- const InOutBack = (t, c1 = 1.70158, c2 = c1 * 1.525) => t < 0.5 ? (pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2 : (pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2;
4125
-
4126
- const InElastic = (t, c4 = 2*PI/3) => {
4127
- return t === 0
4128
- ? 0
4129
- : t === 1
4130
- ? 1
4131
- : -pow(2, 10 * t - 10) * sin$1((t * 10 - 10.75) * c4);
4132
- };
4133
-
4134
- const OutElastic = (t, c4 = 2*PI/3) => {
4135
- return t === 0
4136
- ? 0
4137
- : t === 1
4138
- ? 1
4139
- : pow(2, -10 * t) * sin$1((t * 10 - 0.75) * c4) + 1;
4140
- };
4141
- const InOutElastic = (t, c5 = 2 * PI / 4.5) => {
4142
- return t === 0
4143
- ? 0
4144
- : t === 1
4145
- ? 1
4146
- : t < 0.5
4147
- ? -(pow(2, 20 * t - 10) * sin$1((20 * t - 11.125) * c5)) / 2
4148
- : (pow(2, -20 * t + 10) * sin$1((20 * t - 11.125) * c5)) / 2 + 1;
4149
- };
4150
-
4151
- const InBounce = (t, n1 = 7.5625, d1 = 2.75) => 1 - OutBounce(1-t, n1, d1);
4152
- const OutBounce = (t, n1 = 7.5625, d1 = 2.75) => {
4153
- if(t<1/d1) return n1 * t * t;
4154
- if(t < 2 / d1) return n1 * (t -= 1.5 / d1) * t + 0.75;
4155
- if(t < 2.5 / d1) return n1 * (t -= 2.25 / d1) * t + 0.9375;
4076
+ const { PI, sqrt: sqrt$1, cos: cos$1, sin: sin$1, acos, pow } = Math;
4077
+
4078
+ const linear = t => t;
4079
+
4080
+ // --- Sin ---
4081
+ const in_sin = t => 1 - cos$1((t * PI) / 2);
4082
+ const out_sin = t => sin$1((t * PI) / 2);
4083
+ const in_out_sin = t => -(cos$1(PI * t) - 1) / 2;
4084
+
4085
+ // --- Quad ---
4086
+ const in_quad = t => t ** 2;
4087
+ const out_quad = t => 1 - (1 - t) ** 2;
4088
+ const in_out_quad = t =>
4089
+ t < 0.5 ? 2 * (t ** 2) : 1 - (-2 * t + 2) ** 2 / 2;
4090
+
4091
+ // --- Cubic ---
4092
+ const in_cubic = t => t ** 3;
4093
+ const out_cubic = t => 1 - (1 - t) ** 3;
4094
+ const in_out_cubic = t =>
4095
+ t < 0.5 ? 4 * (t ** 3) : 1 - (-2 * t + 2) ** 3 / 2;
4096
+
4097
+ // --- Quart ---
4098
+ const in_quart = t => t ** 4;
4099
+ const out_quart = t => 1 - (1 - t) ** 4;
4100
+ const in_out_quart = t =>
4101
+ t < 0.5 ? 8 * (t ** 4) : 1 - (-2 * t + 2) ** 4 / 2;
4102
+
4103
+ // --- Quint ---
4104
+ const in_quint = t => t ** 5;
4105
+ const out_quint = t => 1 - (1 - t) ** 5;
4106
+ const in_out_quint = t =>
4107
+ t < 0.5 ? 16 * (t ** 5) : 1 - (-2 * t + 2) ** 5 / 2;
4108
+
4109
+ // --- Expo ---
4110
+ const in_expo = t => (t === 0 ? 0 : 2 ** (10 * t - 10));
4111
+ const out_expo = t => (t === 1 ? 1 : 1 - 2 ** (-10 * t));
4112
+ const in_out_expo = t =>
4113
+ t === 0
4114
+ ? 0
4115
+ : t === 1
4116
+ ? 1
4117
+ : t < 0.5
4118
+ ? 2 ** (20 * t - 10) / 2
4119
+ : (2 - 2 ** (-20 * t + 10)) / 2;
4120
+
4121
+ // --- Circ ---
4122
+ const in_circ = t => 1 - sqrt$1(1 - t ** 2);
4123
+ const out_circ = t => sqrt$1(1 - (t - 1) ** 2);
4124
+ const in_out_circ = t =>
4125
+ t < 0.5
4126
+ ? (1 - sqrt$1(1 - (2 * t) ** 2)) / 2
4127
+ : (sqrt$1(1 - (-2 * t + 2) ** 2) + 1) / 2;
4128
+
4129
+ // --- Arc ---
4130
+ const arc = t => 1 - sin$1(acos(t));
4131
+
4132
+ // --- Back ---
4133
+ const back = (t, x = 1) => (t ** 2) * ((x + 1) * t - x);
4134
+
4135
+ // --- Elastic ---
4136
+ const elastic = t =>
4137
+ -2 * pow(2, 10 * (t - 1)) * cos$1((20 * PI * t) / 3 * t);
4138
+
4139
+ // --- Back variations ---
4140
+ const in_back = (t, c1 = 1.70158, c3 = c1 + 1) =>
4141
+ c3 * pow(t, 3) - c1 * (t ** 2);
4142
+
4143
+ const out_back = (t, c1 = 1.70158, c3 = c1 + 1) =>
4144
+ 1 + c3 * pow(t - 1, 3) + c1 * pow(t - 1, 2);
4145
+
4146
+ const in_out_back = (t, c1 = 1.70158, c2 = c1 * 1.525) =>
4147
+ t < 0.5
4148
+ ? (pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2
4149
+ : (pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2;
4150
+
4151
+ // --- Elastic variations ---
4152
+ const in_elastic = (t, c4 = (2 * PI) / 3) =>
4153
+ t === 0
4154
+ ? 0
4155
+ : t === 1
4156
+ ? 1
4157
+ : -pow(2, 10 * t - 10) * sin$1((t * 10 - 10.75) * c4);
4158
+
4159
+ const out_elastic = (t, c4 = (2 * PI) / 3) =>
4160
+ t === 0
4161
+ ? 0
4162
+ : t === 1
4163
+ ? 1
4164
+ : pow(2, -10 * t) * sin$1((t * 10 - 0.75) * c4) + 1;
4165
+
4166
+ const in_out_elastic = (t, c5 = (2 * PI) / 4.5) =>
4167
+ t === 0
4168
+ ? 0
4169
+ : t === 1
4170
+ ? 1
4171
+ : t < 0.5
4172
+ ? -(pow(2, 20 * t - 10) * sin$1((20 * t - 11.125) * c5)) / 2
4173
+ : (pow(2, -20 * t + 10) * sin$1((20 * t - 11.125) * c5)) / 2 + 1;
4174
+
4175
+ // --- Bounce ---
4176
+ const in_bounce = (t, n1 = 7.5625, d1 = 2.75) =>
4177
+ 1 - out_bounce(1 - t, n1, d1);
4178
+
4179
+ const out_bounce = (t, n1 = 7.5625, d1 = 2.75) => {
4180
+ if (t < 1 / d1) return n1 * t * t;
4181
+ if (t < 2 / d1) return n1 * (t -= 1.5 / d1) * t + 0.75;
4182
+ if (t < 2.5 / d1) return n1 * (t -= 2.25 / d1) * t + 0.9375;
4156
4183
  return n1 * (t -= 2.625 / d1) * t + 0.984375;
4157
4184
  };
4158
4185
 
4159
- const InOutBounce = (t, n1 = 7.5625, d1 = 2.75) => t < 0.5 ? OutBounce(1 - 2 * t, n1, d1)/2 : OutBounce(2 * t - 1, n1, d1)/2;
4160
-
4186
+ const in_out_bounce = (t, n1 = 7.5625, d1 = 2.75) =>
4187
+ t < 0.5
4188
+ ? out_bounce(1 - 2 * t, n1, d1) / 2
4189
+ : out_bounce(2 * t - 1, n1, d1) / 2;
4161
4190
 
4162
- const Step = (t, steps = 5) => Math.floor(t*steps) / steps;
4163
- const Discret = (t, segments = 5) => Math.ceil(t*segments) / segments;
4191
+ // --- Step / Discrete ---
4192
+ const step = (t, steps = 5) => Math.floor(t * steps) / steps;
4193
+ const discret = (t, segments = 5) => Math.ceil(t * segments) / segments;
4164
4194
 
4165
4195
  class TimeAnimation {
4166
- constructor(callback, { ease = Linear, step = 50, t0 = 0, start = true, duration = 3000 } = {}) {
4196
+ constructor(callback, { ease = linear, step = 50, t0 = 0, start = true, duration = 3000 } = {}) {
4167
4197
  this.callback = callback;
4168
4198
  this.state = {
4169
4199
  isRunning: false,
@@ -5366,59 +5396,23 @@
5366
5396
  }
5367
5397
 
5368
5398
  exports.App = App;
5369
- exports.Arc = Arc;
5370
- exports.Back = Back;
5371
5399
  exports.Base = Base;
5372
5400
  exports.Clock = Clock;
5373
5401
  exports.Combinaison = Combinaison;
5374
5402
  exports.Complex = Complex;
5375
- exports.Discret = Discret;
5376
5403
  exports.E = E;
5377
5404
  exports.EPSILON = EPSILON;
5378
- exports.Elastic = Elastic;
5379
5405
  exports.FileBasedRouting = FileBasedRouting;
5380
5406
  exports.Flex = Flex;
5381
5407
  exports.HTMLWrapper = HTMLWrapper;
5382
- exports.InBack = InBack;
5383
- exports.InBounce = InBounce;
5384
- exports.InCirc = InCirc;
5385
- exports.InCubic = InCubic;
5386
- exports.InElastic = InElastic;
5387
- exports.InExpo = InExpo;
5388
- exports.InOutBack = InOutBack;
5389
- exports.InOutBounce = InOutBounce;
5390
- exports.InOutCirc = InOutCirc;
5391
- exports.InOutCubic = InOutCubic;
5392
- exports.InOutElastic = InOutElastic;
5393
- exports.InOutExpo = InOutExpo;
5394
- exports.InOutQuad = InOutQuad;
5395
- exports.InOutQuart = InOutQuart;
5396
- exports.InOutQuint = InOutQuint;
5397
- exports.InOutSin = InOutSin;
5398
- exports.InQuad = InQuad;
5399
- exports.InQuart = InQuart;
5400
- exports.InQuint = InQuint;
5401
- exports.InSin = InSin;
5402
- exports.Linear = Linear;
5403
5408
  exports.Logic = Logic$1;
5404
5409
  exports.Matrix = Matrix;
5405
- exports.OutBack = OutBack;
5406
- exports.OutBounce = OutBounce;
5407
- exports.OutCirc = OutCirc;
5408
- exports.OutCubic = OutCubic;
5409
- exports.OutElastic = OutElastic;
5410
- exports.OutExpo = OutExpo;
5411
- exports.OutQuad = OutQuad;
5412
- exports.OutQuart = OutQuart;
5413
- exports.OutQuint = OutQuint;
5414
- exports.OutSin = OutSin;
5415
5410
  exports.PI = PI$2;
5416
5411
  exports.Permutation = Permutation;
5417
5412
  exports.Random = Random;
5418
5413
  exports.SPA = SPA;
5419
5414
  exports.SVGWrapper = SVGWrapper;
5420
5415
  exports.Scheduler = Scheduler;
5421
- exports.Step = Step;
5422
5416
  exports.Suspense = Suspense;
5423
5417
  exports.Switch = Switch;
5424
5418
  exports.Tick = Tick;
@@ -5459,12 +5453,14 @@
5459
5453
  exports.add = add;
5460
5454
  exports.animation = animation;
5461
5455
  exports.arange = arange;
5456
+ exports.arc = arc;
5462
5457
  exports.arr2str = arr2str;
5463
5458
  exports.asin = asin;
5464
5459
  exports.asinh = asinh;
5465
5460
  exports.atan = atan;
5466
5461
  exports.atan2 = atan2;
5467
5462
  exports.atanh = atanh;
5463
+ exports.back = back;
5468
5464
  exports.bindCustomEvent = bindCustomEvent;
5469
5465
  exports.bindHashEvent = bindHashEvent;
5470
5466
  exports.bindTouchEvent = bindTouchEvent;
@@ -5496,14 +5492,36 @@
5496
5492
  exports.defineParamsGetter = defineParamsGetter;
5497
5493
  exports.define_wc = define_wc;
5498
5494
  exports.deg2rad = deg2rad;
5495
+ exports.discret = discret;
5499
5496
  exports.div = div;
5500
5497
  exports.e = e;
5498
+ exports.elastic = elastic;
5501
5499
  exports.fact = fact;
5502
5500
  exports.floor = floor;
5503
5501
  exports.geomspace = geomspace;
5504
5502
  exports.getEvent = getEvent;
5505
5503
  exports.hypot = hypot;
5506
5504
  exports.inRange = inRange;
5505
+ exports.in_back = in_back;
5506
+ exports.in_bounce = in_bounce;
5507
+ exports.in_circ = in_circ;
5508
+ exports.in_cubic = in_cubic;
5509
+ exports.in_elastic = in_elastic;
5510
+ exports.in_expo = in_expo;
5511
+ exports.in_out_back = in_out_back;
5512
+ exports.in_out_bounce = in_out_bounce;
5513
+ exports.in_out_circ = in_out_circ;
5514
+ exports.in_out_cubic = in_out_cubic;
5515
+ exports.in_out_elastic = in_out_elastic;
5516
+ exports.in_out_expo = in_out_expo;
5517
+ exports.in_out_quad = in_out_quad;
5518
+ exports.in_out_quart = in_out_quart;
5519
+ exports.in_out_quint = in_out_quint;
5520
+ exports.in_out_sin = in_out_sin;
5521
+ exports.in_quad = in_quad;
5522
+ exports.in_quart = in_quart;
5523
+ exports.in_quint = in_quint;
5524
+ exports.in_sin = in_sin;
5507
5525
  exports.isApproximatlyEqual = isApproximatlyEqual;
5508
5526
  exports.isStateGetter = isStateGetter;
5509
5527
  exports.json2arr = json2arr;
@@ -5515,6 +5533,7 @@
5515
5533
  exports.json2yml = json2yml;
5516
5534
  exports.json2ymlFile = json2ymlFile;
5517
5535
  exports.lerp = lerp;
5536
+ exports.linear = linear;
5518
5537
  exports.linspace = linspace;
5519
5538
  exports.ln = ln;
5520
5539
  exports.logspace = logspace;
@@ -5533,6 +5552,16 @@
5533
5552
  exports.nums = nums;
5534
5553
  exports.obj2str = obj2str;
5535
5554
  exports.ones = ones;
5555
+ exports.out_back = out_back;
5556
+ exports.out_bounce = out_bounce;
5557
+ exports.out_circ = out_circ;
5558
+ exports.out_cubic = out_cubic;
5559
+ exports.out_elastic = out_elastic;
5560
+ exports.out_expo = out_expo;
5561
+ exports.out_quad = out_quad;
5562
+ exports.out_quart = out_quart;
5563
+ exports.out_quint = out_quint;
5564
+ exports.out_sin = out_sin;
5536
5565
  exports.pgcd = pgcd;
5537
5566
  exports.pow = pow$1;
5538
5567
  exports.powerSet = powerSet;
@@ -5550,6 +5579,7 @@
5550
5579
  exports.sleep = sleep;
5551
5580
  exports.sqrt = sqrt$2;
5552
5581
  exports.sqrtn = sqrtn;
5582
+ exports.step = step;
5553
5583
  exports.step_fps = step_fps;
5554
5584
  exports.sub = sub;
5555
5585
  exports.subSet = subSet;