-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBPMAnimate.PSSVG.ps1
More file actions
50 lines (44 loc) · 2.52 KB
/
BPMAnimate.PSSVG.ps1
File metadata and controls
50 lines (44 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$bpm = 90
$animateDuration = "$([Math]::Round(1/($bpm / 60), 4))s"
$animateSplat = [Ordered]@{
Dur = $animateDuration
RepeatDur = "indefinite"
}
$Color = "#4488ff"
SVG -ViewBox 200, 200 -Fill black @(
SVG.pattern -Width .5 -Height .5 @(
SVG.rect -Width 0 -Height 0 -X 25 -Y 25 @(
SVG.animate -AttributeName width -Values '0;50' @animateSplat
SVG.animate -AttributeName height -Values '0;50' @animateSplat
SVG.animate -AttributeName x -Values '25;0' @animateSplat
SVG.animate -AttributeName y -Values '25;0' @animateSplat
SVG.animate -AttributeName opacity -From 0 -To 1 @animateSplat
SVG.animate -AttributeName rx -Values "0;5;0" @animateSplat
) -Fill $color -Id TopLeft
SVG.rect -Width 0 -Height 0 -X 75 -Y 25 @(
SVG.animate -AttributeName width -Values '50;0' @animateSplat
SVG.animate -AttributeName height -Values '50;0' @animateSplat
SVG.animate -AttributeName x -Values '50;75' @animateSplat
SVG.animate -AttributeName y -From 0 -To 25 @animateSplat
SVG.animate -AttributeName opacity -From 1 -To 0 @animateSplat
SVG.animate -AttributeName rx -Values "0;5;0" @animateSplat
) -Fill $Color -Id TopRight
SVG.rect -Width 0 -Height 0 -X 75 -Y 75 @(
SVG.animate -AttributeName width -Values '0;50' @animateSplat
SVG.animate -AttributeName height -Values '0;50' @animateSplat
SVG.animate -AttributeName x -Values '75;50' @animateSplat
SVG.animate -AttributeName y -Values '75;50' @animateSplat
SVG.animate -AttributeName opacity -From 0 -To 1 @animateSplat
SVG.animate -AttributeName rx -Values "0;5;0" @animateSplat
) -Fill $color -Id BottomRight
SVG.rect -Width 0 -Height 0 -X 25 -Y 75 @(
SVG.animate -AttributeName width -Values '50;0' @animateSplat
SVG.animate -AttributeName height -Values '50;0' @animateSplat
SVG.animate -AttributeName y -Values '50;75' @animateSplat
SVG.animate -AttributeName x -From 0 -To 25 @animateSplat
SVG.animate -AttributeName opacity -From 1 -To 0 @animateSplat
SVG.animate -AttributeName rx -Values "0;5;0" @animateSplat
) -Fill $Color -Id TopRight
) -id fillPattern
SVG.rect -Width 200 -Height 200 -Fill "url(#fillPattern)" -X 0 -Y 0
) -OutputPath (Join-Path $PSScriptRoot .\BPMAnimate.svg) -Style @{'background-color'='black'}