mirror of
https://github.com/JeremyLikness/vanillajs-deck
synced 2024-11-14 09:34:55 +00:00
25 lines
581 B
JavaScript
25 lines
581 B
JavaScript
import { getJson } from "./jsonLoader.js"
|
|
import { loadSlides } from "./slideLoader.js"
|
|
import { Navigator } from "./navigator.js"
|
|
|
|
const state = {
|
|
manifest: {}
|
|
};
|
|
|
|
const app = async () => {
|
|
|
|
state.deck = document.getElementById("main");
|
|
|
|
// load the manifest
|
|
state.manifest = await getJson("slides/manifest.json");
|
|
|
|
// load the slides
|
|
state.slides = await loadSlides(state.manifest.start);
|
|
|
|
// initialize the navigation
|
|
state.navigator = new Navigator(state.slides, state.deck);
|
|
};
|
|
|
|
document.addEventListener("DOMContentLoaded", app);
|
|
|