-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.ts
51 lines (44 loc) · 1.22 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { PJAX, App, TransitionManager, Router, HistoryManager, PageManager } from "@okikio/native";
import { Fade } from "./transitions/Fade";
import { BigTransition } from "./transitions/BigTransition";
import { Slide, SlideLeft, SlideRight } from "./transitions/Slide";
import { Navbar } from "./services/Navbar";
import { stop, run } from "./modules/animate";
const router = new Router();
const pjax = new PJAX();
const navbar = new Navbar();
const app = new App({
// prefetchIgnore: ["/index(.html)?"],
// preventURLs: ["/other(.html)?"],
transitions: [
["default", Fade],
["BigTransition", BigTransition],
["Slide", Slide],
["SlideLeft", SlideLeft],
["SlideRight", SlideRight]
]
});
app
.set("HistoryManager", new HistoryManager())
.set("PageManager", new PageManager())
.set("TransitionManager", new TransitionManager())
.add(navbar)
.add(router)
.add(pjax);
router
.add({
path: {
from: "/animate(.html)?",
to: false,
},
method: stop
})
.add({
path: /\/animate(.html)?/,
method: run
});
try {
app.boot();
} catch (err) {
console.warn("[App] boot failed,", err);
}