Skip to content

Commit 76594f5

Browse files
author
James Brundage
committed
feat: HtmxPS Logo ( Fixes #4 )
1 parent f5bb85e commit 76594f5

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

Build/HtmxPS.PSSVG.ps1

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 29% @fillParameters -Height 42%
86+
) -ViewBox 0, 0, 200, 200 -TransformOrigin 50%, 50%
87+
)
88+
89+
svg -Content @(
90+
SVG.GoogleFont -FontName $fontName
91+
$symbolDefinition
92+
SVG.Use -Href '#PowerShellWeb' -Height 60% -Width 60% -X 20% -Y 20%
93+
svg.use -Href '#psChevron' -Y 75.75% -X 14% @fillParameters -Height 7.5%
94+
svg.use -Href '#psChevron' -Y 75.75% -X 14% @fillParameters -Height 7.5% -TransformOrigin '50% 50%' -Transform 'scale(-1 1)'
95+
SVG.text -X 50% -Y 80% -TextAnchor middle -FontFamily $fontName -Style "font-family:`"$fontName`",sans-serif" -FontSize 4.2em -Fill '#4488FF' -Content 'HtmxPS' -DominantBaseline middle
96+
) -OutputPath $outputPath -ViewBox 0, 0, 1080, 1080
97+
}

0 commit comments

Comments
 (0)