-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
64 lines (55 loc) · 1.48 KB
/
main.go
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
// English:
//
// This example was taken from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/repeatDur
//
// Português:
//
// Este exemplo foi retirado do site https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/repeatDur
//
// <svg viewBox="0 0 220 150" xmlns="http://www.w3.org/2000/svg">
// <rect x="0" y="0" width="100" height="100">
// <animate attributeType="XML" attributeName="y" from="0" to="50"
// dur="1s" repeatDur="5s"/>
// </rect>
// <rect x="120" y="0" width="100" height="100">
// <animate attributeType="XML" attributeName="y" from="0" to="50"
// dur="1s" repeatDur="indefinite"/>
// </rect>
// </svg>
//go:build js
// +build js
package main
import (
"github.com/helmutkemper/iotmaker.webassembly/browser/factoryBrowser"
"github.com/helmutkemper/iotmaker.webassembly/browser/html"
"time"
)
func main() {
done := make(chan struct{}, 0)
stage := factoryBrowser.NewStage()
s1 := factoryBrowser.NewTagSvg().ViewBox([]float64{0, 0, 220, 150}).Append(
factoryBrowser.NewTagSvgRect().X(0).Y(0).Width(100).Height(100).Append(
factoryBrowser.NewTagSvgAnimate().AttributeName("y").From(0).To(50).Dur(1*time.Second).RepeatDur(5*time.Second),
),
factoryBrowser.NewTagSvgRect().X(120).Y(0).Width(100).Height(100).Append(
factoryBrowser.NewTagSvgAnimate().AttributeName("y").From(0).To(50).Dur(1*time.Second).RepeatDur(html.KSvgDurIndefinite),
),
)
stage.Append(s1)
<-done
}
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//