-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-stamp.ts
71 lines (65 loc) · 1.71 KB
/
index-stamp.ts
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
import { runStamps, StampCollection } from 'butterfloat'
import $ from 'jquery'
import {
FastForward,
Github,
Pause,
Play,
Plus,
Rewind,
SkipForward,
} from 'lucide'
import { create } from 'rxjs-spy'
import { Icon } from './icon.js'
import { Main } from './main.js'
import { Progress } from './progress.js'
const spy = create()
// Set global for jquery-knob
const w = window as any
w.jQuery = w.$ = $
// @ts-ignore
await import('jquery-knob')
const container = document.getElementById('container')!
const stamps = new StampCollection()
stamps
.registerPrestamp(Main, container)
.registerOnlyStamp(
Progress,
document.querySelector<HTMLTemplateElement>('#progress')!,
)
.registerStampAlternative(
Icon,
({ icon }) => icon == Github,
document.querySelector<HTMLTemplateElement>('#icon-github')!,
)
.registerStampAlternative(
Icon,
({ icon }) => icon == Pause,
document.querySelector<HTMLTemplateElement>('#icon-pause')!,
)
.registerStampAlternative(
Icon,
({ icon }) => icon == Play,
document.querySelector<HTMLTemplateElement>('#icon-play')!,
)
.registerStampAlternative(
Icon,
({ icon }) => icon == Plus,
document.querySelector<HTMLTemplateElement>('#icon-plus')!,
)
.registerStampAlternative(
Icon,
({ icon }) => icon == FastForward,
document.querySelector<HTMLTemplateElement>('#icon-fast-forward')!,
)
.registerStampAlternative(
Icon,
({ icon }) => icon == Rewind,
document.querySelector<HTMLTemplateElement>('#icon-rewind')!,
)
.registerStampAlternative(
Icon,
({ icon }) => icon == SkipForward,
document.querySelector<HTMLTemplateElement>('#icon-skip-forward')!,
)
runStamps(container, Main, stamps)