Skip to content

Commit 633c8f1

Browse files
author
James Brundage
committed
feat: Generating _includes/Animated-Palette.svg ( Fixes #111 )
1 parent c596f03 commit 633c8f1

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Build/4bitcss.PSSVG.ps1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,45 @@ svg -ViewBox 640, 240 @(
9393
}
9494
) -OutputPath (Join-Path $docsRoot .\4bitpreviewtemplate.svg) -Class background-fill
9595

96+
svg -ViewBox 1920, 1080 @(
97+
svg.rect -Width 300% -Height 300% -X -100% -Y -100% -Class 'background-fill'
98+
99+
$initialRadius = (1080/2) - 42
100+
$wobble = .23
101+
$flipFlop = 1
102+
$duration = "04.2s"
103+
filter wobbler {
104+
$initialRadius * (($wobble * $flipFlop) + 1)
105+
}
106+
SVG.ellipse -Id 'foregroundCircle' -Cx 50% -Cy 50% -RX $initialRadius -Ry $initialRadius -Class 'foreground-fill' -Children @(
107+
SVG.animate -Values "$initialRadius;$(wobbler);$initialRadius" -AttributeName 'rx' -Dur $duration -RepeatCount indefinite
108+
$flipFlop *= -1
109+
SVG.animate -Values "$initialRadius;$(wobbler);$initialRadius" -AttributeName 'ry' -Dur $duration -RepeatCount indefinite
110+
111+
SVG.animate -Values "1;.42;1" -AttributeName 'opacity' -Dur $duration -RepeatCount indefinite
112+
)
113+
114+
foreach ($n in 0..7) {
115+
$initialRadius -= 23
116+
SVG.ellipse -Id "ANSI${N}-Ellipse" -cx 50% -cy 50% -rx $initialRadius -ry $initialRadius -Class "ansi$n-fill" -Fill $($colors[$n]) -Children @(
117+
SVG.animate -Values "$initialRadius;$(wobbler);$initialRadius" -AttributeName 'rx' -Dur $duration -RepeatCount indefinite
118+
$flipFlop *= -1
119+
SVG.animate -Values "$initialRadius;$(wobbler);$initialRadius" -AttributeName 'ry' -Dur $duration -RepeatCount indefinite
120+
121+
SVG.animate -Values "1;.42;1" -AttributeName 'opacity' -Dur $duration -RepeatCount indefinite
122+
)
123+
$initialRadius -= 16
124+
SVG.ellipse -Id "ANSI$($N + 8)-Ellipse" -Cx 50% -Cy 50% -RX $initialRadius -Ry $initialRadius -Class "ansi$($n + 8)-fill" -Fill $($colors[$n]) -Children @(
125+
SVG.animate -Values "$initialRadius;$(wobbler);$initialRadius" -AttributeName 'rx' -Dur $duration -RepeatCount indefinite
126+
127+
$flipFlop *= -1
128+
SVG.animate -Values "$initialRadius;$(wobbler);$initialRadius" -AttributeName 'ry' -Dur $duration -RepeatCount indefinite
129+
130+
SVG.animate -Values "1;.42;1" -AttributeName 'opacity' -Dur $duration -RepeatCount indefinite
131+
)
132+
}
133+
) -OutputPath (Join-Path $includesRoot .\Animated-Palette.svg) -Class background-fill
134+
96135
Copy-Item -Path (Join-Path $docsRoot .\4bitpreviewtemplate.svg) -Destination (Join-Path $assetsRoot ..\4bitpreviewtemplate.svg) -Force -PassThru
97136
Copy-Item -Path (Join-Path $docsRoot .\4bitpreviewtemplate.svg) -Destination (Join-Path $includesRoot .\4bitpreviewtemplate.svg) -Force -PassThru
98137

0 commit comments

Comments
 (0)