@@ -44,6 +44,7 @@ export class LEDElement extends LitElement {
4444 const { color, lightColor } = this ;
4545 const lightColorActual = lightColor || lightColors [ color ] || '#ff8080' ;
4646 const opacity = this . brightness ? 0.3 + this . brightness * 0.7 : 0 ;
47+ const lightOn = this . value && this . brightness > Number . EPSILON ;
4748 return html `
4849 < div class ="led-container ">
4950 < svg
@@ -54,7 +55,7 @@ export class LEDElement extends LitElement {
5455 xmlns ="http://www.w3.org/2000/svg "
5556 >
5657 < filter id ="light1 " x ="-0.8 " y ="-0.8 " height ="2.2 " width ="2.8 ">
57- < feGaussianBlur stdDeviation ="2.6 " />
58+ < feGaussianBlur stdDeviation ="2 " />
5859 </ filter >
5960 < filter id ="light2 " x ="-0.8 " y ="-0.8 " height ="2.2 " width ="2.8 ">
6061 < feGaussianBlur stdDeviation ="4 " />
@@ -116,20 +117,26 @@ export class LEDElement extends LitElement {
116117 opacity =".5 "
117118 />
118119 </ 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' } ">
124121 < ellipse
125122 cx ="8 "
126123 cy ="10 "
127124 rx ="10 "
128125 ry ="10 "
129126 fill ="${ lightColorActual } "
130127 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 } "
131139 > </ ellipse >
132- < ellipse cx ="8 " cy ="10 " rx ="3 " ry ="3 " fill ="white " filter ="url(#light1) "> </ ellipse >
133140 </ g >
134141 </ svg >
135142 < span class ="led-label "> ${ this . label } </ span >
0 commit comments