-
Notifications
You must be signed in to change notification settings - Fork 200
/
index.html
235 lines (232 loc) · 18 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A-Painter</title>
<link rel="icon" href="img/icon-256.png">
<meta name="description" content="Paint in VR in your browser. Powered by A-Frame.">
<script src="vendor/aframe-master.min.js"></script>
<script src="vendor/aframe-input-mapping-component.js"></script>
<script src="build.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aframe-gltf-exporter-component.min.js"></script>
<script src="vendor/aframe-blink-controls.js"></script>
<script src="vendor/aframe-tooltip-component.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aframe-orbit-controls.min.js"></script>
<link rel="stylesheet" href="css/main.css">
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="manifest.webmanifest">
</head>
<body>
<a-scene vr-analytics renderer="colorManagement: true">
<a-assets>
<img id="skymap" src="assets/images/sky.jpg" crossorigin="anonymous">
<img id="uinormal" src="assets/images/ui-normal.png" crossorigin="anonymous">
<img id="floor" src="assets/images/floor.jpg" crossorigin="anonymous">
<a-asset-item id="logoobj" src="assets/models/logo.obj"></a-asset-item>
<a-asset-item id="logomtl" src="assets/models/logo.mtl"></a-asset-item>
<a-asset-item id="uiobj" src="assets/models/ui.obj"></a-asset-item>
<a-asset-item id="hitEntityObj" src="assets/models/teleportHitEntity.obj"></a-asset-item>
<a-asset-item id="tipObj" src="assets/models/controller-tip.glb"></a-asset-item>
<audio id="ui_click0" src="https://cdn.aframe.io/a-painter/sounds/ui_click0.ogg">
<audio id="ui_click1" src="https://cdn.aframe.io/a-painter/sounds/ui_click1.ogg">
<audio id="ui_menu" src="https://cdn.aframe.io/a-painter/sounds/ui_menu.ogg">
<audio id="ui_undo" src="https://cdn.aframe.io/a-painter/sounds/ui_undo.ogg">
<audio id="ui_tick" src="https://cdn.aframe.io/a-painter/sounds/ui_tick.ogg">
<audio id="ui_paint" src="https://cdn.aframe.io/a-painter/sounds/ui_paint.ogg">
</a-assets>
<a-light type="point" light="color: #fff; intensity:0.6" position="3 10 1"></a-light>
<a-light type="point" light="color: #fff; intensity:0.2" position="-3 -10 0"></a-light>
<a-light type="hemisphere" groundColor="#888" intensity="0.8"></a-light>
<a-entity id="logo" logo-model
animation="dur: 4000; property: logo-model.opacity; from: 1; to: 0; startEvents: painting-started"></a-entity>
<a-entity id="ground"
geometry="primitive: box; width: 12; height: 0.01; depth: 12"
material="shader: flat; src: #floor">
</a-entity>
<a-entity id="sky" geometry="primitive:sphere; radius:30; phiLength:360; phiStart:0; thetaLength:90" material="shader:flat; side:back; height:2048; src:#skymap; width:2048"></a-entity>
<a-entity id="hitEntityLeft" material="shader:flat; color: #ff3468" obj-model="obj: #hitEntityObj"></a-entity>
<a-entity id="hitEntityRight" material="shader:flat; color: #ff3468" obj-model="obj: #hitEntityObj"></a-entity>
<a-entity id="cameraRig">
<!-- camera -->
<a-entity id="acamera" camera></a-entity>
<!-- hand controls -->
<a-entity id="left-hand"
brush
paint-controls="hand: left"
blink-controls="cameraRig: #cameraRig; startEvents: aim; endEvents: teleport; hitCylinderColor: #ff3468; curveHitColor: #ff3468; curveMissColor: #333333; curveLineWidth: 0.01; hitEntity: #hitEntityLeft"
ui>
<a-entity class="vive-tooltips" visible="false">
<a-entity tooltip="text: Brush size\n(slide up/down); width: 0.1; height: 0.04; targetPosition: 0 0.016 0.0073; src: assets/images/tooltip.png"
position="0.1 0.025 0.048"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Main menu; width: 0.07; height: 0.03; targetPosition: 0 -0.07 -0.062; lineHorizontalAlign: center; lineVerticalAlign: bottom; src: assets/images/tooltip.png"
position="0 0.015 -0.05"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Press to paint\n(pressure sensitive); width: 0.11; height: 0.04; targetPosition: 0 -0.06 0.067; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.11 -0.055 0.04"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Undo; width: 0.06; height: 0.03; targetPosition: -0.003 0.046 0.106; src: assets/images/tooltip.png"
position="0.1 -0.005 0.12"
rotation="-90 0 0">
</a-entity>
</a-entity>
<a-entity class="oculus-tooltips" visible="false">
<a-entity tooltip="text: Main Menu; width: 0.07; height: 0.03; targetPosition: 0.011 0.005 0.045; rotation: -90 0 0; src: assets/images/tooltip.png"
position="0.12 0.016 0.06">
</a-entity>
<a-entity tooltip="text: Teleport; width: 0.06; height: 0.03; targetPosition: 0.015 0 0.035; rotation: -90 0 0; src: assets/images/tooltip.png"
position="0.08 0.035 -0.02">
</a-entity>
<a-entity tooltip="text: Brush size\n(slide up/down); width: 0.09; height: 0.04; targetPosition: 0 0.01 0.03; lineHorizontalAlign: center; lineVerticalAlign: top; rotation: -90 0 0; src: assets/images/tooltip.png"
position="-0.07 0.01 0.093">
</a-entity>
<a-entity tooltip="text: Press to paint!\n(pressure sensitive); width: 0.11; height: 0.04; targetPosition: 0.022 -0.023 0.02; lineHorizontalAlign: right; rotation: -90 0 0; src: assets/images/tooltip.png"
position="-0.09 0.020 -0.067">
</a-entity>
<a-entity tooltip="text: Undo; width: 0.05; height: 0.03; targetPosition: 0.01 -0.03 0.047; rotation: -90 0 0; src: assets/images/tooltip.png"
position="0.07 -0.01 0.088">
</a-entity>
</a-entity>
<a-entity class="windows-motion-samsung-tooltips" visible="false">
<a-entity tooltip="text: Trigger to paint!; width: 0.1; height: 0.04; targetPosition: 0 -.3 -.1; lineHorizontalAlign: center; lineVerticalAlign: bottom; src: assets/images/tooltip.png"
position="0 -.1 -.2"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Main menu; width: 0.07; height: 0.03; targetPosition: 0.005 -0.002 -.06; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.1 0.02 -.05"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Brush size\n(up/down); width: 0.11; height: 0.04; targetPosition: 0 -.09 -.1; lineHorizontalAlign: left; src: assets/images/tooltip.png"
position="0.2 0 -.11"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Press to undo; width: 0.11; height: 0.03; targetPosition: 0 0 0; lineHorizontalAlign: left; src: assets/images/tooltip.png"
position="0.11 0 0"
rotation="-90 0 0">
</a-entity>
</a-entity>
<a-entity class="windows-motion-tooltips" visible="false">
<a-entity tooltip="text: Trigger to paint!; width: 0.1; height: 0.04; targetPosition: 0 -.3 -.1; lineHorizontalAlign: center; lineVerticalAlign: bottom; src: assets/images/tooltip.png"
position="0 -.1 -.2"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Main menu; width: 0.07; height: 0.03; targetPosition: 0.01 0.0025 -.06; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.1 0.02 -.05"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Brush size\n(up/down); width: 0.11; height: 0.04; targetPosition: 0 -.09 -.1; lineHorizontalAlign: left; src: assets/images/tooltip.png"
position="0.14 0 -.1"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Press to undo; width: 0.11; height: 0.03; targetPosition: 0 0 0; lineHorizontalAlign: left; src: assets/images/tooltip.png"
position="0.11 0 0"
rotation="-90 0 0">
</a-entity>
</a-entity>
</a-entity>
<a-entity id="right-hand"
brush
paint-controls="hand: right"
blink-controls="cameraRig: #cameraRig; startEvents: aim; endEvents: teleport; hitCylinderColor: #ff3468; curveHitColor: #ff3468; curveMissColor: #333333; curveLineWidth: 0.01; hitEntity: #hitEntityRight"
ui>
<a-entity class="vive-tooltips" visible="false">
<a-entity tooltip="text: Brush size\n(slide up/down); width: 0.1; height: 0.04; targetPosition: 0 0.016 0.0073; src: assets/images/tooltip.png"
position="0.1 0.025 0.048"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Main menu; width: 0.07; height: 0.03; targetPosition: 0 -0.07 -0.062; lineHorizontalAlign: center; lineVerticalAlign: bottom; src: assets/images/tooltip.png"
position="0 0.015 -0.05"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Press to paint\n(pressure sensitive); width: 0.11; height: 0.04; targetPosition: 0 -0.06 0.067; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.11 -0.055 0.04"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Undo; width: 0.06; height: 0.03; targetPosition: -0.003 0.046 0.106; src: assets/images/tooltip.png"
position="0.1 -0.005 0.12"
rotation="-90 0 0">
</a-entity>
</a-entity>
<a-entity class="oculus-tooltips" visible="false">
<a-entity tooltip="text: Main Menu; width: 0.07; height: 0.03; targetPosition: -0.011 0.005 0.045; rotation: -90 0 0; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.12 0.016 0.06">
</a-entity>
<a-entity tooltip="text: Teleport; width: 0.06; height: 0.03; targetPosition: -0.015 0 0.035; rotation: -90 0 0; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.08 0.035 -0.02">
</a-entity>
<a-entity tooltip="text: Brush size\n(slide up/down); width: 0.09; height: 0.04; targetPosition: 0 0.01 0.03; lineHorizontalAlign: center; lineVerticalAlign: top; rotation: -90 0 0; src: assets/images/tooltip.png"
position="0.07 0.01 0.093">
</a-entity>
<a-entity tooltip="text: Press to paint!\n(pressure sensitive); width: 0.11; height: 0.04; targetPosition: -0.022 -0.023 0.02; lineHorizontalAlign: left; rotation: -90 0 0; src: assets/images/tooltip.png"
position="0.09 0.020 -0.067">
</a-entity>
<a-entity tooltip="text: Undo; width: 0.05; height: 0.03; targetPosition: -0.01 -0.03 0.047; rotation: -90 0 0; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.07 -0.01 0.088">
</a-entity>
</a-entity>
<a-entity class="windows-motion-samsung-tooltips" visible="false">
<a-entity tooltip="text: Trigger to paint!; width: 0.1; height: 0.04; targetPosition: 0 -.3 -.1; lineHorizontalAlign: center; lineVerticalAlign: bottom; src: assets/images/tooltip.png"
position="0 -.1 -.2"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Main menu; width: 0.07; height: 0.03; targetPosition: -.01 -0.004 -.06; lineHorizontalAlign: left; src: assets/images/tooltip.png"
position="0.1 0.02 -.05"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Brush size\n(up/down); width: 0.11; height: 0.04; targetPosition: 0 -.09 -.1; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.19 -0.003 -.11"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Press to undo; width: 0.11; height: 0.03; targetPosition: 0 0 0; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.11 0 0"
rotation="-90 0 0">
</a-entity>
</a-entity>
<a-entity class="windows-motion-tooltips" visible="false">
<a-entity tooltip="text: Trigger to paint!; width: 0.1; height: 0.04; targetPosition: 0 -.3 -.1; lineHorizontalAlign: center; lineVerticalAlign: bottom; src: assets/images/tooltip.png"
position="0 -.1 -.2"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Main menu; width: 0.07; height: 0.03; targetPosition: -.015 0.0025 -.06; lineHorizontalAlign: left; src: assets/images/tooltip.png"
position="0.1 0.02 -.05"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Brush size\n(up/down); width: 0.11; height: 0.04; targetPosition: 0 -.09 -.1; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.14 0 -.1"
rotation="-90 0 0">
</a-entity>
<a-entity tooltip="text: Press to undo; width: 0.11; height: 0.03; targetPosition: 0 0 0; lineHorizontalAlign: right; src: assets/images/tooltip.png"
position="-0.11 0 0"
rotation="-90 0 0">
</a-entity>
</a-entity>
</a-entity>
</a-entity>
</a-scene>
<a href="https://aframe.io/a-painter/"><div id="apainter-logo" class="hidden"></div><div id="apainter-author" style="display:none" class="hidden">authorname</div></a>
<div id="apainter-ui">
<div class="progress hide">
Saving painting...
<div class="bar"></div>
</div>
<div class="share hide">
<div class="help">
<h1>Painting saved!</h1>
<p>Your painting was saved in the following URL.<br>You can use it to continue your work later or to share your masterpiece in social media.</p>
</div>
<div class="form">
<input id="apainter-share-url" type="text" value="" readonly/>
<div id="copy-toclipboard" data-clipboard-target="#apainter-share-url" class="button copy">COPY URL</div>
</div>
</div>
</div>
<script src="vendor/ga.js"></script>
<!-- GitHub corner. -->
<a href="https://github.com/aframevr/a-painter" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
</body>
</html>