Feat: Web loader
This commit is contained in:
26
Loader/scripts/main.js
Normal file
26
Loader/scripts/main.js
Normal file
@@ -0,0 +1,26 @@
|
||||
// Path: Loader/scripts/main.js
|
||||
|
||||
import { setIntentPreview, setStatus } from "./dom.js";
|
||||
import { scheduleHandoff } from "./handoff.js";
|
||||
import { resolveHandoffTarget, resolveIntent } from "./intent.js";
|
||||
import { markLoaderSeen, persistLoaderState } from "./storage.js";
|
||||
|
||||
const bootLoader = () => {
|
||||
const intent = resolveIntent();
|
||||
const handoffTarget = resolveHandoffTarget(intent);
|
||||
|
||||
setStatus("Capturing route intent");
|
||||
setIntentPreview(intent);
|
||||
persistLoaderState(intent);
|
||||
|
||||
window.setTimeout(() => {
|
||||
setStatus("Preparing handoff");
|
||||
}, 180);
|
||||
|
||||
scheduleHandoff(handoffTarget, () => {
|
||||
setStatus("Handing off to application");
|
||||
markLoaderSeen();
|
||||
});
|
||||
};
|
||||
|
||||
bootLoader();
|
||||
Reference in New Issue
Block a user