This repository has been archived by the owner on Nov 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
405 lines (348 loc) · 18.5 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="encoding" content="utf-8" charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Free online Number Type Converter for up to 128-bits and in-browser three.js based 3D model viewers: 3DM, 3DS, 3MF, AMF, ASSIMP, DAE, FBX, GCODE, GLTF, IFC, IGES, JSON, LDRAW, MMD, OBJ + MTL, PCD, PDB, PLY, PRWM, SPLAT, STEP, STL, VRML, VTK.">
<link rel="shortcut icon" href="./images/favicon.ico" type="image/x-icon">
<script async src="https://cdn.jsdelivr.net/npm/es-module-shims@1.8.3/dist/es-module-shims.min.js"></script>
<script type="importmap">
{
"imports": {
"@google/model-viewer": "https://esm.sh/@google/model-viewer"
}
}
</script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js" defer></script>
<style>
body, html {
position: relative;
display: block;
background-color: #10104b;
width: 100%;
min-height: 100vh;
border: none;
padding: 0;
margin: 0;
overflow-x: hidden;
}
button {
background-color: transparent;
border: 1px solid blue;
-webkit-border-radius: 3px;
border-radius: 3px;
margin: 2px 3px 2px 0;
font-size: 85%;
color: blue;
}
label {
margin: 2px 5px 2px 0;
}
img {
width: 230px;
height: 230px;
margin-top: 5px;
margin-left: 5px;
transition: 2s ease-in-out;
}
.rotateY {
-webkit-animation: rotationY 8s linear;
animation: rotationY 8s linear;
}
@-webkit-keyframes rotationY { from { -webkit-transform: rotateY( 0deg ); } to { -webkit-transform: rotateY( 360deg ); } }
@keyframes rotationY { from { transform: rotateY( 0deg ); } to { transform: rotateY( 360deg ); } }
.spinner {
position: absolute;
display: block;
background-color: transparent;
width: 240px;
height: 240px;
top: 50%;
left: 50%;
margin-top: -129px;
margin-left: -129px;
border: 6px solid #10108b;
-webkit-border-radius: 50%;
border-radius: 50%;
border-top-color: transparent;
border-bottom-color: transparent;
-webkit-animation: spin 8s ease-in-out;
animation: spin 8s ease-in-out;
}
@-webkit-keyframes spin { to { -webkit-transform: rotate( 360deg ); } }
@keyframes spin { to { transform: rotate( 360deg ); } }
.spinner:hover img { opacity: 0; }
div {
background-color: aliceblue;
width: 99%;
border: none;
-webkit-border-radius: 5px;
border-radius: 5px;
padding: 3px;
margin: 5px;
}
p {
font-size: 125%;
text-align: center;
color: blue;
border: 1px solid lightblue;
margin-bottom: 10px;
}
A {
color:blue;
text-decoration: none;
margin: 0 2px 0 2px;
padding: 0 2px 0 2px;
}
A:hover {
color:red;
text-decoration: none;
border: none;
}
.menubtn {
background-color: transparent;
color: blue;
padding: 1px;
font-size: 90%;
border: none;
}
.menubtn:after {
content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
margin: 0 0 0 4px;
}
.dropdown {
background-color: transparent;
display: inline-block;
position: relative;
margin-right: 3px;
font-size: 85%;
color: blue;
border: none;
padding: 1px;
}
.dropdown:after {
content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
margin: 0 0 0 4px;
}
.dropdown:hover {
color:red;
text-decoration: none;
border: none;
}
.dropdown-content {
background-color: whitesmoke;
position: absolute;
z-index: 10;
margin-top: 2px;
transform: translateX( -8px );
}
dark_blue { color: #03038f; }
.fixed-menu {
position: fixed;
z-index: 1;
top: 0px;
left: 0px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
padding: 2px;
width: 99.85%;
vertical-align: middle;
border: 1px solid navy;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: whitesmoke;
}
.model_viewer {
background-color: transparent;
float: inline-start;
display: none;
height: 100px;
width: 150px;
margin-left: 25px;
margin-top: 50px;
padding: 0;
}
hr.solid { border-top: 1px solid #bbb; }
</style>
<!-- Using Google model-viewer element: https://github.com/google/model-viewer -->
<title>GitHubDragonFly's Website</title>
</head>
<body onload="document_ready(); add_remove_class(); button_hover();" onresize="resize();">
<p class="fixed-menu" id="fm"><label title="Welcome, click for Intro Video" id="lbl_welcome" for="btn_intro" style="display: none;">🙂 W<dark_blue>e</dark_blue>l<dark_blue>c</dark_blue>o<dark_blue>m</dark_blue>e →</label>
<button id="btn_intro" title="Click for Intro Video" style="display: none; min-width: 50px;" onclick="show_hide_intro_video();">Intro</button>
<button id="btn_dg" class="dropdown" title="Repositories, Games, Converter and Texture Viewer" style="min-width: 100px; border: 1px solid blue; -webkit-border-radius: 3px; border-radius: 3px;" onclick="show_hide_dropdown_dg();">General
<div id="dg" class="dropdown-content" style="display: none;">
<a id="dg001" title="Repositories" href="https://github.com/GitHubDragonFly?tab=repositories" target="_blank">Repos</a>
<a id="dg002" title="nunuStudio Games and Experiences" href="./viewers/templates/nunuStudio Examples.html" target="_blank">Games</a>
<a id="dg003" title="Number Type Converter 128-bit" href="./viewers/templates/Number Conversion.html" target="_blank">Converter</a>
<hr class="solid" id="separator" tabindex="-1">
<a id="dg004" title="Celestial Bodies - Astronomically Inaccurate" href="./viewers/templates/Celestial Bodies.html" target="_blank">Celestial</a>
<a id="dg005" title="Simple automatic cube shading example" href="./viewers/templates/Cube Shading.html" target="_blank">Shading</a>
<a id="dg006" title="Texture Viewer" href="./viewers/templates/Texture Viewer.html" target="_blank">TexView</a>
<a id="dg007" title="Image to 3D Mesh Converter" href="./viewers/templates/IMG2MESH.html" target="_blank">IMG2MESH</a>
</div>
</button>
<button id="btn_mobile" title="Mobile Friendly Simple 3D Viewers" style="min-width: 100px;" onclick="switch_to_mobile();">Mobile 3D</button>
<button id="btn_dc" class="dropdown" title="3D Model Viewers - Each will open in a new tab" style="display: none; min-width: 260px; border: 1px solid blue; -webkit-border-radius: 3px; border-radius: 3px;" onclick="show_hide_dropdown_dc();">Desktop 3D Viewers
<div id="dc" class="dropdown-content" style="display: none;">
<a id="dc001" title="3DM (Rhino3D) Viewer" href="./viewers/templates/3DM Viewer.html" target="_blank">3DM</a>
<a id="dc002" title="3DS (3D Studio) Viewer" href="./viewers/templates/3DS Viewer.html" target="_blank">3DS</a>
<a id="dc003" title="3MF (3D Manufacturing Format) Viewer" href="./viewers/templates/3MF Viewer.html" target="_blank">3MF</a>
<a id="dc004" title="AMF (Additive Manufacturing Format) Viewer" href="./viewers/templates/AMF Viewer.html" target="_blank">AMF</a>
<a id="dc005" title="Collada DAE (Digital Asset Exchange) Viewer" href="./viewers/templates/DAE Viewer.html" target="_blank">DAE</a>
<a id="dc006" title="DST Embroidery Format Viewer" href="./viewers/templates/DST Viewer.html" target="_blank">DST</a>
<a id="dc007" title="FBX (Filmbox) Viewer" href="./viewers/templates/FBX Viewer.html" target="_blank">FBX</a>
<a id="dc008" title="GCode (3D-printing) Viewer" href="./viewers/templates/GCODE Viewer.html" target="_blank">GCode</a>
<a id="dc009" title="GLTF v2.0 (GL Transmission Format) Viewer" href="./viewers/templates/GLTF Viewer.html" target="_blank">GLTF</a>
<a id="dc010" title="GLTF v2.0 (GL Transmission Format) Viewer with pbrSpecularGlossiness support" href="./viewers/templates/GLTFS Viewer.html" target="_blank">GLTFS</a>
<a id="dc011" title="GLTF v2.0 (GL Transmission Format) Viewer using Google's model-viewer web component" href="./viewers/templates/GM Viewer.html" target="_blank">GM</a>
<a id="dc012" title="IFC (International Foundation Class) Viewer" href="./viewers/templates/IFC Viewer.html" target="_blank">IFC</a>
<a id="dc013" title="Three.js JSON Viewer" href="./viewers/templates/JSON Viewer.html" target="_blank">JSON</a>
<a id="dc014" title="LDraw (Lego 3D computer creations) Viewer" href="./viewers/templates/LDRAW Viewer.html" target="_blank">LDraw</a>
<a id="dc015" title="MMD (Miku Miku Dance) Viewer" href="./viewers/templates/MMD Viewer.html" target="_blank">MMD</a>
<a id="dc016" title="OBJ + MTL (Wavefront Technologies) Viewer" href="./viewers/templates/OBJ Viewer.html" target="_blank">OBJ</a>
<a id="dc017" title="PCD (Point Cloud Data) Viewer" href="./viewers/templates/PCD Viewer.html" target="_blank">PCD</a>
<a id="dc018" title="PDB (Protein Data Bank) Viewer" href="./viewers/templates/PDB Viewer.html" target="_blank">PDB</a>
<a id="dc019" title="PLY (Polygon) Viewer" href="./viewers/templates/PLY Viewer.html" target="_blank">PLY</a>
<a id="dc020" title="PRWM (Packed Raw WebGL Model) Viewer" href="./viewers/templates/PRWM Viewer.html" target="_blank">PRWM</a>
<a id="dc021" title="Splat (3D Gaussian Splatting) Viewer - also supports Luma Splats URLs" href="./viewers/templates/SPLAT Viewer.html" target="_blank">Splat</a>
<a id="dc022" title="STEP + IGES + BREP + BIM Viewer" href="./viewers/templates/STEP Viewer.html" target="_blank">STEP++</a>
<a id="dc023" title="STL (Stereolithography) Viewer" href="./viewers/templates/PLY Viewer.html" target="_blank">STL</a>
<a id="dc024" title="USDZ (Universal Scene Description) Viewer" href="./viewers/templates/USDZ Viewer.html" target="_blank">USDZ</a>
<a id="dc025" title="VRML (Virtual Reality Modeling Language) Viewer" href="./viewers/templates/VRML Viewer.html" target="_blank">VRML</a>
<a id="dc026" title="VTK (Visualization Toolkit) Viewer" href="./viewers/templates/VTK Viewer.html" target="_blank">VTK</a>
<a id="dc027" title="XYZ Viewer" href="./viewers/templates/PCD Viewer.html" target="_blank">XYZ</a>
<hr class="solid" id="separator" tabindex="-1">
<a id="dc028" title="Assimp Based Multi Format Viewer" href="./viewers/templates/ASSIMP Viewer.html" target="_blank">Assimp</a>
<a id="dc029" title="A-Frame Based Multi Format Viewer" href="./viewers/templates/A-FRAME Viewer.html" target="_blank">A-Frame</a>
<a id="dc030" title="AR / VR Multi Format Viewer" href="./viewers/templates/ARVR.html" target="_blank">AR-VR</a><br>
<a id="dc031" title="GLTF v1.0 (GL Transmission Format) Viewer" href="./viewers/templates/GLTF Legacy.html" target="_blank">GLTF Legacy</a>
<a id="dc032" title="Assimp & three.js JSON Legacy Viewer" href="./viewers/templates/JSON Legacy.html" target="_blank">JSON Legacy</a>
<hr class="solid" id="separator" tabindex="-1">
<label title="WebGPU" style="color: darkgoldenrod;">WebGPU: </label>
<a id="dc033" title="Experimental GLTF v2.0 Viewer with WebGPU" href="./viewers/templates/GLTF WebGPU.html" target="_blank">GLTF</a>
<a id="dc034" title="Experimental OBJ+MTL Viewer with WebGPU" href="./viewers/templates/OBJ WebGPU.html" target="_blank">OBJ</a>
<a id="dc035" title="Experimental PDB Viewer with WebGPU" href="./viewers/templates/PDB WebGPU.html" target="_blank">PDB</a>
</div>
</button>
</p>
<div id="div_mv"></div>
<br id="P1" /><br /><br />
<div id="div_video" style="display: none; text-align: center; background-color: transparent; width: 420px; height: 270px; margin: auto;">
<video id="video_element" width="420" controls muted>
Your browser does not support HTML video.
</video><br />
<p style="border: none; color: lightblue;">
Video created by the open source <a href="https://github.com/obsproject/obs-studio" target="_blank">OBS Studio</a>
</p>
</div>
<div id="div_spinner" class="spinner">
<img id="my_image" src="./images/DragonFly.png" alt="DragonFly">
</div>
<script>
var video_set = false, isMobile;
function resize() {
if (isMobile !== undefined && isMobile === false) {
if (window.innerWidth < 710) {
$('#lbl_welcome')[ 0 ].style.display = 'none';
if (window.innerWidth < 550) {
$('#btn_intro')[ 0 ].style.display = 'none';
if (document.getElementById('div_video').style.display === 'block') show_hide_intro_video();
} else {
if ($('#btn_intro')[ 0 ].style.display === 'none') $('#btn_intro')[ 0 ].style.display = '';
}
} else {
if ($('#lbl_welcome')[ 0 ].style.display === 'none') $('#lbl_welcome')[ 0 ].style.display = '';
}
}
}
function show_hide_dropdown_dg() {
($('#dg')[ 0 ].style.display === 'none') ? $('#dg').fadeIn() : $('#dg').fadeOut();
if ($('#dc')[ 0 ].style.display !== 'none') $('#dc').fadeOut();
}
function show_hide_dropdown_dc() {
($('#dc')[ 0 ].style.display === 'none') ? $('#dc').fadeIn() : $('#dc').fadeOut();
if ($('#dg')[ 0 ].style.display !== 'none') $('#dg').fadeOut();
}
</script>
<script>
async function show_model_viewer() {
const { ModelViewerElement } = await import( "@google/model-viewer" );
self.ModelViewerElement = ModelViewerElement || {};
const m_viewer = document.createElement('model-viewer');
m_viewer.setAttribute( 'id', 'mv' );
m_viewer.setAttribute( 'loading', 'eager' );
m_viewer.setAttribute( 'autoplay', 'true' );
m_viewer.setAttribute( 'auto-rotate', 'true' );
m_viewer.setAttribute( 'touch-action', 'none' );
m_viewer.setAttribute( 'class', 'model_viewer' );
m_viewer.setAttribute( 'camera-controls', 'true' );
m_viewer.setAttribute( 'zoom-sensitivity', '0.15' );
m_viewer.setAttribute( 'interpolation-decay', '300' );
m_viewer.setAttribute( 'auto-rotate-delay', '20000' );
m_viewer.setAttribute( 'min-field-of-view', '0deg' );
m_viewer.setAttribute( 'max-field-of-view', '110deg' );
m_viewer.setAttribute( 'rotation-per-second', '30.5deg' );
m_viewer.setAttribute( 'src', 'https://raw.githubusercontent.com/GitHubDragonFly/GitHubDragonFly.github.io/main/viewers/examples/legobrick.glb' );
document.getElementById('div_mv').appendChild( m_viewer );
document.getElementById('mv').style.display = 'block';
}
async function add_remove_class() {
let image = document.getElementById('my_image');
image.classList.add( 'rotateY' );
await new Promise( resolve => setTimeout( resolve, 8000 ) );
image.classList.remove( 'rotateY' );
}
function show_hide_intro_video() {
const video = document.getElementById('video_element');
if (video_set === false) {
const source = document.createElement('source');
source.setAttribute('src', 'https://github.com/user-attachments/assets/25436e28-3b4d-4165-85db-21e8033ef42a');
source.setAttribute('type', 'video/mp4');
video.appendChild( source );
video_set = true;
}
if (document.getElementById('div_video').style.display === 'none') {
document.getElementById('div_spinner').style.display = 'none';
document.getElementById('div_video').style.display = 'block';
} else {
video.pause();
video.currentTime = 0;
document.getElementById('div_video').style.display = 'none';
document.getElementById('div_spinner').style.display = 'block';
}
}
function switch_to_mobile() {
let link = document.createElement( 'a' );
link.style.display = 'none';
link.href = "./viewers/templates/Mobile/index.html";
link.click();
}
function button_hover() {
$('button').each( function() {
if (this.disabled === false) {
$(this).hover(
function() { $(this)[ 0 ].style.color = 'red'; },
function() {
$(this)[ 0 ].style.color = 'blue';
if ($('#dc')[ 0 ].style.display !== 'none') $('#dc').fadeOut();
if ($('#dg')[ 0 ].style.display !== 'none') $('#dg').fadeOut();
});
}
});
}
async function document_ready() {
isMobile = (/iPad|iPhone|iPod/.test( navigator.platform )) ||
(/Android|webOS|iPhone|iPad|iPod|CriOS|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent )) ||
(navigator.maxTouchPoints !== undefined && navigator.maxTouchPoints > 2 && /MacIntel/.test( navigator.platform ));
if (isMobile === false) {
$('#lbl_welcome')[ 0 ].style.display = '';
$('#btn_intro')[ 0 ].style.display = '';
$('#btn_dc')[ 0 ].style.display = '';
await new Promise( resolve => setTimeout( show_model_viewer, 15000 ) );
}
}
</script>
</body>
</html>