Repository navigation
Expand file tree
/
Copy pathPrimeTime.types.ps1xml
More file actions
158 lines (151 loc) · 4.07 KB
/
Copy pathPrimeTime.types.ps1xml
File metadata and controls
158 lines (151 loc) · 4.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!-- Generated with EZOut 2.0.6: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Types>
<Type>
<Name>PrimeTime</Name>
<Members>
<MemberSet>
<Name>PSStandardMembers</Name>
<Members>
<PropertySet>
<Name>DefaultDisplayPropertySet</Name>
<ReferencedProperties>
<Name>Nth</Name>
<Name>Prime</Name>
<Name>TimeSpan</Name>
<Name>CSS</Name>
</ReferencedProperties>
</PropertySet>
</Members>
</MemberSet>
<ScriptMethod>
<Name>ToString</Name>
<Script>
<#
.SYNOPSIS
Stringifies a interval
.DESCRIPTION
Stringifies an interval.
By default, this outputs a CSS duration.
If the names of any properties are passed in, they will be output instead.
Multiple properties will be joined with a newline
#>
if ($args) {
return @(foreach ($arg in $args) {
$thisArg = $this.$arg
if ($thisArg -is [string]) {
$thisArg
} elseif ($thisArg -is [xml]) {
$thisArg.OuterXml
} elseif ($thisArg) {
$thisArg -as [string]
}
}) -join [Environment]::NewLine
} else {
return $this.CSS
}
</Script>
</ScriptMethod>
<ScriptProperty>
<Name>@Property</Name>
<GetScriptBlock>
<#
.SYNOPSIS
Gets a PrimeTime as a @property
.DESCRIPTION
Gets a prime as a CSS property declaration.
The property will be a number for maximum flexibility.
#>
param()
"@property --prime-$($this.Nth) {syntax: '<number>'; inherits: true; initial-value: $($this.Prime) }"
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Animation</Name>
<GetScriptBlock>
".$($this.ClassName) { animation-duration: calc(1s * var(--prime-$($this.Nth)))}"
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>ClassName</Name>
<GetScriptBlock>
"primetime-$($this.Nth)"
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>CSS</Name>
<GetScriptBlock>
<#
.SYNOPSIS
Gets PrimeTime CSS
.DESCRIPTION
Gets a PrimeTime as a CSS duration
#>
"$($this.TimeSpan.TotalSeconds)s"
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>ISO</Name>
<GetScriptBlock>
<#
.SYNOPSIS
Gets a PrimeTime as ISO standard interval
.DESCRIPTION
Gets a PrimeTime in ISO-8601 standard interval format.
.LINK
https://en.wikipedia.org/wiki/ISO_8601#Durations
#>
[xml.convert]::ToString($this.TimeSpan)
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>SVG</Name>
<GetScriptBlock>
<#
.SYNOPSIS
Gets a PrimeTime in SVG
.DESCRIPTION
Gets a PrimeTime in an SVG `<animate>` element.
#>
param()
"<animate dur='$($this.Prime)s' />" -as [xml]
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Timer</Name>
<GetScriptBlock>
<#
.SYNOPSIS
Gets a PrimeTime timer
.DESCRIPTION
Gets a PrimeTime timer
This returns a `[Timers.Timer]` for this interval
.LINK
Register-ObjectEvent
#>
$timer = [Timers.Timer]::new()
$timer.Interval = $this.Prime * 1000
$timer
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>TimeSpan</Name>
<GetScriptBlock>
<#
.SYNOPSIS
Gets a PrimeTime TimeSpan
.DESCRIPTION
Gets a PrimeTime as a TimeSpan ( in seconds )
#>
[TimeSpan]::FromSeconds($this.Prime)
</GetScriptBlock>
</ScriptProperty>
<NoteProperty>
<Name>DefaultDisplay</Name>
<Value>Nth
Prime
TimeSpan
CSS</Value>
</NoteProperty>
</Members>
</Type>
</Types>