-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphics.html
107 lines (97 loc) · 2.15 KB
/
graphics.html
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
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://d3lp1msu2r81bx.cloudfront.net/kjs/js/lib/kinetic-v4.7.1.min.js"></script>
<style>
html, body {
background-color: #000000;
margin: 0px;
padding: 0px;
width:100%;
height:100%;
overflow:hidden;
}
</style>
</head>
<body>
<div id="container"></div>
</body>
<script type="text/javascript">
var stage = new Kinetic.Stage({
container: 'container',
width: window.innerWidth,
height: window.innerHeight,
x: 286,
y: 100,
offset: [289, 100]
});
var layer = new Kinetic.Layer();
var hexagon = new Kinetic.RegularPolygon({
x: 100,
y: 200,
sides: 6,
radius: 21,
fill: 'red'
});
var hexagonBorder = new Kinetic.RegularPolygon({
x: 100,
y: 200,
sides: 6,
radius: 30,
fill: 'transparent',
stroke: 'red',
strokeWidth: 1
});
var hexagonOuterBorder = new Kinetic.RegularPolygon({
x: 100,
y: 200,
sides: 6,
radius: 38,
fill: 'black',
stroke: 'white',
strokeWidth: 5,
shadowColor: 'white',
shadowBlur: 40,
shadowOffset: 0,
shadowOpacity: 0.8
});
layer.add(hexagonOuterBorder);
layer.add(hexagon);
layer.add(hexagonBorder);
var square = new Kinetic.Rect({
x: 205,
y: 205,
width: 40,
height: 40,
radius: 21,
fill: 'red'
});
var squareBorder = new Kinetic.Rect({
x: 197.5,
y: 197.5,
width: 55,
height: 55,
fill: 'transparent',
stroke: 'red',
strokeWidth: 1
});
var squareOuterBorder = new Kinetic.Rect({
x: 190,
y: 190,
width: 70,
height: 70,
fill: 'black',
stroke: 'white',
strokeWidth: 5,
shadowColor: 'white',
shadowBlur: 40,
shadowOffset: 0,
shadowOpacity: 0.8
});
layer.add(squareOuterBorder);
layer.add(square);
layer.add(squareBorder);
stage.add(layer);
</script>
</html>