Skip to content

Commit

Permalink
fix(static): use CDN for spine-player.js
Browse files Browse the repository at this point in the history
Correctly reference spine-player.js from CDN and create a fallback if
the user is hosting zion without having connection to the internet.
  • Loading branch information
relu91 committed Sep 21, 2023
1 parent 79d89ea commit 95ba575
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14,492 deletions.
Binary file added static/assets/zionLogo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<link rel="stylesheet" href="css/spine-player.css">

<link rel="icon" href="images/favicon.svg" type="image/svg+xml" sizes="any">
<script src="js/spine-player.js"></script>
<script src="https://unpkg.com/@esotericsoftware/[email protected]/dist/iife/spine-player.js"></script>
<style>
.icon {
width: 2.5em;
Expand All @@ -33,6 +33,13 @@
</script>
<script defer>
document.addEventListener('DOMContentLoaded', function (event) {
if(typeof spine === "undefined"){
document.getElementById('logo').remove();
document.getElementById('placeholder').style.display = 'block'
return;
}

document.getElementById('placeholder').style.display = 'none'
new spine.SpinePlayer("logo", {
// Relative URLs
jsonUrl: "./assets/skeleton.json",
Expand Down Expand Up @@ -67,7 +74,8 @@
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<div class="container">
<div class="row">
<div class="eight offset-by-two columns " id="logo" style="margin-top: 15%; aspect-ratio: 16 / 9;"></div>
<div class="eight offset-by-two columns" id="logo" style="margin-top: 15%; aspect-ratio: 16 / 9;"></div>
<img class="eight offset-by-two columns" id="placeholder" style="margin-top: 15%;" src="./assets/zionLogo.gif" hidden loading="lazy"/>
</div>
<div class="row">
<div class="four offset-by-four columns " style="text-align: center;">
Expand Down
Loading

0 comments on commit 95ba575

Please sign in to comment.