-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOP.turtle.ps1
More file actions
97 lines (77 loc) · 2.07 KB
/
OP.turtle.ps1
File metadata and controls
97 lines (77 loc) · 2.07 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#requires -Module Turtle
param(
[double]
$Size = 1080,
[string[]]
$Variants = @(
''
'Text'
'Animated'
'Animated-Text'
'Gradient'
'Gradient-Text'
'Animated-Gradient'
'Animated-Gradient-Text'
'Blue'
'Blue-Text'
'Animated-Blue'
'Animated-Blue-Text'
),
[string[]]
$PngVariants = @(
''
'Text'
'Blue-Text'
'Gradient-Text'
),
[string]
$Destination = './Assets'
)
$halfSize = $size / 2
if ($psScriptRoot) {
Push-Location $PSScriptRoot
}
if (-not (Test-Path $Destination)) {
$null = New-Item -ItemType Directory -Path $Destination
}
foreach ($variant in $variants) {
$fileName = "OP-$variant" -replace '-$'
$Logo =
🐢 id $fileName title $fileName Arcygon $size $halfSize 4 StrokeWidth '1%'
if ($variant -match 'Animated') {
$logo = $logo | 🐢 duration '00:00:42' morph @(
🐢 @('circleArc', $halfSize, 90, 'forward', $size, 'rotate',90 * 4)
🐢 @('circleArc', $halfSize, -90, 'forward', $size, 'rotate',90 * 4)
🐢 @('circleArc', $halfSize, 90, 'forward', $size, 'rotate',90 * 4)
)
}
if ($variant -match 'Text') {
$logo = $logo |
🐢 turtles @(
🐢 viewbox $halfSize text OP FontSize ($size/4) FontFamily 'sans-serif' @(
if ($variant -match 'Text') {
'stroke', '#4488ff'
}
elseif ($variant -match 'Gradient') {
'stroke', '#224488', '#4488ff', '#224488'
}
)
)
}
if ($variant -match 'Blue') {
$logo.Stroke = '#4488ff'
}
if ($variant -match 'Gradient') {
$logo.Stroke = '#224488', '#4488ff', '#224488'
}
$fileName = "OP-$variant" -replace '-$'
$logo | Save-Turtle -FilePath (
Join-Path $destination "./$fileName.svg"
)
if ($pngVariants -contains $variant) {
$logo | Save-Turtle -FilePath (
Join-Path $destination "./$fileName.png"
)
}
}
return