-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
158 lines (116 loc) · 10.1 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
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="image-detection.js"></script>
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/[email protected]/dist/aframe-extras.min.js"></script>
<script src="image-aframe.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.2/html2canvas.min.js"></script>
</head>
<body>
<div style="position: absolute; z-index: 1000">
<button id="snap-button">SNAPSHOT</button>
<a href="#" id="download-link"></a>
</div>
<style media="screen">
button{
border: 2px solid #fff;
border-radius: 25px;
font-weight: bold;
padding: 10px 15px;
color: #fff;
transform: translate(5px,5px);
background-color: #FF10F0;
margin: 20px;
/* visibility: hidden; */
}
button:active{
border: 2px solid #FF10F0;
border-radius: 25px;
font-weight: bold;
padding: 10px 15px;
color: #FF10F0;
transform: translate(5px,5px);
background-color: #fff;
margin: 20px;
}
</style>
<a-scene mindar-image="imageTargetSrc: targets.mind;" color-space="sRGB" renderer="colorManagement: true, physicallyCorrectLights" vr-mode-ui="enabled: false" device-orientation-permission-ui="enabled: false" loading-screen="enabled: false">
<canvas></canvas>
<a-assets>
<!-- <img id="card" src="card.jpeg" />-->
<a-asset-item id="avatarModel" src="./model/scene.gltf"></a-asset-item>
<a-asset-item id="camera-icon" src="./camera/scene.gltf"></a-asset-item>
<!-- <a-asset-item id="arrow" src="./arrow/scene.gltf"></a-asset-item> -->
</a-assets>
<a-camera position="0 0 0" look-controls="enabled: false" cursor="fuse: false; rayOrigin: mouse;" raycaster="far: 10000; objects: .clickable"></a-camera>
<a-entity mindar-image-target="targetIndex: 0">
<a-entity gltf-model="#avatarModel" position="0 0 0" rotation="0 90 0" scale=".2 .2 .2" animation-mixer></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#f00" position="-0.429 0.02 0.1" scale="0.03 0.03 0.03"></a-entity>
<a-entity text="value:Power Button; color:#f00; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.7 0.7 0.7" position="-0.15 0.056 0.1"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#0f0" position="-0.437 -0.029 0.1" scale="0.017 0.017 0.017"></a-entity>
<a-entity text="value:Mic 1; color:#0f0; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.5 0.5 0.5" position="-0.22 -0.067 0.1"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#0ff" position="-0.40 -0.029 0.1" scale="0.017 0.017 0.017"></a-entity>
<a-entity text="value:Mic 2; color:#0ff; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.5 0.5 0.5" position="-0.17 -0.067 0.1"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#ff0" position="-0.29 -0.029 0.1" scale="0.017 0.017 0.017"></a-entity>
<a-entity text="value:Vol 1; color:#ff0; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.5 0.5 0.5" position="-0.067 -0.069 0.1"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#fff" position="-0.252 -0.029 0.1" scale="0.017 0.017 0.017"></a-entity>
<a-entity text="value:Vol 2; color:#fff; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.5 0.5 0.5" position="-0.02 -0.069 0.1"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#ccc" position="0.394 -0.022 0.1" scale="0.038 0.038 0.038"></a-entity>
<a-entity text="value:Music controls; color:#ccc; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.5 0.5 0.5" position="0.58 -0.09 0.1"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#FF6700" position="0.39 0.054 0.1" scale="0.02 0.02 0.02"></a-entity>
<a-entity text="value:N/P; color:#FF6700; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.5 0.5 0.5" position="0.62 0.08 0.1"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#f0f" position="0.431 0.054 0.1" scale="0.02 0.02 0.02"></a-entity>
<a-entity text="value:L/R; color:#f0f; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.5 0.5 0.5" position="0.66 0.08 0.1"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#fff" position="0.25 0.02 0.1" scale="0.07 0.07 0.07"></a-entity>
<a-entity text="value:Main controls; color:#fff; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.68 0.68 0.68" position="0.48 -0.09 0.1"></a-entity>
</a-entity>
<a-entity id="snapshot-target" mindar-image-target="targetIndex: 1 smoothCount: 0 smoothTolerance: 0.0001 smoothThreshold: 0">
<a-entity id="faqtext" text="value:To know more about this audio player, tap here; color:#000; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="1.2 1.2 1.2" position="0 0.28 0"></a-entity>
<a-plane id="faq" class="clickable" color="#fff" opaciy="0.5" position="-0.065 0.3 -0.0000001" height="0.08" width="1.1" rotation="0 0 0"></a-plane>
<!-- <a-entity id="cam" gltf-model="#camera-icon" class="clickable" position="0 -0.3 0" rotation="0 0 0" scale="0.01 0.01 0.01"></a-entity> -->
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#f00" position="0.025 0.05 0" scale="0.03 0.03 0.03"></a-entity>
<a-entity text="value:+12Volts; color:#f00; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="1 1 1" position="0.45 0.08 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#00f" position="0.14 0.06 0" scale="0.03 0.03 0.03"></a-entity>
<a-entity text="value:-12Volts; color:#00f; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="1 1 1" position="0.542 -0.028 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#fff" position="0.3 0.022 0" scale="0.03 0.03 0.03"></a-entity>
<a-entity text="value:Left 0/P; color:#fff; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="1 1 1" position="0.71 -0.049 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#fff" position="0.45 0.022 0" scale="0.03 0.03 0.03"></a-entity>
<a-entity text="value:Right 0/P; color:#fff; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="1 1 1" position="0.88 -0.049 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#ff0" position="-0.356 -0.018 0" scale="0.022 0.022 0.022"></a-entity>
<a-entity text="value:Video O/P; color:#ff0; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.8 0.8 0.8" position="-0.1 0.01 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#333" position="-0.356 -0.076 0" scale="0.022 0.022 0.022"></a-entity>
<a-entity text="value:RF; color:#333; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.8 0.8 0.8" position="0.028 -0.13 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#fff" position="-0.305 -0.018 0" scale="0.022 0.022 0.022"></a-entity>
<a-entity text="value:R1; color:#fff; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.8 0.8 0.8" position="0.082 0.01 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#f00" position="-0.305 -0.076 0" scale="0.022 0.022 0.022"></a-entity>
<a-entity text="value:R2; color:#f00; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.8 0.8 0.8" position="0.082 -0.13 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#fff" position="-0.250 -0.018 0" scale="0.022 0.022 0.022"></a-entity>
<a-entity text="value:L1; color:#fff; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.8 0.8 0.8" position="0.134 0.01 0"></a-entity>
<a-entity geometry="primitive: ring; radiusInner: 0.9; radiusOuter: 1" material="side: double; color:#f00" position="-0.250 -0.076 0" scale="0.022 0.022 0.022"></a-entity>
<a-entity text="value:L2; color:#f00; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="0.8 0.8 0.8" position="0.134 -0.13 0"></a-entity>
</a-entity>
</a-scene>
<script src="snapshot.js" charset="utf-8"></script>
<script type="text/javascript">
// detect click event
const faq = document.querySelector('#faq');
faq.addEventListener("click", event => {
console.log("text click");
window.open("https://en.wikipedia.org/wiki/Audio_player");
});
// const cam = document.querySelector('#cam');
// cam.addEventListener("click", event => {
// console.log("gltf click");
// document.getElementById("snap-button").click();
// });
// detect target found
const snaptarget = document.querySelector('#snapshot-target');
snaptarget.addEventListener("targetFound", event => {
console.log("snap target found");
// document.getElementById("snap-button").click();
// document.getElementById("snap-button").style.visibility = "visible";
});
</script>
</body>
</html>