2021-04-07 11:45:40 +00:00
|
|
|
import { createRouter, createWebHistory } from "vue-router";
|
2020-12-09 13:33:29 +00:00
|
|
|
|
2021-04-07 11:45:40 +00:00
|
|
|
const routes = [
|
|
|
|
{
|
|
|
|
path: "/",
|
2022-07-20 15:52:25 +00:00
|
|
|
name: "Home",
|
|
|
|
component: () => import("../components/TrendingPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/trending",
|
2021-04-07 11:45:40 +00:00
|
|
|
name: "Trending",
|
|
|
|
component: () => import("../components/TrendingPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/preferences",
|
|
|
|
name: "Preferences",
|
2022-01-13 05:12:06 +00:00
|
|
|
component: () => import("../components/PreferencesPage.vue"),
|
2021-04-07 11:45:40 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/results",
|
|
|
|
name: "SearchResults",
|
|
|
|
component: () => import("../components/SearchResults.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/playlist",
|
|
|
|
name: "Playlist",
|
2022-01-13 05:12:06 +00:00
|
|
|
component: () => import("../components/PlaylistPage.vue"),
|
2021-04-07 11:45:40 +00:00
|
|
|
},
|
2021-06-26 10:19:10 +00:00
|
|
|
{
|
2023-03-13 10:33:10 +00:00
|
|
|
path: "/:path(v|w|embed|live|shorts|watch)/:v?",
|
2021-07-19 21:25:43 +00:00
|
|
|
name: "WatchVideo",
|
2021-06-26 10:19:10 +00:00
|
|
|
component: () => import("../components/WatchVideo.vue"),
|
|
|
|
},
|
2023-10-14 11:48:23 +00:00
|
|
|
{
|
|
|
|
path: "/watch_videos",
|
|
|
|
name: "WatchVideos",
|
|
|
|
component: () => import("../components/WatchVideo.vue"),
|
|
|
|
},
|
2022-02-10 15:03:33 +00:00
|
|
|
{
|
|
|
|
path: "/clip/:clipId",
|
|
|
|
name: "Clips",
|
|
|
|
component: () => import("../components/ClipsPage.vue"),
|
|
|
|
},
|
2021-06-26 10:19:10 +00:00
|
|
|
{
|
|
|
|
path: "/:path(channel|user|c)/:channelId/:videos?",
|
2021-07-19 21:25:43 +00:00
|
|
|
name: "Channel",
|
2022-01-13 05:12:06 +00:00
|
|
|
component: () => import("../components/ChannelPage.vue"),
|
2021-06-26 10:19:10 +00:00
|
|
|
},
|
2023-03-11 18:44:07 +00:00
|
|
|
{
|
|
|
|
path: "/@:channelId",
|
|
|
|
name: "Channel handle",
|
|
|
|
component: () => import("../components/ChannelPage.vue"),
|
|
|
|
},
|
2021-07-16 22:56:41 +00:00
|
|
|
{
|
|
|
|
path: "/login",
|
|
|
|
name: "Login",
|
|
|
|
component: () => import("../components/LoginPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/register",
|
|
|
|
name: "Register",
|
|
|
|
component: () => import("../components/RegisterPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/feed",
|
|
|
|
name: "Feed",
|
|
|
|
component: () => import("../components/FeedPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/import",
|
|
|
|
name: "Import",
|
|
|
|
component: () => import("../components/ImportPage.vue"),
|
|
|
|
},
|
2021-07-19 21:25:43 +00:00
|
|
|
{
|
|
|
|
path: "/:videoId([a-zA-Z0-9_-]{11})",
|
|
|
|
component: () => import("../components/VideoRedirect.vue"),
|
|
|
|
},
|
2021-07-22 20:05:48 +00:00
|
|
|
{
|
|
|
|
path: "/subscriptions",
|
|
|
|
name: "Subscriptions",
|
|
|
|
component: () => import("../components/SubscriptionsPage.vue"),
|
|
|
|
},
|
2021-08-22 10:27:09 +00:00
|
|
|
{
|
|
|
|
path: "/history",
|
|
|
|
name: "Watch History",
|
|
|
|
component: () => import("../components/HistoryPage.vue"),
|
|
|
|
},
|
2022-04-07 02:33:25 +00:00
|
|
|
{
|
|
|
|
path: "/playlists",
|
|
|
|
name: "Playlists",
|
|
|
|
component: () => import("../components/PlaylistsPage.vue"),
|
|
|
|
},
|
2022-08-22 11:51:44 +00:00
|
|
|
{
|
|
|
|
path: "/:pathMatch(.*)*",
|
|
|
|
name: "Page Not Found",
|
|
|
|
component: () => import("../components/PageNotFound.vue"),
|
|
|
|
},
|
2021-04-07 11:45:40 +00:00
|
|
|
];
|
2020-12-09 13:33:29 +00:00
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
history: createWebHistory(),
|
2021-04-07 11:45:40 +00:00
|
|
|
routes,
|
2022-02-11 02:57:11 +00:00
|
|
|
scrollBehavior: function (_to, _from, savedPosition) {
|
|
|
|
return savedPosition ? savedPosition : window.scrollTo(0, 0);
|
|
|
|
},
|
2021-04-07 11:45:40 +00:00
|
|
|
});
|
2020-12-09 13:33:29 +00:00
|
|
|
|
2021-04-07 11:45:40 +00:00
|
|
|
export default router;
|