-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(static): use CDN for spine-player.js
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
Showing
3 changed files
with
10 additions
and
14,492 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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", | ||
|
@@ -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;"> | ||
|
Oops, something went wrong.