Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari lottie #4113

Merged
merged 3 commits into from
Feb 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions packages/modelviewer.dev/examples/scenegraph/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
<link type="text/css" href="../../styles/docs.css" rel="stylesheet" />
<link rel="shortcut icon" type="image/png" href="../../assets/favicon.png"/>

<script type="importmap">
<script async src="https://ga.jspm.io/npm:es-module-shims@1.6.3/dist/es-module-shims.js"></script>

<script type="importmap-shim">
{
"imports": {
"three": "../../node_modules/@google/model-viewer/dist/model-viewer.js"
Expand Down Expand Up @@ -500,6 +502,22 @@ <h2 class="demo-title">Create animated textures</h2>
}
&lt;/script&gt;
</code></pre>
<p>Unfortunately, Safari does not yet support import maps, so to get
this to work universally, you will need the following code
instead:</p>
<pre><code>
&lt;script async src="https://ga.jspm.io/npm:es-module-shims@1.6.3/dist/es-module-shims.js"&gt;&lt;/script&gt;

&lt;script type="importmap-shim"&gt;
{
"imports": {
"three": "path/to/your/model-viewer.min.js"
}
}
&lt;/script&gt;

&lt;script type="module-shim" src="path/to/your/model-viewer.min.js"&gt;&lt;/script&gt;
</code></pre>
</div>
<example-snippet stamp-to="animatedTexturesExample" highlight-as="html">
<template>
Expand Down Expand Up @@ -836,7 +854,7 @@ <h2 class="demo-title">Exporter</h2>
</script>

<!-- Loads <model-viewer> on modern browsers: -->
<script type="module"
<script type="module-shim"
src="../../node_modules/@google/model-viewer/dist/model-viewer.js">
</script>
</body>
Expand Down