forked from slimshader/gltfview
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
177 lines (157 loc) · 7.37 KB
/
index.html
File metadata and controls
177 lines (157 loc) · 7.37 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
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
<!--
/* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title><model-viewer></title>
<meta charset="utf-8">
<meta name="description" content="Easily display interactive 3D models on the web and in AR">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="twitter:card" content="player"/>
<meta name="twitter:site" content="modelviewer"/>
<meta name="twitter:player:width" content="480"/>
<meta name="twitter:player:height" content="480"/>
<meta name="twitter:player" content="https://modelviewer.dev/examples/twitter/player.html?src=https://modelviewer.dev/shared-assets/models/NeilArmstrong.glb&poster=https://modelviewer.dev/shared-assets/models/NeilArmstrong.webp&alt=Neil%20Armstrong%27s%20Spacesuit%20from%20the%20Smithsonian%20Digitization%20Programs%20Office%20and%20National%20Air%20and%20Space%20Museum&environmentImage=https://modelviewer.dev/shared-assets/environments/moon_1k.hdr"/>
<meta property="og:title" content="3D model-viewer embed"/>
<meta property="og:description" content="Neil Armstrong's Spacesuit from the Smithsonian Digitization Programs Office and National Air and Space Museum"/>
<meta property="og:image" content="https://modelviewer.dev/shared-assets/models/NeilArmstrongTwitter.png"/>
<link type="text/css" href="styles/examples.css" rel="stylesheet" />
<link rel="shortcut icon" type="image/png" href="assets/favicon.png"/>
<script defer src="https://web3dsurvey.com/collector.js"></script>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-169901325-1', { 'storage': 'none' });
ga('set', 'referrer', document.referrer.split('?')[0]);
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<style>
.demo model-viewer {
background-color: #fff;
}
</style>
</head>
<body>
<div class="sample">
<div id="demo-container" class="demo"></div>
<div class="content">
<div class="wrapper">
<div class="heading">
<div class="lockup zero-interaction"><div class="icon-button icon-modelviewer-black"></div><h1><span class="attribute"><model-viewer></span></h1></div>
<h3 class="slogan" style="font-weight:400;">Easily display interactive 3D models on the web & in AR</h3>
</div>
<div id="section-quick-start">
<h3 class="grouping-title grouping-title-new quick-start">Quick Start</h3>
<div class="quick-start-example">
<example-snippet inert-script stamp-to="demo-container" highlight-as="html">
<template>
<!-- Import the component -->
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js"></script>
<!-- Use it like any other HTML element -->
<model-viewer alt="Neil Armstrong's Spacesuit from the Smithsonian Digitization Programs Office and National Air and Space Museum" src="ribbon2.glb" ar shadow-intensity="1" camera-controls touch-action="pan-y"></model-viewer>
</template>
</example-snippet>
</div>
</div>
<a href="https://bundlephobia.com/result?p=@google/model-viewer">
<img src="https://badgen.net/bundlephobia/minzip/@google/model-viewer" alt="Min Zip" />
</a>
<a href="https://github.com/google/model-viewer/releases">
<img src="https://img.shields.io/github/v/release/google/model-viewer" alt="Latest Release" />
</a>
<br />
<a href="https://twitter.com/intent/follow?screen_name=modelviewer">
<img src="https://img.shields.io/twitter/follow/modelviewer?style=social&logo=twitter" alt="follow on Twitter" />
</a>
<a href="https://github.com/google/model-viewer/discussions">
<img src="https://img.shields.io/github/stars/google/model-viewer.svg?style=social&label=Star&maxAge=2592000" alt="Github Discussions" />
</a>
<div id="section-editor">
<h3 class="grouping-title grouping-title-new border-bottom">Getting Started</h3>
<ol class="new-list-example">
<li>
<h4>
<a href="docs/faq.html">FAQ</a>: Introduction & much more
</h4>
</li>
<li>
<h4>
<a href="editor">Editor</a>: Test your 3D models and download a starter website
</h4>
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="footer">
<ul>
<li class="attribution">
<a href="https://3d.si.edu/object/3d/neil-armstrong-spacesuit:d8c63ba6-4ebc-11ea-b77f-2e728ce88125">Neil Armstrong Space Suit</a>
provided by the Smithsonian Digitization Programs Office and the National Air and Space Museum; <a href=https://www.si.edu/Termsofuse>Usage Conditions Apply</a>.
</li>
</ul>
<div style="margin-top:24px;" class="copyright">©Copyright 2018-2021 Google Inc. Licensed under the Apache License 2.0.</div>
<div id='footer-links'></div>
</div>
<script type="module" src="./examples/built/docs-and-examples.js">
</script>
<script type="module">
(() => { initFooterLinks();})();
</script>
<!-- Documentation-specific dependencies: -->
<script type="module"
src="examples/built/dependencies.js">
</script>
<!-- Loads <model-viewer> on modern browsers: -->
<script type="module"
src="model-viewer.min.js">
</script>
<script>
// Get the model-viewer element
// Function to get URL parameters
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
// Function to initialize the model viewer
function initializeModelViewer() {
// Get the model-viewer element
const modelViewer = document.querySelector('model-viewer');
if (modelViewer) {
// Get the 'src' parameter from the URL
const modelSrc = getUrlParameter('src');
// If a 'src' parameter is provided, update the model-viewer's src
if (modelSrc) {
modelViewer.src = modelSrc;
}
} else {
console.error('model-viewer element not found');
}
}
// Run the initialization function after the DOM is fully loaded
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeModelViewer);
} else {
initializeModelViewer();
}
</script>
</body>
</html>