-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdemo2.html
121 lines (100 loc) · 4.04 KB
/
demo2.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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="minimal-ui, user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<title>SH3DO demo: 3D virtual visit</title>
<script type="text/javascript" src="https://demo.sh3d.online/lib/big.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/gl-matrix-min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/jszip.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/jsXmlSaxParser.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/core.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/geom.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/stroke.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/swingundo.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/batik-svgpathparser.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/triangulator.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/graphics2d.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://demo.sh3d.online/lib/sweethome3d.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="https://demo.sh3d.online/css/sweethome3d.css" crossorigin="anonymous">
<style type="text/css">
#home-plan {
display: none;
}
#furniture-catalog {
display: none;
}
#home-pane-toolbar {
display: none;
}
#home-3D-view {
top: 0px;
left: 0px;
height: 100%;
width: 100%;
}
#progress {
opacity: 70%;
z-index: 10;
position: absolute;
top: 0px;
height: 5px;
width: 100%;
}
#progress-bar {
background-color: blue;
height: 100%;
}
</style>
</head>
<body>
<div id="progress">
<div id="progress-bar" style="width: 0%;"></div>
</div>
<div id="home-pane">
<canvas id="home-3D-view" style="background-color: #CCCCCC;"
tabIndex="1"></canvas>
<div id="home-plan" style="background-color: #FFFFFF; color: #000000"
tabIndex="2" ></div>
<div id="home-pane-toolbar"></div>
<div id="furniture-catalog"></div>
</div>
<script type="text/javascript">
var homeName = "SweetHome3DExample11-HouseWithTerrace";
var urlBase = "https://demo.sh3d.online/";
var application = new SweetHome3DJSApplication(
{readHomeURL: urlBase + "api/readHome/12345/test/%s",
furnitureCatalogURLs: [urlBase + "lib/resources/DefaultFurnitureCatalog.json"],
furnitureResourcesURLBase: urlBase
});
// Set a few settings
application.getUserPreferences().setNewRoomFloorColor(0xFF9999A0);
application.getUserPreferences().setAerialViewCenteredOnSelectionEnabled(true);
// Read and display test file
application.getHomeRecorder().readHome(homeName,
{
homeLoaded: function(home) {
home.setName(homeName);
application.addHome(home);
application.getHomes()[0].setCamera(application.getHomes()[0].getStoredCameras()[0])
setTimeout(function() {
document.getElementById('progress').style.display = "none";
}, 1000);
window.addEventListener("unload", function() {
application.deleteHome(home);
});
},
homeError: function(err) {
console.error(err);
},
progression: function(part, info, percentage) {
percentage = percentage * 100;
document.getElementById('progress-bar').style.width = `${percentage}%`;
}
});
</script>
</body>
</html>