|
| 1 | +#requires -Module PSSVG |
| 2 | + |
| 3 | +$AssetsPath = $PSScriptRoot | Split-Path | Join-Path -ChildPath "Assets" |
| 4 | + |
| 5 | +if (-not (Test-Path $AssetsPath)) { |
| 6 | + New-Item -ItemType Directory -Path $AssetsPath | Out-Null |
| 7 | +} |
| 8 | +$myName = $MyInvocation.MyCommand.Name -replace '\.PSSVG\.ps1$' |
| 9 | + |
| 10 | +$strokeWidth = '0.5%' |
| 11 | +$fontName = 'Noto Sans' |
| 12 | +foreach ($variant in '','Animated') { |
| 13 | + $outputPath = if (-not $variant) { |
| 14 | + Join-Path $assetsPath "$myName.svg" |
| 15 | + } else { |
| 16 | + Join-Path $assetsPath "$myName-$variant.svg" |
| 17 | + } |
| 18 | + $symbolDefinition = SVG.symbol -Id 'PowerShellWeb' @( |
| 19 | + svg -content $( |
| 20 | + $fillParameters = [Ordered]@{ |
| 21 | + Fill = '#4488FF' |
| 22 | + Class = 'foreground-fill' |
| 23 | + } |
| 24 | + |
| 25 | + $strokeParameters = [Ordered]@{ |
| 26 | + Stroke = '#4488FF' |
| 27 | + Class = 'foreground-stroke' |
| 28 | + StrokeWidth = $strokeWidth |
| 29 | + } |
| 30 | + |
| 31 | + $transparentFill = [Ordered]@{Fill='transparent'} |
| 32 | + $animationDuration = [Ordered]@{ |
| 33 | + Dur = "4.2s" |
| 34 | + RepeatCount = "indefinite" |
| 35 | + } |
| 36 | + |
| 37 | + SVG.GoogleFont -FontName $fontName |
| 38 | + |
| 39 | + svg.symbol -Id psChevron -Content @( |
| 40 | + svg.polygon -Points (@( |
| 41 | + "40,20" |
| 42 | + "45,20" |
| 43 | + "60,50" |
| 44 | + "35,80" |
| 45 | + "32.5,80" |
| 46 | + "55,50" |
| 47 | + ) -join ' ') |
| 48 | + ) -ViewBox 100, 100 |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + SVG.circle -CX 50% -Cy 50% -R 42% @transparentFill @strokeParameters -Content @( |
| 53 | + ) |
| 54 | + SVG.ellipse -Cx 50% -Cy 50% -Rx 23% -Ry 42% @transparentFill @strokeParameters -Content @( |
| 55 | + if ($variant -match 'animate') { |
| 56 | + svg.animate -Values '23%;16%;23%' -AttributeName rx @animationDuration |
| 57 | + } |
| 58 | + ) |
| 59 | + SVG.ellipse -Cx 50% -Cy 50% -Rx 16% -Ry 42% @transparentFill @strokeParameters -Content @( |
| 60 | + if ($variant -match 'animate') { |
| 61 | + svg.animate -Values '16%;23%;16%' -AttributeName rx @animationDuration |
| 62 | + } |
| 63 | + ) -Opacity .9 |
| 64 | + SVG.ellipse -Cx 50% -Cy 50% -Rx 15% -Ry 42% @transparentFill @strokeParameters -Content @( |
| 65 | + if ($variant -match 'animate') { |
| 66 | + svg.animate -Values '15%;16%;15%' -AttributeName rx @animationDuration |
| 67 | + } |
| 68 | + ) -Opacity .8 |
| 69 | + SVG.ellipse -Cx 50% -Cy 50% -Rx 42% -Ry 23% @transparentFill @strokeParameters -Content @( |
| 70 | + if ($variant -match 'animate') { |
| 71 | + svg.animate -Values '23%;16%;23%' -AttributeName ry @animationDuration |
| 72 | + } |
| 73 | + ) |
| 74 | + SVG.ellipse -Cx 50% -Cy 50% -Rx 42% -Ry 16% @transparentFill @strokeParameters -Content @( |
| 75 | + if ($variant -match 'animate') { |
| 76 | + svg.animate -Values '16%;23%;16%' -AttributeName ry @animationDuration |
| 77 | + } |
| 78 | + ) -Opacity .9 |
| 79 | + SVG.ellipse -Cx 50% -Cy 50% -Rx 42% -Ry 15% @transparentFill @strokeParameters -Content @( |
| 80 | + if ($variant -match 'animate') { |
| 81 | + svg.animate -Values '15%;16%;15%' -AttributeName ry @animationDuration |
| 82 | + } |
| 83 | + ) -Opacity .8 |
| 84 | + |
| 85 | + svg.use -Href '#psChevron' -Y 39% @fillParameters -Height 23% |
| 86 | + ) -ViewBox 0, 0, 200, 200 -TransformOrigin 50%, 50% |
| 87 | + ) |
| 88 | + |
| 89 | + $shapeSplat = [Ordered]@{ |
| 90 | + CenterX=(1080/2) |
| 91 | + CenterY=(1080/2) |
| 92 | + Radius=((1080 * .15) /2) |
| 93 | + } |
| 94 | + |
| 95 | + |
| 96 | + svg -Content @( |
| 97 | + SVG.GoogleFont -FontName $fontName |
| 98 | + $symbolDefinition |
| 99 | + SVG.Use -Href '#PowerShellWeb' -Height 60% -Width 60% -X 20% -Y 20% |
| 100 | + # svg.use -Href '#psChevron' -Y 75.75% -X 14% @fillParameters -Height 7.5% |
| 101 | + # svg.use -Href '#psChevron' -Y 75.75% -X 14% @fillParameters -Height 7.5% -TransformOrigin '50% 50%' -Transform 'scale(-1 1)' |
| 102 | + SVG.Hexagon @shapeSplat -StrokeWidth .5em -Stroke '#4488FF' -Fill 'transparent' -Class 'foreground-stroke' |
| 103 | + # SVG.ConvexPolygon -SideCount 3 @shapeSplat -Rotate 180 -StrokeWidth .25em -Stroke '#4488FF' -Fill 'transparent' -Class 'foreground-stroke' -Opacity .3 |
| 104 | + SVG.text -X 50% -Y 80% -TextAnchor middle -FontFamily $fontName -Style "font-family:`"$fontName`",sans-serif" -FontSize 4.2em -Fill '#4488FF' -Content 'GQL' -Class 'foreground-fill' -DominantBaseline middle |
| 105 | + ) -OutputPath $outputPath -ViewBox 0, 0, 1080, 1080 |
| 106 | +} |
0 commit comments