forked from jeeliz/jeelizWeboji
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
172 lines (149 loc) · 6.77 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="content-language" content="en-EN" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>WEBOJI SVG DEMO</title>
<!-- JEELIZFACEEXPRESSIONS LIB: DETECT FACIAL EXPRESSIONS: -->
<script src="../../dist/jeelizFaceExpressions.js"></script>
<!-- SVG WEBOJI HELPER: -->
<!-- main helper: -->
<script src="../../helpers/svg/JeelizWebojiSVGHelper.js"></script>
<!-- MAIN DEMO SCRIPT WITH main() FUNC: -->
<script src="main.js"></script>
<!-- INCLUDE FORK ME ON GITHUB BANNER -->
<script src="../appearance/widget.js"></script>
<link rel="stylesheet" href="../appearance/style.css" type="text/css" />
<style type='text/css'>
body {background-color: white; margin: 0;}
#jeelizFaceExpressionsCanvas {
z-index: 20;
position: fixed;
bottom: 0px; left: 0px;
max-height: 25vh;
transform: rotateY(180deg); /* mirror video */
}
.webojiSVG {
z-index: 10;
position: fixed;
max-height: 100%; max-width: 100%; left: 50%; top: 50%;
width: 100vmin;
transform: translate(-50%, -50%);
}
.svgEyeLeftOpen {
display: none;
}
.svgEyeRightOpen {
display: none;
}
.svgEyeLeftClose {
display: none;
}
.svgEyeRightClose {
display: none;
}
.svgMouthRound {
display: none;
}
.svgMouthOpen {
display: none;
}
.svgSmileLeft {
display: none;
}
.svgSmileRight {
display: none;
}
.svgSmile {
display: none;
}
.svgMouthRest{
display: none;
}
.svgMouthNasty{
display: none;
}
.eyeBrowLeftRest{
display: none;
}
.eyeBrowRightRest{
display: none;
}
.eyeBrowLeftUp{
display: none;
}
.eyeBrowRightUp{
display: none;
}
.eyeBrowLeftDown{
display: none;
}
.eyeBrowRightDown{
display: none;
}
</style>
</head>
<body>
<!-- VIDEO FEEDBACK: -->
<canvas id='jeelizFaceExpressionsCanvas'></canvas>
<!-- SVG IMAGE: -->
<!-- this tool is handy to design SVG online: http://editor.method.ac/ -->
<!-- <img src='../../assets/2D/cartman.svg' class='webojiSVG' /> -->
<div class='webojiSVG'>
<svg viewBox='0 0 104 97' xmlns='http://www.w3.org/2000/svg'>
<!-- ALL PARTS WHICH ARE NOT THE HEAD : -->
<path d='M14,85l3,9h72c0,0,5-9,4-10c-2-2-79,0-79,1' fill='#7C4E32'/> <!-- PANTS -->
<path d='M19,47c0,0-9,7-13,14c-5,6,3,7,3,7l1,14c0,0,10,8,23,8c14,0,26,1,28,0c2-1,9-2,9-4c1-1,27,1,27-9c0-10,7-20-11-29c-17-9-67-1-67-1' fill='#E30000'/> <!-- RED JACKET -->
<path d='M12,94c0,0,20-4,42,0c0,0,27-4,39,0z' fill='#000'/><!--FEETS -->
<path d='M56,78v1M55,69v1M55,87v1' stroke='#000' stroke-linecap='round'/> <!-- JACKET BUTTONS -->
<path d='M56,66l2,12l-2,12' fill='none' stroke='#000' stroke-width='0.5'/> <!-- JACKET ZIP -->
<!-- GLOVES : -->
<path d='M5,62c3-2,5-2,8,0c3,2,13,6,8,11c-2,2-6,0-8,0c-1,1-4,2-6,1c-4-3-6-8-2-12M99,59c0,0-9-2-11,4l-3,5c0,1-2,3,3,3c5,0,5,2,7,2c3,0,7-1,7-4c0-4-1-11-3-10' fill='#FFF200'/>
<!-- HEAD (AND HAT): -->
<g id='svgHead' style="transform-origin: 50% 40%;">
<path d='M17,32c-3,48,80,43,71-3 l-35-15' fill='#FFE1C4'/> <!-- HEAD SKIN -->
<path d="M17,32c9-36,61-32,71-3c-20-9-40-9-71,3" fill="#8ED8F8"/> <!-- BLUE PART OF HAT -->
<path class='svgEyeLeftClose' d='M54,35a10 8 60 1 1 0,0.1z' stroke='#000' fill='none' stroke-width='0.5'/>
<path class='svgEyeRightClose' d='M37,38a10 8 -60 1 1 0,0.1z' stroke='#000' fill='none' stroke-width='0.5'/>
<rect class='svgEyeLeftClose' x="53" y="25" width="20" height="15" fill="#FFE1C4"/>
<rect class='svgEyeRightClose' x="35" y="25" width="20" height="15" fill="#FFE1C4"/>
<path class='svgEyeLeftOpen' d='M54,35a10 8 60 1 1 0,0.1z' fill='#FFF'/>
<path class='svgEyeRightOpen' d='M37,38a10 8 -60 1 1 0,0.1z' fill='#FFF'/>
<!-- ALL YELLOW PARTS: -->
<path d='M41,6c1-1,4-3,8-3c3-0,9-1,14,3l-1,2h-2h-2c0,0-3,1-5,0c-2-1-1-1-1-1l-3,1l-2-1h-1c0,0-1,2-3,2c0,0-2-1-2-3M17,34l0-2c0,0,35-20,71-3v2c0,0-35-17-71,3' fill='#FFF200'/>
<!-- PUPILS: -->
<path class='svgEyeLeftOpen' id='svgPupilLeft' d='M60,36a1 1 0 1 1 0-0.1'/>
<path class='svgEyeRightOpen' id='svgPupilRight' d='M49,36a1 1 0 1 1 0-0.1'/>
<!-- MOUTH POSITIONS: -->
<path class='svgMouthRound' d='M57,55a2 3 0 1 1 0-0.1'/>
<path class='svgMouthOpen' d='M50,52 l3,-1 l9,2 l-3,6 l-6,-1 z'/>
<path class='svgMouthRest' d='M50,54c0,0,6,4,10,0' fill='none' stroke='#000' stroke-width='0.8' stroke-linecap='round'/>
<path class='svgMouthNasty' d='M45,53c 0 8.991 1.701 3.969 10.53 4.131 c 8.829 0.162 9.801 4.455 9.882 -4.779 c 0.081 -9.234 -5.508 -1.134 -10.53 -1.134 c -5.022 0 -9.882 -7.209 -9.882 1.782 z'/>
<path class='svgSmileLeft' d='M50,56c0,0,6,2,12,-6' fill='none' stroke='#000' stroke-width='0.8' stroke-linecap='round'/>
<path class='svgSmileRight' d='M60,56c0,0,-6,2,-12,-6' fill='none' stroke='#000' stroke-width='0.8' stroke-linecap='round'/>
<path class='svgSmile' d='M44,52 l20,0 l-10,8 z' />
<!-- EYEBROWS: -->
<path class='eyeBrowLeftRest' d='M70,26l-12,1 l11,1z'/>
<path class='eyeBrowRightRest' d='M40,25l12,1 l-11,1z'/>
<path class='eyeBrowLeftUp' d='M70,28l-12,-5 l11,3z'/>
<path class='eyeBrowRightUp' d='M40,28l12,-5 l-11,3z'/>
<path class='eyeBrowLeftDown' d='M65,22l-11,9 l12,-6z'/>
<path class='eyeBrowRightDown' d='M43,21l11,9 l-12,-6z'/>
<!-- CHIN: -->
<path d='M50,59c0,0,4,3,10,0' fill='none' stroke='#000' stroke-width='0.5' />
<!-- DOUBLE CHIN: -->
<path d='M25,50c0,0,10,12,23,12c13,0,24,0,35-15' fill='none' stroke='#000' stroke-width='0.5'/>
<!-- TEETHS: -->
<path class='svgMouthOpen' d='M52,52.5 l2,0 l0,1 l-1.5,0 z' fill='#fff' />
<path class='svgMouthOpen' d='M54.5,52.5 l2,0 l0,1 l-1.5,0 z' fill='#fff' />
<path class='svgMouthOpen' d='M57,52.5 l2,0 l0,1 l-1.5,0 z' fill='#fff' />
<path class='svgSmile' d='M47,52.5 l3,0 l0,2 l-1.5,0 z' fill='#fff' />
<path class='svgSmile' d='M50.5,52.5 l3,0 l0,2 l-3,0 z' fill='#fff' />
<path class='svgSmile' d='M54,52.5 l3,0 l0,2 l-3,0 z' fill='#fff' />
<path class='svgSmile' d='M57.5,52.5 l3,0 l-1.5,2 l-1.5,0 z' fill='#fff' />$
</g>
</svg>
</div>
</body>
</html>