@@ -115,8 +115,8 @@ export class CssGaugeComponent extends BaseCustomWebComponentConstructorAppend {
115115 .gauge .labels .value-label {
116116 position: relative;
117117 top: 75%;
118- left: 50% ;
119- transform: translateX(-50%) ;
118+ display: flex ;
119+ justify-content: center ;
120120 }
121121
122122 .gauge .labels .value-label::after {
@@ -141,8 +141,70 @@ export class CssGaugeComponent extends BaseCustomWebComponentConstructorAppend {
141141 height: 1px;
142142 }` ;
143143
144+ static readonly styleGlossy = css `
145+ .gauge-glossy {
146+ border: outset 4px #036564;
147+ background: rgb(64, 244, 118);
148+ background: linear-gradient(5deg, #033649, #036564);
149+ text-shadow: 2px 2px 5px #0d3b3e;
150+ }
151+
152+ .gauge-glossy .gauge {
153+ opacity: 0.9;
154+ border-color: #023332;
155+ background: linear-gradient(-155deg, #036564, #033649);
156+ color: rgb(46, 121, 114);
157+ }
158+
159+ .gauge-glossy p, .gauge-glossy h1 {
160+ font-size: 20px;
161+ font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
162+ font-weight: 700;
163+ position: relative;
164+ color: #12937b;
165+ }
166+
167+ .gauge-glossy h1 {
168+ font-size: 30px;
169+ }
170+
171+ .gauge-glossy .gauge .labels .value-label {
172+ color: white;
173+ }
174+
175+ .gauge-glossy .gauge .needle {
176+ background: linear-gradient(90deg, rgba(2, 0, 36, 0) 0%, rgba(0, 0, 0, 0) 24%, rgba(255, 127, 80, 1) 24%, rgba(255, 127, 80, 1) 30%, rgba(0, 0, 0, 0) 50%);
177+ }
178+
179+ .gauge-glossy .gauge .needle .needle-head {
180+ background-color: rgb(255, 127, 80);
181+ }
182+
183+ .gauge-glossy .gauge .ticks::before {
184+ position: absolute;
185+ top: 4px;
186+ bottom: 8px;
187+ left: 4px;
188+ right: 8px;
189+ background: linear-gradient(174deg, rgba(255, 0, 0, 0), rgba(255, 0, 0, 0), rgba(255, 0, 0, 0), rgba(255, 255, 255, .2));
190+ content: '';
191+ border-radius: 50%;
192+ }
193+
194+ .gauge-glossy .gauge .ticks::after {
195+ position: absolute;
196+ top: 2px;
197+ bottom: 2px;
198+ left: 2px;
199+ right: 2px;
200+ background: linear-gradient(-40deg, rgba(255, 0, 0, 0), rgba(255, 0, 0, 0), rgba(255, 0, 0, 0), rgba(255, 0, 0, 0), rgba(255, 255, 255, .9));
201+ content: '';
202+ border-radius: 50%;
203+ z-index: 2;
204+ }` ;
205+
144206 static override readonly template = html `
145- < div id =" exampleGauge " class ="gauge " style =" --gauge-value:0; width:200px ; height:200px ; ">
207+ < div class ="gauge gauge-glossy " style ="width:100% ; height:100% ; ">
146208 < div class ="ticks ">
147209 < div class ="tithe " style ="--gauge-tithe-tick:1; "> </ div >
148210 < div class ="tithe " style ="--gauge-tithe-tick:2; "> </ div >
@@ -167,15 +229,31 @@ export class CssGaugeComponent extends BaseCustomWebComponentConstructorAppend {
167229
168230 static readonly is = "node-projects-css-gauge" ;
169231
232+ static readonly properties = {
233+ type : [ '' , 'glossy' ] ,
234+ value : Number ,
235+ displayValue : Number
236+ }
237+
238+ private _type : '' | 'glossy' = '' ;
239+ get type ( ) { return this . _type ; }
240+ set type ( value : '' | 'glossy' ) { this . _type = value ; this . _type == '' ? this . shadowRoot . adoptedStyleSheets = [ CssGaugeComponent . style ] : this . shadowRoot . adoptedStyleSheets = [ CssGaugeComponent . style , CssGaugeComponent . styleGlossy ] }
241+
242+ private _value : number = 0 ;
243+ get value ( ) { return this . _value ; }
244+ set value ( value : number ) { this . _value = value ; this . style . setProperty ( '--gauge-value' , value . toString ( ) ) ; }
245+
246+ private _displayValue : number = 0 ;
247+ get displayValue ( ) { return this . _displayValue ; }
248+ set displayValue ( value : number ) { this . _displayValue = value ; this . style . setProperty ( '--gauge-display-value' , value . toString ( ) ) ; }
249+
170250 constructor ( ) {
171251 super ( ) ;
172252 this . _restoreCachedInititalValues ( ) ;
173253 }
174254
175255 ready ( ) {
176256 this . _parseAttributesToProperties ( ) ;
177-
178-
179257 }
180258}
181259
0 commit comments