import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home
  },
  {
    path: "/about",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/About.vue")
  },
  {
    path: "/login",
    name: "Login",
    component: () =>
      import(/* webpackChunkName: "login" */ "../components/LoginFull.vue")
  },
  {
    path: "/hello",
    name: "Hello",
    component: () =>
      import(/* webpackChunkName: "hello" */ "../components/HelloWorld.vue")
  },
  {
    path: "/triangle",
    name: "Triangle",
    component: () =>
      import(/* webpackChunkName: "triangle" */ "../views/Triangle.vue")
  },
  {
    path: "/backgrounds",
    name: "Backgrounds",
    component: () =>
      import(/* webpackChunkName: "backgrounds" */ "../views/Backgrounds.vue")
  },
  {
    path: "/playground",
    name: "Playground",
    component: () =>
      import(/* webpackChunkName: "playground" */ "../views/Playground.vue")
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
