Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/okikio/native. An initiative which aims to make it easy to create complex, light-weight, and perfor okikio.github.io/native
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152import { App, PJAX, TransitionManager, HistoryManager, PageManager } from "@okikio/native";import { animate } from "@okikio/animate";import { init, inFocus } from "./sidebar.mjs";const app = new App();const Fade = { name: "default", out({ from }) { let fromWrapper = from.wrapper; return animate({ target: fromWrapper, opacity: [1, 0], duration: 500 }); }, async in({ to }) { let toWrapper = to.wrapper; await animate({ target: toWrapper, opacity: [0, 1], duration: 500 }); }};app.set("HistoryManager", new HistoryManager()).set("PageManager", new PageManager()).set("TransitionManager", new TransitionManager([ [Fade.name, Fade]])).add(new PJAX());try { app.on({ HOVER() { console.log("Print a value on hover over link"); }, CLICK() { console.log("Print something when a link is clicked"); }, NAVIGATION_START() { console.log("Print before you start loading pages"); }, READY() { init(); inFocus(); }, CONTENT_REPLACED() { inFocus(); } }); app.on("resize", () => { console.log("App resizing"); }); app.boot();} catch (e) { console.warn(e);}