@pb33f/cowboy-components 0.6.6 → 0.6.7
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/components/auth/oauth-login.js +0 -1
- package/dist/components/paginator/paginator.css.js +1 -1
- package/dist/components/paginator/paginator.d.ts +1 -0
- package/dist/components/paginator/paginator.js +26 -7
- package/dist/components/the-doctor/sparks.d.ts +3 -0
- package/dist/components/the-doctor/sparks.js +16 -5
- package/dist/cowboy-components.umd.cjs +56 -52
- package/package.json +1 -1
|
@@ -37,7 +37,6 @@ let OAuthLogin = class OAuthLogin extends LitElement {
|
|
|
37
37
|
}, 2000);
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
console.log('rendering with ' + this.animateBox);
|
|
41
40
|
return html `
|
|
42
41
|
<div style="width: 500px; height: 280px; margin: 0 auto;">
|
|
43
42
|
<pb33f-electric-box .orbs="${this.orbs}"
|
|
@@ -20,6 +20,7 @@ let Paginator = class Paginator extends LitElement {
|
|
|
20
20
|
this.itemsPerPage = 20;
|
|
21
21
|
this.activeIndex = 0;
|
|
22
22
|
this.invalid = false;
|
|
23
|
+
this.hideSparks = false;
|
|
23
24
|
this.paginatorNavigator = new PaginatorNavigation();
|
|
24
25
|
this.paginatorNavigator.currentPage = this.currentPage;
|
|
25
26
|
this.paginatorNavigator.totalPages = this.totalPages;
|
|
@@ -84,14 +85,29 @@ let Paginator = class Paginator extends LitElement {
|
|
|
84
85
|
}
|
|
85
86
|
render() {
|
|
86
87
|
this.sparks.isError = this.invalid;
|
|
88
|
+
if (this.sparks.animating) {
|
|
89
|
+
this.sparks.stopAnimation();
|
|
90
|
+
}
|
|
87
91
|
if (this.renderValues?.length === 0 || !this.renderValues) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
if (!this.sparks.animating) {
|
|
93
|
+
this.sparks.startAnimation();
|
|
94
|
+
}
|
|
95
|
+
if (!this.hideSparks) {
|
|
96
|
+
return html `
|
|
97
|
+
<div class="no-values ${this.invalid ? 'error' : ''}" style="position: relative">
|
|
98
|
+
<div style="position: absolute; width: 100%; top: -50px; left: 0;">${this.sparks}</div>
|
|
99
|
+
<sl-icon name="prescription2"></sl-icon>
|
|
100
|
+
<br/>
|
|
101
|
+
${this.invalid ? 'invalid / error' : 'healthy!'}
|
|
102
|
+
</div>
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return html `
|
|
107
|
+
<div class="no-values" style="position: relative">
|
|
108
|
+
</div>
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
95
111
|
}
|
|
96
112
|
return html `
|
|
97
113
|
${this.paginatorNavigator}
|
|
@@ -126,6 +142,9 @@ __decorate([
|
|
|
126
142
|
__decorate([
|
|
127
143
|
property({ type: Boolean })
|
|
128
144
|
], Paginator.prototype, "invalid", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
property({ type: Boolean })
|
|
147
|
+
], Paginator.prototype, "hideSparks", void 0);
|
|
129
148
|
Paginator = __decorate([
|
|
130
149
|
customElement("pb33f-paginator-navigation")
|
|
131
150
|
], Paginator);
|
|
@@ -5,11 +5,14 @@ export declare class PixelSparks extends LitElement {
|
|
|
5
5
|
private readonly spawnRate;
|
|
6
6
|
private ctx;
|
|
7
7
|
private canvas;
|
|
8
|
+
private animationTimer;
|
|
8
9
|
isError: boolean;
|
|
10
|
+
animating: boolean;
|
|
9
11
|
static styles: import("lit").CSSResult;
|
|
10
12
|
constructor();
|
|
11
13
|
firstUpdated(): void;
|
|
12
14
|
startAnimation(): void;
|
|
15
|
+
stopAnimation(): void;
|
|
13
16
|
getRandomBetween(min: number, max: number): number;
|
|
14
17
|
spawnSpark(): void;
|
|
15
18
|
animateSparks(): void;
|
|
@@ -13,6 +13,7 @@ let PixelSparks = class PixelSparks extends LitElement {
|
|
|
13
13
|
this.gravity = 0.0001;
|
|
14
14
|
this.spawnRate = 70;
|
|
15
15
|
this.isError = false;
|
|
16
|
+
this.animating = false;
|
|
16
17
|
}
|
|
17
18
|
firstUpdated() {
|
|
18
19
|
const canvas = this.renderRoot.querySelector('canvas');
|
|
@@ -23,11 +24,19 @@ let PixelSparks = class PixelSparks extends LitElement {
|
|
|
23
24
|
this.ctx = ctx;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
this.startAnimation();
|
|
27
27
|
}
|
|
28
28
|
startAnimation() {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (!this.animating) {
|
|
30
|
+
this.animationTimer = setInterval(() => this.spawnSpark(), 1000 / this.spawnRate);
|
|
31
|
+
this.animateSparks();
|
|
32
|
+
this.animating = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
stopAnimation() {
|
|
36
|
+
if (this.animating) {
|
|
37
|
+
clearInterval(this.animationTimer);
|
|
38
|
+
this.animating = false;
|
|
39
|
+
}
|
|
31
40
|
}
|
|
32
41
|
getRandomBetween(min, max) {
|
|
33
42
|
return Math.random() * (max - min) + min;
|
|
@@ -64,8 +73,10 @@ let PixelSparks = class PixelSparks extends LitElement {
|
|
|
64
73
|
drawSpark(spark) {
|
|
65
74
|
this.ctx.globalAlpha = spark.opacity; // Set transparency level
|
|
66
75
|
this.ctx.fillStyle = spark.color;
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
if (!/Safari/.test(navigator.userAgent)) {
|
|
77
|
+
this.ctx.shadowColor = spark.color;
|
|
78
|
+
this.ctx.shadowBlur = 8;
|
|
79
|
+
}
|
|
69
80
|
this.ctx.fillRect(spark.x, spark.y, spark.size, spark.size);
|
|
70
81
|
this.ctx.globalAlpha = 1; // Reset alpha to default
|
|
71
82
|
}
|