forked from donmccurdy/three-gltf-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
254 lines (253 loc) · 8.42 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>3 D V I E W E R</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="author" content="idéesculture, based on Don McCurdy GLTF viewer">
<meta name="description" content="Embed 3D meshes easily in your website">
<link rel="canonical" href="https://github.com/ideesculture/3dviewer">
<link rel="icon" type="image/svg+xml" href="sphere.svg"/>
<link rel="shortcut icon" href="sphere.svg">
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400" rel="stylesheet">
<script src="src/app.js"></script>
</head>
<body>
<div id="loading" style="
/* position: absolute; */
/* top: 50%; */
/* left: 100%; */
z-index: 3000;
display: inline-block;
z-index: 50;
float: left;
width: 100px;
overflow: hidden;
/*border: 1px solid blue;*/
position: absolute;
background: rgba(0,0,0,0.9);
border-radius: 50px;
top: 50%;
left: 50%;
height: 100px;
margin-top: -50px;
margin-left: -50px;
padding-top:17px;
line-height: 100px;
text-align: center;
"><img src="ball-triangle.svg" /></div>
<div id="wireframe" style="
/* position: absolute; */
/* top: 50%; */
/* left: 100%; */
z-index: 3000;
display: inline-block;
z-index: 50;
float: left;
width: 100px;
overflow: hidden;
/*border: 1px solid blue;*/
position: absolute;
bottom: 40px;
right: 40px;
height: 100px;
margin-top: -50px;
margin-left: -50px;
padding-top:17px;
line-height: 100px;
text-align: center;
"><img src="sphere.svg" style="width:60px;fill:white;stroke:white;"/></div>
<div id="light" style="
/* position: absolute; */
/* top: 50%; */
/* left: 100%; */
z-index: 3000;
display: inline-block;
z-index: 50;
float: left;
width: 100px;
overflow: hidden;
/*border: 1px solid blue;*/
/*border: 1px solid blue;*/
position: absolute;
bottom: 40px;
right: 110px;
height: 100px;
margin-top: -50px;
margin-left: -50px;
padding-top:17px;
line-height: 100px;
text-align: center;
"><img src="light.svg" style="width:60px;fill:white;stroke:white;"/></div>
<div id="rotate" style="
display: inline-block;
z-index: 50;
width: 100px;
overflow: hidden;
position: absolute;
bottom: 40px;
right: 180px;
height: 100px;
margin-top: -50px;
margin-left: -50px;
padding-top:17px;
line-height: 100px;
text-align: center;
"><img src="rotate.svg" style="width:60px;fill:white;stroke:white;"/></div>
<div id="credits" style="
color:lightgray;
display: inline-block;
z-index: 50;
width: 150px;
overflow: hidden;
position: absolute;
bottom: 24px;
right: 60px;
height: 20px;
line-height: 14px;
text-align: center;
font-size:15px;
"><a style="color:lightgray;text-decoration: none;" href="https://github.com/ideesculture/3dviewer" target="_blank"><img align="bottom" src="logo_ideesculture.svg" style="height:100%;margin-bottom:-4px;"/>3 D V I E W E R</a></div>
<main class="wrap">
<div class="dropzone">
<div class="placeholder">
<p></p>
</div>
<div class="upload-btn">
<input type="file" name="file-input[]" id="file-input" multiple="">
<label for="file-input">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"></path></svg>
<span></span>
</label>
</div>
</div>
<div class="spinner"></div>
</main>
<script type="text/x-handlebars-template" id="report-toggle-template">
<div class="report-toggle level-{{issues.maxSeverity}}">
<div class="report-toggle-text">
{{#if issues}}
{{#if issues.numErrors }}
{{issues.numErrors}} errors.
{{else if issues.numWarnings}}
{{issues.numWarnings}} warnings.
{{else if issues.numHints}}
{{issues.numHints}} hints.
{{else if issues.numInfos}}
{{issues.numInfos}} notes.
{{else}}
Model details
{{/if}}
{{else if reportError}}
Validation could not run: {{reportError}}.
{{else}}
Validation could not run.
{{/if}}
</div>
<div class="report-toggle-close" aria-label="Hide">×</div>
</div>
</script>
<script type="text/x-handlebars-template" id="report-template">
<!DOCTYPE html>
<title>glTF 2.0 validation report</title>
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400" rel="stylesheet">
<link rel="stylesheet" href="{{location.protocol}}//{{location.host}}/style.css">
<style>
body { overflow-y: auto; }
</style>
<div class="report">
<h1>Validation report</h1>
<ul>
<li><b>Format:</b> glTF {{info.version}}</li>
{{#if generator}}
<li>
<b>Generator:</b> {{generator.name}}
{{#if generator.docsURL}}(<a href="{{generator.docsURL}}" target="_blank">docs</a>){{/if}}
{{#if generator.bugsURL}}(<a href="{{generator.bugsURL}}" target="_blank">bugs</a>){{/if}}
</li>
{{else}}
<li><b>Generator:</b> {{info.generator}}</li>
{{/if}}
{{#if info.extras}}
{{#if info.extras.title}}<li><b>Title:</b> {{info.extras.title}}</li>{{/if}}
{{#if info.extras.author}}<li><b>Author:</b> {{{info.extras.author}}}</li>{{/if}}
{{#if info.extras.license}}<li><b>License:</b> {{{info.extras.license}}}</li>{{/if}}
{{#if info.extras.source}}<li><b>Source:</b> {{{info.extras.source}}}</li>{{/if}}
{{/if}}
<li>
<b>Stats:</b>
<ul>
<li>{{info.drawCallCount}} draw calls</li>
<li>{{info.animationCount}} animations</li>
<li>{{info.materialCount}} materials</li>
<li>{{info.totalVertexCount}} vertices</li>
<li>{{info.totalTriangleCount}} triangles</li>
</ul>
</li>
<li>
<b>Extensions:</b> {{#unless info.extensionsUsed}}None{{/unless}}
{{#if info.extensionsUsed}}
<ul>
{{#each info.extensionsUsed}}
<li>{{this}}</li>
{{/each}}
</ul>
<p><i>
NOTE: Extensions above are present in the model, but may or may not be recognized by this
viewer. Any "UNSUPPORTED_EXTENSION" warnings below refer only to extensions that could not
be scanned by the validation suite, and may still have rendered correctly. See:
<a href="https://github.com/donmccurdy/three-gltf-viewer/issues/122" target="_blank">three-gltf-viewer#122</a>
{{/if}}
</li>
</ul>
<hr/>
<p>
Report generated by
<a href="https://github.com/KhronosGroup/glTF-Validator/">KhronosGroup/glTF-Validator</a>
{{validatorVersion}}.
</p>
{{#if issues.numErrors}}
{{> issuesTable messages=errors color="#f44336" title="Error"}}
{{/if}}
{{#if issues.numWarnings}}
{{> issuesTable messages=warnings color="#f9a825" title="Warning"}}
{{/if}}
{{#if issues.numHints}}
{{> issuesTable messages=hints color="#8bc34a" title="Hint"}}
{{/if}}
{{#if issues.numInfos}}
{{> issuesTable messages=infos color="#2196f3" title="Info"}}
{{/if}}
</div>
</script>
<script type="text/x-handlebars-template" id="report-table-partial">
<table class="report-table">
<thead>
<tr style="background: {{color}};">
<th>{{title}}</th>
<th>Message</th>
<th>Pointer</th>
</tr>
</thead>
<tbody>
{{#each messages}}
<tr>
<td><code>{{code}}</code></td>
<td>{{message}}</td>
<td><code>{{pointer}}</code></td>
</tr>
{{/each}}
{{#unless issues.messages}}
<tr><td colspan="3">No issues found.</td></tr>
{{/unless}}
</tbody>
</table>
</script>
<style>
/* HIDE GUI */
.gui-wrap {
display: none !important;
}
</style>
</body>