File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -235,8 +235,8 @@ function generatorsFunction(attribute: string): void {
235
235
case 'animation' :
236
236
animationGenerator ( ) ;
237
237
break ;
238
- case 'box-shadow' :
239
- boxShadowGenerator ( ) ;
238
+ case 'box-shadow' :
239
+ boxShadowGenerator ( ) ;
240
240
break ;
241
241
}
242
242
}
@@ -272,6 +272,16 @@ function showContent(attribute: string, display: Display): void {
272
272
highLightGen . style . border = '1px solid var(--tertiary-color)' ;
273
273
}
274
274
275
+ //event listener to clear styling on generator tabs when "Code magic is clicked"
276
+ document . getElementById ( 'head' ) ?. addEventListener ( 'click' , ( ) => {
277
+ const generatorsNav = document . querySelectorAll ( `[data-gen]` ) ;
278
+ generatorsNav . forEach ( ( item ) => {
279
+ const generatorNav = < HTMLElement > item ;
280
+ generatorNav . style . border = 'none' ;
281
+ generatorNav . style . background = 'none' ;
282
+ } ) ;
283
+ } ) ;
284
+
275
285
function showResult ( attribute : string | null ) {
276
286
results . forEach ( ( item ) => {
277
287
const element = < HTMLElement > item ;
@@ -335,7 +345,7 @@ const displayGradientValue = (gradientElement: HTMLInputElement) => {
335
345
const unitDisplayElement = < HTMLElement > (
336
346
target . parentElement ?. querySelector ( '.unit-display' )
337
347
) ;
338
-
348
+
339
349
// change the unit for opacity
340
350
const unit = titleDisplayElement . innerText . toLowerCase ( ) . includes ( 'opacity' )
341
351
? ''
You can’t perform that action at this time.
0 commit comments