Skip to content

Commit 01eef1c

Browse files
author
James Brundage
committed
feat: PowerShellWeb Workflow ( Fixes #2, Fixes #3 )
1 parent ec1e5d3 commit 01eef1c

File tree

4 files changed

+127
-0
lines changed

4 files changed

+127
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
name: Build PowerShellWeb
3+
on:
4+
push:
5+
workflow_dispatch:
6+
jobs:
7+
BuildPowerShellWeb:
8+
runs-on: ubuntu-latest
9+
if: ${{ success() }}
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v4
13+
- name: Use PSSVG Action
14+
uses: StartAutomating/PSSVG@main
15+
id: PSSVG
16+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@{
2+
"runs-on" = "ubuntu-latest"
3+
if = '${{ success() }}'
4+
steps = @(
5+
@{
6+
name = 'Check out repository'
7+
uses = 'actions/checkout@v4'
8+
},
9+
@{
10+
name = 'Use PSSVG Action'
11+
uses = 'StartAutomating/PSSVG@main'
12+
id = 'PSSVG'
13+
}
14+
)
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#requires -Module PSDevOps
2+
Import-BuildStep -SourcePath (
3+
Join-Path $PSScriptRoot 'GitHub'
4+
) -BuildSystem GitHubWorkflow
5+
6+
Push-Location ($PSScriptRoot | Split-Path)
7+
New-GitHubWorkflow -Name "Build PowerShellWeb" -On Push, Demand -Job BuildPowerShellWeb -OutputPath .\.github\workflows\BuildPowerShellWeb.yml
8+
9+
Pop-Location

Build/PowerShellWeb.PSSVG.ps1

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
9+
$fontName = 'Anta'
10+
$fontName = 'Heebo'
11+
$fontName = 'Noto Sans'
12+
$strokeWidth = '0.5%'
13+
foreach ($variant in '','Animated') {
14+
$outputPath = if (-not $variant) {
15+
Join-Path $assetsPath "PowerShellWeb.svg"
16+
} else {
17+
Join-Path $assetsPath "PowerShellWeb-$variant.svg"
18+
}
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 29% @fillParameters -Height 42%
86+
) -ViewBox 0, 0, 200, 200 -OutputPath $outputPath
87+
}

0 commit comments

Comments
 (0)