@@ -284,14 +284,10 @@ end
284
284
function Create .Gradient ( text , font , colorA , colorB , elementName )
285
285
elementName = elementName or " elGradient"
286
286
287
- -- Gradient container
287
+ -- Gradient container/glow
288
288
local lines = { Create .Element ( " span" , elementName ) }
289
289
Append ( lines , " %s.className = 'gradient-container';" , elementName )
290
-
291
- -- Gradient background/glow
292
- Append ( lines , Create .Element ( " span" , " elGradientGlow" , elementName ) )
293
- Append ( lines , " elGradientGlow.className = 'gradient-bg';" )
294
- Append ( lines , " elGradientGlow.textContent = '%s';" , text )
290
+ Append ( lines , " %s.textContent = '%s';" , elementName , text )
295
291
296
292
-- Use the combined colors for the glow effect
297
293
local h , s , l = ColorToHSL ( Color (
@@ -302,8 +298,8 @@ function Create.Gradient( text, font, colorA, colorB, elementName )
302
298
303
299
local colorGlow = ColorToRGB ( HSLToColor ( h , s , l * 0.5 ) )
304
300
305
- Append ( lines , " elGradientGlow .style.color = '%s';" , colorGlow )
306
- Append ( lines , " elGradientGlow .style.textShadow = '0px 0px 0.2em %s';" , colorGlow )
301
+ Append ( lines , " %s .style.color = '%s';" , elementName , colorGlow )
302
+ Append ( lines , " %s .style.textShadow = '0px 0px 0.2em %s';" , elementName , colorGlow )
307
303
308
304
-- Gradient foreground/text
309
305
Append ( lines , Create .Element ( " span" , " elGradientText" , elementName ) )
@@ -312,7 +308,7 @@ function Create.Gradient( text, font, colorA, colorB, elementName )
312
308
Append ( lines , " elGradientText.style.backgroundImage = '-webkit-linear-gradient(left, %s, %s)';" , ColorToRGB ( colorA ), ColorToRGB ( colorB ) )
313
309
314
310
if IsStringValid ( font ) then
315
- Append ( lines , " elGradientGlow .style.fontFamily = '%s';" , font )
311
+ Append ( lines , " %s .style.fontFamily = '%s';" , elementName , font )
316
312
Append ( lines , " elGradientText.style.fontFamily = '%s';" , font )
317
313
end
318
314
0 commit comments