@@ -44,6 +44,7 @@ export class LEDElement extends LitElement {
44
44
const { color, lightColor } = this ;
45
45
const lightColorActual = lightColor || lightColors [ color ] || '#ff8080' ;
46
46
const opacity = this . brightness ? 0.3 + this . brightness * 0.7 : 0 ;
47
+ const lightOn = this . value && this . brightness > Number . EPSILON ;
47
48
return html `
48
49
< div class ="led-container ">
49
50
< svg
@@ -54,7 +55,7 @@ export class LEDElement extends LitElement {
54
55
xmlns ="http://www.w3.org/2000/svg "
55
56
>
56
57
< filter id ="light1 " x ="-0.8 " y ="-0.8 " height ="2.2 " width ="2.8 ">
57
- < feGaussianBlur stdDeviation ="2.6 " />
58
+ < feGaussianBlur stdDeviation ="2 " />
58
59
</ filter >
59
60
< filter id ="light2 " x ="-0.8 " y ="-0.8 " height ="2.2 " width ="2.8 ">
60
61
< feGaussianBlur stdDeviation ="4 " />
@@ -116,20 +117,26 @@ export class LEDElement extends LitElement {
116
117
opacity =".5 "
117
118
/>
118
119
</ g >
119
- < g
120
- class ="light "
121
- xmlns ="http://www.w3.org/2000/svg "
122
- style ="display: ${ this . value ? '' : 'none' } ; opacity: ${ opacity } "
123
- >
120
+ < g class ="light " style ="display: ${ lightOn ? '' : 'none' } ">
124
121
< ellipse
125
122
cx ="8 "
126
123
cy ="10 "
127
124
rx ="10 "
128
125
ry ="10 "
129
126
fill ="${ lightColorActual } "
130
127
filter ="url(#light2) "
128
+ style ="opacity: ${ opacity } "
129
+ > </ ellipse >
130
+ < ellipse cx ="8 " cy ="10 " rx ="2 " ry ="2 " fill ="white " filter ="url(#light1) "> </ ellipse >
131
+ < ellipse
132
+ cx ="8 "
133
+ cy ="10 "
134
+ rx ="3 "
135
+ ry ="3 "
136
+ fill ="white "
137
+ filter ="url(#light1) "
138
+ style ="opacity: ${ opacity } "
131
139
> </ ellipse >
132
- < ellipse cx ="8 " cy ="10 " rx ="3 " ry ="3 " fill ="white " filter ="url(#light1) "> </ ellipse >
133
140
</ g >
134
141
</ svg >
135
142
< span class ="led-label "> ${ this . label } </ span >
0 commit comments