-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
95 lines (72 loc) · 2.03 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Doggy </title>
<script src="JS/jQuery.js"></script>
<script src="JS/two.min.js"></script>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="doodle">
<script>
$(document).ready( function() {
var elem = document.getElementById('doodle');
var two = new Two({fullscreen: true}).appendTo(elem);
var position = new Two.Vector(two.width/2, two.height/2);
var head = two.makeCircle(position.x, position.y, 100);
head.fill = '#52C5DC';
head.noStroke();
var nose;
nose = two.makeCircle(position.x, position.y+30, 32);
nose.fill = '#EFB8D2';
nose.noStroke();
var eyeLeft;
eyeLeft = two.makeCircle(position.x+42, position.y-26, 32);
eyeLeft.fill = '#FFFFFF';
eyeLeft.noStroke();
var pupilLeft;
pupilLeft = two.makeCircle(position.x+42, position.y-26, 20);
pupilLeft.fill = '#7FC35E';
pupilLeft.noStroke();
var earLeft;
earLeft = two.makeEllipse(position.x-100, position.y-80, 26, 46);
earLeft.fill = '#52C5DC';
earLeft.noStroke();
earLeft.rotation = Math.PI / 4;
var eyeRight;
eyeRight = two.makeCircle(position.x-42, position.y-26, 32);
eyeRight.fill = '#FFFFFF';
eyeRight.noStroke();
var pupilRight;
pupilRight = two.makeCircle(position.x-42, position.y-26, 20);
pupilRight.fill = '#7FC35E';
pupilRight.noStroke();
var earRight;
earRight = two.makeEllipse(position.x+100, position.y-80, 26, 46);
earRight.fill = '#52C5DC';
earRight.noStroke();
earRight.rotation = -Math.PI / 4;
var tongue;
tongue = two.makePolygon(0,0, 100,0, 100,0, 90,58, 50,80, 10,58, 0,0);
tongue.curved = true;
tongue.fill = '#EE3E36';
tongue.noStroke();
tongue.translation.x = position.x-40;
tongue.translation.y = position.y+86;
tongue.scale = 0.4;
tongue.rotation = Math.PI / 5;
two.update();
var rect = two.makeRectangle(260,120, 210,100);
rect.fill = '#6cbf58';
rect.stroke = '#ffffff';
rect.linewidth = 5;
var line = two.makeLine(20,20, 210,300);
line.stroke = '#ff4c22';
line.linewidth = 8;
two.update();
});
</script>
</div>
</body>
</html>