-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
76 lines (65 loc) · 2.12 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
65
66
67
68
69
70
71
72
73
74
75
76
// English:
//
// This example was taken from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stdDeviation
//
// Português:
//
// Este exemplo foi retirado do site https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stdDeviation
//
// <svg viewBox="0 0 480 200" xmlns="http://www.w3.org/2000/svg">
// <filter id="gaussianBlur1">
// <feGaussianBlur stdDeviation="1" />
// </filter>
// <filter id="gaussianBlur2">
// <feGaussianBlur stdDeviation="5" />
// </filter>
// <filter id="gaussianBlur3" x="-30%" y="-30%" width="160%" height="160%">
// <feGaussianBlur stdDeviation="10" />
// </filter>
//
// <circle cx="100" cy="100" r="50" style="filter: url(#gaussianBlur1);" />
// <circle cx="100" cy="100" r="50" style="filter: url(#gaussianBlur2); transform: translateX(140px);" />
// <circle cx="100" cy="100" r="50" style="filter: url(#gaussianBlur3); transform: translateX(280px);" />
// </svg>
//go:build js
// +build js
// bug: o original não apararece nada
package main
import (
"github.com/helmutkemper/iotmaker.webassembly/browser/factoryBrowser"
)
func main() {
done := make(chan struct{}, 0)
stage := factoryBrowser.NewStage()
s1 := factoryBrowser.NewTagSvg().ViewBox([]float64{0, 0, 480, 200}).Append(
factoryBrowser.NewTagSvgFilter().Id("gaussianBlur1").Append(
factoryBrowser.NewTagSvgFeGaussianBlur().StdDeviation(1),
),
factoryBrowser.NewTagSvgFilter().Id("gaussianBlur2").Append(
factoryBrowser.NewTagSvgFeGaussianBlur().StdDeviation(5),
),
factoryBrowser.NewTagSvgFilter().Id("gaussianBlur3").X(float32(-0.3)).Y(float32(-0.3)).Width(float32(1.6)).Height(float32(1.6)).Append(
factoryBrowser.NewTagSvgFeGaussianBlur().StdDeviation(10),
),
factoryBrowser.NewTagSvgCircle().Cx(100).Cy(100).R(50).Style("filter: url(#gaussianBlur1);"),
factoryBrowser.NewTagSvgCircle().Cx(100).Cy(100).R(50).Style("filter: url(#gaussianBlur2); transform: translateX(140px);"),
factoryBrowser.NewTagSvgCircle().Cx(100).Cy(100).R(50).Style("filter: url(#gaussianBlur3); transform: translateX(280px);"),
)
stage.Append(s1)
<-done
}
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//