feat: add not found component (#327)

Fixes #110
This commit is contained in:
Jonathan Xu
2018-11-18 14:46:43 +05:30
committed by Abhay Chawla
parent dffce8a5e0
commit 2feee9d8a2
9 changed files with 197 additions and 51 deletions
-48
View File
@@ -1,48 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>MifosX</title>
<base href="/"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" type="image/x-icon" href="favicon.ico"/>
<link rel="icon" type="image/png" href="assets/images/MifosX_logo.png" sizes="182x184">
<link rel="apple-touch-icon" type="image/png" href="apple-touch-icon.png" sizes="182x184"/>
<link rel="manifest" href="manifest.json"/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Mono:300" rel="stylesheet">
</head>
<body>
<!--[if lt IE 10]>
<p>
You are using an <strong>outdated</strong> browser.
Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.
</p>
<![endif]-->
<noscript>
<p>
This page requires JavaScript to work properly. Please enable JavaScript in your browser.
</p>
</noscript>
<script>
// This hides the address bar on mobile browsers
// https://developers.google.com/web/fundamentals/native-hardware/fullscreen/
window.addEventListener('load',function() { window.scrollTo(0, 1); });
</script>
<mifosx-web-app>
<div class="loader-wrapper">
<div class="bottom triangle"></div>
<div class="top triangle"></div>
<div class="left triangle"></div>
<div class="right triangle"></div>
</div>
</mifosx-web-app>
</body>
</html>
+4 -2
View File
@@ -2,14 +2,16 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
// Not Found Component
import {NotFoundComponent} from './not-found/not-found.component';
/**
* Fallback to this route when no prior route is matched.
*/
const routes: Routes = [
{
path: '**',
redirectTo: '',
pathMatch: 'full'
component: NotFoundComponent
}
];
+4 -1
View File
@@ -17,6 +17,9 @@ import { environment } from 'environments/environment';
/** Main Component */
import { WebAppComponent } from './web-app.component';
/** Not Found Component */
import { NotFoundComponent } from './not-found/not-found.component';
/** Custom Modules */
import { CoreModule } from './core/core.module';
import { HomeModule } from './home/home.module';
@@ -59,7 +62,7 @@ import { AppRoutingModule } from './app-routing.module';
SystemModule,
AppRoutingModule
],
declarations: [WebAppComponent],
declarations: [WebAppComponent, NotFoundComponent],
providers: [],
bootstrap: [WebAppComponent]
})
@@ -0,0 +1,5 @@
<div id="particles-js"></div>
<div class="text">
<h1 id="title">404</h1>
<p id="subtitle">Something went wrong.</p>
</div>
@@ -0,0 +1,28 @@
#particles-js {
position: absolute;
width: 100%;
height: 100%;
background: cornflowerblue;
}
.text {
position: absolute;
top: 50%;
right: 50%;
transform: translate(50%,-50%);
max-width: 90%;
padding: 2em 3em;
color: white;
font-family: 'Raleway', sans-serif;
display: flex;
flex-direction: column;
align-items: center;
}
#title {
font-size: 120pt;
}
#subtitle {
font-size: 12pt;
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NotFoundComponent } from './not-found.component';
describe('NotFoundComponent', () => {
let component: NotFoundComponent;
let fixture: ComponentFixture<NotFoundComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NotFoundComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NotFoundComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
+17
View File
@@ -0,0 +1,17 @@
import { Component, OnInit } from '@angular/core';
declare var particlesJS: any;
@Component({
selector: 'mifosx-not-found',
templateUrl: './not-found.component.html',
styleUrls: ['./not-found.component.scss']
})
export class NotFoundComponent implements OnInit {
constructor() { }
ngOnInit() {
particlesJS.load('particles-js', '/assets/particles.json');
}
}
+110
View File
@@ -0,0 +1,110 @@
{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#ffffff"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 3,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#ffffff",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}
+4
View File
@@ -15,6 +15,7 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Mono:300" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
</head>
<body>
<!--[if lt IE 10]>
@@ -44,5 +45,8 @@
<div class="right triangle"></div>
</div>
</mifosx-web-app>
<!-- ParticlesJS -->
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
</body>
</html>