Browse Source

Keep levels.json customizability in the HTML file

Thomas Dy 4 years ago
parent
commit
77f55ecf0b
3 changed files with 3 additions and 2 deletions
  1. 1 1
      README.md
  2. 1 0
      src/index.html
  3. 1 1
      src/index.ts

+ 1 - 1
README.md

@@ -28,7 +28,7 @@ songs. Then simply serve it as a static site.
 
 ### Config
 
-The [config](dist/levels.json) is a simple JSON file with the following
+The [config](assets/levels.json) is a simple JSON file with the following
 properties:
 
 The following accept any CSS color

+ 1 - 0
src/index.html

@@ -113,6 +113,7 @@
         </template>
       </template>
     </div>
+    <script id="levels" type="text/plain">levels.json</script>
     <script type="module" src="index.js"></script>
   </body>
 </html>

+ 1 - 1
src/index.ts

@@ -2,5 +2,5 @@ import { MainController } from './game';
 
 new MainController(
   document.querySelector('#container')!,
-  'levels.json'
+  document.querySelector('#levels')?.textContent!
 ).start();