Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

Add 404 Page, Set Router to History Mode #16

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export default {
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
margin-top: 0px;
}
</style>
Binary file added src/assets/circuit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
146 changes: 146 additions & 0 deletions src/components/NotFound.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<template>
<div>
<v-toolbar color="#2196F3">
<v-toolbar-title align-center>Placeholder</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn flat to='/'>Home</v-btn>
</v-toolbar>
<v-parallax
:src="require('../assets/circuit.jpg')"
dark
alt = "circuit board image"
class="temp1"
>
<v-layout
align-center
column
justify-center
>
<h1 class="err404 display-4 font-weight-black">Error 404</h1>
<h4 class="sub404 display-3 font-weight-black">
The content you are looking for does not exist.
</h4>
</v-layout>
</v-parallax>
<v-layout justify-center row wrap>
<v-flex xs11 elevation-5>
<v-card>
<v-card-text style="text-decoration: underline;">
<div class="headline">
Perhaps what you're looking for is here:
</div>
</v-card-text>
</v-card>
</v-flex>
<v-flex xs5 ma-1 elevation-5>
<v-card>
<v-card-title primary-title>
<div class="title font-weight-bold">
Home Page
</div>
</v-card-title>
<v-card-actions>
<v-btn color="primary">Go</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<v-flex xs5 ma-1 elevation-5>
<v-card>
<v-card-title primary-title>
<div class="title font-weight-bold">
Events
</div>
</v-card-title>
<v-card-actions>
<v-btn color="primary">Go</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<v-flex xs5 ma-1 elevation-5>
<v-card>
<v-card-title primary-title>
<div class="title font-weight-bold">
Blog
</div>
</v-card-title>
<v-card-actions>
<v-btn color="primary">Go</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<v-flex xs5 ma-1 elevation-5>
<v-card>
<v-card-title primary-title>
<div class="title font-weight-bold">
About
</div>
</v-card-title>
<v-card-actions>
<v-btn color="primary">Go</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<v-flex xs11 elevation-5>
<v-card>
<v-card-text style="text-decoration: underline;">
<div class="headline">
Still don't see what you're looking for?
</div>
</v-card-text>
</v-card>
</v-flex>
<v-flex xs8 ma-1 elevation-5>
<v-card>
<v-card-actions>
<v-btn block color="error">Contact Us</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</div>
</template>

<script>
export default {
data() {
return {
windowWidth: {
x: 0,
},
};
},
mounted() {
this.onResize();
},
methods: {
onResize() {
this.windowWidth = { x: window.innerWidth };
},
},
};
</script>

<style scoped>
.temp1{
margin-bottom: 100px;
}
.err404{
padding-left: 20px;
padding-right: 20px;
/*font-size: 70pt;
font-weight: 1000;*/
color: #C70000;
background-color: hsla(0, 0%, 0%, 0.8);
border-radius: 10px;
box-shadow: 10px 10px 20px #000;
}
.sub404{
margin-top: 10px;
padding: 10px;
/*font-size: 30pt;
font-weight: 1000;*/
background-color: hsla(0, 0%, 0%, 0.8);
border-radius: 10px;
box-shadow: 10px 10px 20px #000;
}
</style>
11 changes: 11 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import Vue from 'vue';
import Router from 'vue-router';
import HelloWorld from '@/components/HelloWorld';
import NotFound from '@/components/NotFound';

Vue.use(Router);

export default new Router({
mode: 'history',
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld,
},
{
path: '/404',
name: 'NotFound',
component: NotFound,
},
{
path: '*',
redirect: '/404',
},
],
});