Loader: Inject assets CSS

This commit is contained in:
Bui 2019-02-06 18:27:31 +00:00
parent a921b38e3e
commit b3ed655e44
3 changed files with 11 additions and 3 deletions

View File

@ -37,6 +37,10 @@ var assets = {
"debug.css",
"songbg.css"
],
"assetsCss": [
"fonts/fonts.css",
"img/img.css"
],
"img": [
"title-screen.png",
"notes.png",

View File

@ -40,6 +40,12 @@ class Loader{
stylesheet.href = "/src/css/" + name + queryString
document.head.appendChild(stylesheet)
})
assets.assetsCss.forEach(name => {
var stylesheet = document.createElement("link")
stylesheet.rel = "stylesheet"
stylesheet.href = gameConfig.assets_baseurl + name + queryString
document.head.appendChild(stylesheet)
})
var checkStyles = () => {
if(document.styleSheets.length >= cssCount){
resolve()

View File

@ -8,9 +8,7 @@
<meta name="description" content="パソコンとスマホのブラウザ向けの太鼓の達人シミュレータ 🥁 Taiko no Tatsujin rhythm game simulator for desktop and mobile browsers">
<link rel="stylesheet" href="/src/css/loader.css?{{version.commit_short}}">
<link rel="stylesheet" href="{{config.assets_baseurl}}fonts/fonts.css?{{version.commit_short}}">
<link rel="stylesheet" href="{{config.assets_baseurl}}img/img.css?{{version.commit_short}}">
<script src="/src/js/assets.js?{{version.commit_short}}"></script>
<script src="/src/js/strings.js?{{version.commit_short}}"></script>
<script src="/src/js/pageevents.js?{{version.commit_short}}"></script>