destroy-the-text 3.2.3 → 3.2.5
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/AnimationManager.d.ts.map +1 -1
- package/dist/DTTSounds.d.ts.map +1 -1
- package/dist/DestroyTheText.d.ts.map +1 -1
- package/dist/DestroyTheText.js +4 -4
- package/dist/Letra.d.ts.map +1 -1
- package/dist/Letra.js +6 -5
- package/dist/Pixel.d.ts.map +1 -1
- package/dist/Pixel.js +8 -7
- package/dist/Spark.d.ts.map +1 -1
- package/dist/Spark.js +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationManager.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"AnimationManager.d.ts","sourceRoot":"","sources":["../src1/AnimationManager.ts"],"names":[],"mappings":"AAEA,UAAU,UAAU;IAClB,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,OAAO,CAAC;CACpB;AAED,cAAM,yBAAyB;IAC7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA4B;IACnD,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO;IAEP,MAAM,CAAC,WAAW,IAAI,yBAAyB;IAO/C,QAAQ,CAAC,GAAG,EAAE,UAAU;IASxB,OAAO,CAAC,KAAK;IAMb,OAAO,CAAC,IAAI,CAiBV;IAEF,QAAQ,IAAI,MAAM;CAGnB;AAED,eAAO,MAAM,gBAAgB,2BAA0C,CAAC"}
|
package/dist/DTTSounds.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DTTSounds.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"DTTSounds.d.ts","sourceRoot":"","sources":["../src1/DTTSounds.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;UACN,MAAM,EAAE;aACL,MAAM,EAAE;kBAET,MAAM,EAAE;sBAMJ,MAAM,EAAE;;;CA2B7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DestroyTheText.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"DestroyTheText.d.ts","sourceRoot":"","sources":["../src1/DestroyTheText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAOtD,qBAAa,cAAc;IACvB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,WAAW,CAA0C;IAC7D,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,IAAI,CAA4B;IACxC,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,KAAK,CAA4B;gBAE7B,MAAM,EAAE,qBAAqB;IAuCzC,OAAO,CAAC,YAAY;IAoCpB,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,SAAS;CAiFpB"}
|
package/dist/DestroyTheText.js
CHANGED
|
@@ -178,19 +178,19 @@ export class DestroyTheText {
|
|
|
178
178
|
this.count--;
|
|
179
179
|
letter.addClass("oculto");
|
|
180
180
|
if (arma === Tool.hand) {
|
|
181
|
-
new Letra(e.
|
|
181
|
+
new Letra(e.clientX, e.clientY, letter);
|
|
182
182
|
DTTSounds.playEffect();
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
185
|
const n = 3;
|
|
186
186
|
for (let j = 0; j < n; j++) {
|
|
187
|
-
new Pixel(e.
|
|
187
|
+
new Pixel(e.clientX, e.clientY, letter.parent().css("color"));
|
|
188
188
|
}
|
|
189
189
|
// Sparks
|
|
190
190
|
for (let k = 0; k < 5; k++) {
|
|
191
|
-
new Spark(e.
|
|
191
|
+
new Spark(e.clientX, e.clientY);
|
|
192
192
|
}
|
|
193
|
-
console.log("💥 Gun shot! Created 3 pixels and 5 sparks at", { x: e.
|
|
193
|
+
console.log("💥 Gun shot! Created 3 pixels and 5 sparks at", { x: e.clientX, y: e.clientY });
|
|
194
194
|
DTTSounds.playGun();
|
|
195
195
|
}
|
|
196
196
|
}
|
package/dist/Letra.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Letra.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"Letra.d.ts","sourceRoot":"","sources":["../src1/Letra.ts"],"names":[],"mappings":"AAGA,qBAAa,KAAK;IACd,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,SAAS,CAAsB;gBAE3B,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG;IA0BhD,MAAM;IA0BN,OAAO,IAAI,OAAO;IAIlB,OAAO,CAAC,qBAAqB;CAGhC"}
|
package/dist/Letra.js
CHANGED
|
@@ -14,10 +14,10 @@ export class Letra {
|
|
|
14
14
|
this.container.css("font-size", container.parent().css("font-size"));
|
|
15
15
|
this.container.css("font-weight", container.parent().css("font-weight"));
|
|
16
16
|
this.container.css("font-family", container.parent().css("font-family"));
|
|
17
|
-
// Use
|
|
17
|
+
// Use left/top for fixed positioning
|
|
18
18
|
const element = this.container[0];
|
|
19
|
-
element.style.
|
|
20
|
-
element.style.
|
|
19
|
+
element.style.left = `${x}px`;
|
|
20
|
+
element.style.top = `${y}px`;
|
|
21
21
|
$("body").append(this.container);
|
|
22
22
|
// Initial upward velocity, then gravity pulls down
|
|
23
23
|
this.direction = { x: this.getPositiveOrNegative() * Math.random() * 2, y: -3 };
|
|
@@ -38,9 +38,10 @@ export class Letra {
|
|
|
38
38
|
const opacity = Math.max(0, 1 - fadeProgress);
|
|
39
39
|
this.container.css("opacity", opacity.toString());
|
|
40
40
|
}
|
|
41
|
-
// Use
|
|
41
|
+
// Use left/top for fixed positioning
|
|
42
42
|
const element = this.container[0];
|
|
43
|
-
element.style.
|
|
43
|
+
element.style.left = `${this.x}px`;
|
|
44
|
+
element.style.top = `${this.y}px`;
|
|
44
45
|
// Auto-cleanup when dead
|
|
45
46
|
if (!this.isAlive()) {
|
|
46
47
|
this.container.remove();
|
package/dist/Pixel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pixel.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"Pixel.d.ts","sourceRoot":"","sources":["../src1/Pixel.ts"],"names":[],"mappings":"AAGA,qBAAa,KAAK;IACd,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,SAAS,CAAsB;IACvC,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,CAAM;IAClC,MAAM,CAAC,UAAU,SAAO;gBAEZ,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IA8B/C,MAAM;IAkCN,OAAO,IAAI,OAAO;IAIlB,OAAO,CAAC,qBAAqB;IAItB,OAAO;CAGjB"}
|
package/dist/Pixel.js
CHANGED
|
@@ -11,12 +11,12 @@ export class Pixel {
|
|
|
11
11
|
this.container = $(document.createElement("div"));
|
|
12
12
|
this.container.addClass("pixel");
|
|
13
13
|
this.container.css("background", color);
|
|
14
|
-
// Use
|
|
14
|
+
// Use left/top for fixed positioning instead of transform
|
|
15
15
|
const element = this.container[0];
|
|
16
|
-
element.style.
|
|
17
|
-
element.style.
|
|
16
|
+
element.style.left = `${this.x}px`;
|
|
17
|
+
element.style.top = `${this.y}px`;
|
|
18
18
|
$("body").append(this.container);
|
|
19
|
-
console.log("🎯 Pixel created at", { x: this.x, y: this.y, color, element: this.container[0],
|
|
19
|
+
console.log("🎯 Pixel created at", { x: this.x, y: this.y, color, element: this.container[0], left: element.style.left, top: element.style.top });
|
|
20
20
|
this.direction = { x: this.getPositiveOrNegative() * Math.random(), y: 0 };
|
|
21
21
|
Pixel.activePixels.push(this);
|
|
22
22
|
if (Pixel.activePixels.length > Pixel.MAX_PIXELS) {
|
|
@@ -39,16 +39,17 @@ export class Pixel {
|
|
|
39
39
|
}
|
|
40
40
|
// Fade out effect near end of life
|
|
41
41
|
const timeAlive = Date.now() - this.startTime;
|
|
42
|
-
const fadeOutStart = this.lifespan * 0.7;
|
|
42
|
+
const fadeOutStart = this.lifespan * 0.7;
|
|
43
43
|
if (timeAlive > fadeOutStart) {
|
|
44
44
|
const fadeOutDuration = this.lifespan - fadeOutStart;
|
|
45
45
|
const fadeProgress = (timeAlive - fadeOutStart) / fadeOutDuration;
|
|
46
46
|
const opacity = Math.max(0, 1 - fadeProgress);
|
|
47
47
|
this.container.css("opacity", opacity.toString());
|
|
48
48
|
}
|
|
49
|
-
// Use
|
|
49
|
+
// Use left/top for fixed positioning
|
|
50
50
|
const element = this.container[0];
|
|
51
|
-
element.style.
|
|
51
|
+
element.style.left = `${this.x}px`;
|
|
52
|
+
element.style.top = `${this.y}px`;
|
|
52
53
|
// Auto-cleanup when dead
|
|
53
54
|
if (!this.isAlive()) {
|
|
54
55
|
this.destroy();
|
package/dist/Spark.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spark.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"Spark.d.ts","sourceRoot":"","sources":["../src1/Spark.ts"],"names":[],"mappings":"AAGA,qBAAa,KAAK;IAChB,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,YAAY,CAAa;IACjC,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,CAAM;IAClC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAsB;gBAE3B,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAsChC,MAAM;IA0BN,OAAO,IAAI,OAAO;IAIX,OAAO;CAOf"}
|
package/dist/Spark.js
CHANGED
|
@@ -18,10 +18,10 @@ export class Spark {
|
|
|
18
18
|
boxShadow: `0 0 4px ${color}`,
|
|
19
19
|
zIndex: 100,
|
|
20
20
|
});
|
|
21
|
-
// Use
|
|
21
|
+
// Use left/top for fixed positioning
|
|
22
22
|
const element = this.container[0];
|
|
23
|
-
element.style.
|
|
24
|
-
element.style.
|
|
23
|
+
element.style.left = `${x}px`;
|
|
24
|
+
element.style.top = `${y}px`;
|
|
25
25
|
$("body").append(this.container);
|
|
26
26
|
const angle = Math.random() * Math.PI * 2;
|
|
27
27
|
const speed = 2 + Math.random() * 3;
|
|
@@ -46,9 +46,10 @@ export class Spark {
|
|
|
46
46
|
const opacity = Math.max(0, 1 - fadeProgress);
|
|
47
47
|
this.container.css("opacity", opacity.toString());
|
|
48
48
|
}
|
|
49
|
-
// Use
|
|
49
|
+
// Use left/top for fixed positioning
|
|
50
50
|
const element = this.container[0];
|
|
51
|
-
element.style.
|
|
51
|
+
element.style.left = `${this.x}px`;
|
|
52
|
+
element.style.top = `${this.y}px`;
|
|
52
53
|
// Auto-cleanup when dead
|
|
53
54
|
if (!this.isAlive()) {
|
|
54
55
|
this.destroy();
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src1/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src1/styles.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,SA4CxB"}
|
package/dist/styles.js
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src1/types.ts"],"names":[],"mappings":"AAAA,oBAAY,IAAI;IACZ,GAAG,IAAA;IACH,MAAM,IAAA;IACN,IAAI,IAAA;IACJ,WAAW,IAAA;IACX,GAAG,IAAA;CACN;AAED,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC3C"}
|