-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathandios.html
More file actions
51 lines (42 loc) · 1.42 KB
/
andios.html
File metadata and controls
51 lines (42 loc) · 1.42 KB
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
<!DOCTYPE html>
<html>
<body>
<script>
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};
if ( isMobile.Android() ) {
<model-viewer id="model-viewer" src="https://interaktive10.github.io/hosted-assets/blueshoe.glb" ar ar-modes="scene-viewer quick-look webxr " xr-environment>
<button slot= "ar-button" id="ar-button"> Activate AR</button>
</model-viewer>
window.onload = function() {
document.getElementById("ar-button").click();
window.alert = function (text){
console.log("Alert text is "+ text);
}
}
}
else {
<model-viewer id="model-viewer" src="https://interaktive10.github.io/hosted-assets/blueshoe.usdz" ar ar-modes="quick-look webxr scene-viewer " xr-environment>
</model-viewer>
}
</script>
</body>
</html>