-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pianta.html
81 lines (72 loc) · 3.11 KB
/
Pianta.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
<!DOCTYPE html>
<html lang="en" class="fullscreen-100">
<head>
<meta charset="utf-8">
<title>Pianta</title>
<link rel="stylesheet" href="css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="white"/>
<meta name="description" content="">
<script src="https://unpkg.com/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="https://unpkg.com/intersection-observer/intersection-observer.js"></script>
<script src="https://unpkg.com/resize-observer-polyfill/dist/ResizeObserver.js"></script>
<script src="https://unpkg.com/fullscreen-polyfill/dist/fullscreen.polyfill.js"></script>
<script src="https://unpkg.com/focus-visible/dist/focus-visible.js" defer></script>
<style>
.button-load-class {
background-repeat: no-repeat;
background-size: 24px 24px;
background-position: 6% 50%;
background-color: #000;
color: white;
cursor: pointer;
border-radius: 6px;
display: inline-block;
padding: 10px 10px 10px 10px;
font-weight: 500;
box-shadow: 0 0 8px rgba(0, 0, 0, .2), 0 0 4px rgba(0, 0, 0, .25);
position: absolute;
left: 50%;
top: 86%;
transform: translate3d(-50%, -50%, 0);
z-index: 100;
}
</style>
</head>
<body class="fullscreen-100">
<model-viewer id="Pianta-load" reveal="interaction"
class='model-viewer' ar autoplay camera-controls src='models/Pianta.glb'
ios-src='models/Pianta.usdz' alt=''
exposure="0.6" shadow-intensity="1.5" shadow-softness="0.8" quick-look-browsers="safari chrome">
<div id="Pianta-poster" class="cloudimage-360" data-folder="img/Pianta/" data-filename="photo-{index}.png"
data-amount="36"></div>
<div id="Pianta-button-load" class="button-load-class" slot="poster">Load 3D Model</div>
<script>
function inIframe() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
const modelViewer = document.getElementById('Pianta-load');
const poster = document.getElementById('Pianta-poster');
const button = document.getElementById('Pianta-button-load');
if (!inIframe()) {
//disattivo il 360 viewer e faccio caricare il modello
poster.style.visibility = "hidden";
modelViewer.reveal = "auto"
button.innerHTML = "Loading"
} else {
modelViewer.addEventListener("load", function (event) {
console.log(event);
poster.style.visibility = "hidden";
})
}
</script>
</model-viewer>
<script type="module" src="js/model-viewer/dist/model-viewer.js"></script>
<script nomodule src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"></script>
<script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/2/js-cloudimage-360-view.min.js"></script>
</body>
</html>