-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
123 lines (117 loc) · 2.73 KB
/
index.js
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import { createRouter, createWebHashHistory } from 'vue-router'
import Index from '@/views/generated/Index.vue'
import Types from '@/views/generated/Types.vue'
import Relayers from '@/views/generated/Relayers.vue'
const GalleryPage = () => import('@/views/GalleryPage')
const VotingResultsPage = () => import('@/views/VotingResultsPage')
const NewCardPage = () => import('@/views/NewCardPage')
const AboutPage = () => import('@/views/AboutPage')
const NotFound = () => import('@/views/NotFound')
const RoadmapPage = () => import('@/views/RoadmapPage')
const LandingPage = () => import('@/views/LandingPage')
const ImprintPage = () => import('@/views/ImprintPage')
const TeamPage = () => import('@/views/TeamPage')
const HowToPlayPage = () => import('@/views/HowToPlayPage')
const VotingPage = () => import('@/views/VotingPage')
const CardView = () => import('@/views/CardViewPage')
const UserView = () => import('@/views/UserView')
const SteakDrop = () => import('@/views/SteakDropPage')
const routes = [
{
path: '/about',
name: 'About',
meta: { layout: "default" },
component: AboutPage
},
{
path: '/roadmap',
name: 'Roadmap',
meta: { layout: "default" },
component: RoadmapPage
},
{
path: '/steakdrop',
name: 'Steakdrop',
meta: { layout: "default" },
component: SteakDrop
},
{
path: '/gallery',
name: 'Gallery',
component: GalleryPage
},
{
path: '/votingresults',
name: 'VotingResults',
component: VotingResultsPage
},
{
path: '/newcard',
name: 'New Card',
component: NewCardPage,
meta: { layout: "default" },
},
{
path: '/',
name: 'Landing',
meta: { layout: "Landing" },
component: LandingPage,
},
{
path: '/howtoplay',
name: 'How To Play',
component: HowToPlayPage
},
{
path: '/team',
name: 'Team',
component: TeamPage
},
{
path: '/imprint',
name: 'Imprint',
component: ImprintPage
},
{
path: '/vote',
name: 'Vote',
component: VotingPage
},
{
path: '/cardview/:id',
name: 'CardView',
component: CardView
},
{
path: '/user/:id',
name: 'UserView',
component: UserView
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
component: NotFound
},
]
const oldroutes = [
{
path: '/',
component: Index,
},
{ path: '/types', component: Types },
{ path: '/relayers', component: Relayers },
]
const delay = (t) => new Promise((r) => setTimeout(r, t))
const router = createRouter({
history: createWebHashHistory(),
routes,
async scrollBehavior (to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
await delay(0)
return { top: 0, behavior: 'smooth'}
}
},
})
export default router