-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
135 lines (100 loc) · 7.39 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
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-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/aframe-extras@v6.1.1/dist/aframe-extras.min.js"></script>
<script src="image-aframe.js"></script>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Zilla+Slab+Highlight:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Zilla+Slab:wght@300;600;700&display=swap" rel="stylesheet">
<script>
function foo() {
if (document.getElementById('place').childNodes.length > 1) {
document.getElementById('place').lastChild.setAttribute('text', {
value: document.querySelector('input[type="text"]').value
});
}
}
</script>
</head>
<body>
<div style="position: absolute; z-index: 1000">
<div id="mode" class="mode">
Fresh <span id="status">Portrait</span> Mode.
</div>
<button id="snap-button">Clear annotation</button>
<label class="switch">
<input id="toggleswitch" type="checkbox">
<span class="slider round"></span>
</label>
<form id="textinput" onsubmit="return false">
<input id="inputtext" type="text" value="Edit Text">
</form>
<button class="replacebutton" id="replacebutton" onclick="foo()">Replace</button>
</div>
<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">
<a-assets>
<!-- <img id="card" src="card.jpeg" />-->
<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 id="snapshot-target" class="clickable" mindar-image-target="smoothCount: 0 smoothTolerance: 0.0001 smoothThreshold: 0">
<a-entity id="faqtext" text="value:To know more about this audio player; color:#000; shader: msdf; font:./aclonica/Aclonica-Regular.json;" scale="1.2 1.2 1.2" position="0.02 0.28 0"></a-entity>
<a-plane id="faq" color="#fff" position="-0.065 0.3 -0.0000001" height="0.08" width="1.1" rotation="0 0 0"></a-plane>
<a-entity id="arrow" gltf-model="#arrow" position="0 -0.3 0" rotation="0 0 90" scale="0.001 0.001 0.001"></a-entity>
<a-plane id="place" class="clickable" color="#fff" opacity="0.0" position="0 0 0" height="100" width="100" rotation="0 0 0"></a-plane>
<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 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();
// });
var input = document.getElementById('toggleswitch');
var outputtext = document.getElementById('status');
input.addEventListener('change',function(){
if(this.checked) {
outputtext.innerHTML = "Landscape";
}
else {
outputtext.innerHTML = "Portrait";
}
});
// detect target found
const snaptarget = document.querySelector('#snapshot-target');
snaptarget.addEventListener("targetFound", event => {
console.log("snap target found");
});
</script>
<script src="tap-place.js" charset="utf-8"></script>
<script src="localstorage.js" charset="utf-8"></script>
</body>
</html>