91 lines
2.6 KiB
HTML
91 lines
2.6 KiB
HTML
<!--
|
|
/* @license
|
|
* Copyright 2021 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><code><model-viewer></code> Player</title>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
|
|
<meta name="color-scheme" content="dark light">
|
|
|
|
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
|
|
<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>
|
|
html {
|
|
height: 100%;
|
|
}
|
|
|
|
body {
|
|
height: 100%;
|
|
margin: 0;
|
|
}
|
|
|
|
model-viewer {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
model-viewer::part(default-progress-bar) {
|
|
background-color: rgba(127, 127, 127, 0.8);
|
|
}
|
|
|
|
/* This keeps child nodes hidden while the element loads */
|
|
:not(:defined) {
|
|
display: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<model-viewer
|
|
id="mv"
|
|
shadow-intensity="1"
|
|
autoplay
|
|
|
|
camera-controls
|
|
auto-rotate
|
|
interaction-prompt-threshold="1500"
|
|
>
|
|
|
|
<script type="module">
|
|
const modelViewer = document.querySelector('#mv');
|
|
const queryParams = window.location.search.substring(1).split('&');
|
|
for (const param of queryParams) {
|
|
const keyVal = param.split('=');
|
|
const key = keyVal[0];
|
|
const val = decodeURIComponent(keyVal[1].replace(/\+/g, ' '));
|
|
if (key == 'style') {
|
|
modelViewer.style.cssText = val;
|
|
} else {
|
|
const num = Number(val);
|
|
modelViewer[key] = isFinite(num) ? num : val;
|
|
}
|
|
}
|
|
// Work-around for a bug
|
|
modelViewer.ar = true;
|
|
</script>
|
|
</body> |