add frontend angular
This commit is contained in:
parent
f34a5f0a83
commit
070e8435d8
36 changed files with 10209 additions and 6 deletions
12
frontend/src/app/app.config.ts
Normal file
12
frontend/src/app/app.config.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
import { routes } from './app.routes';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideBrowserGlobalErrorListeners(),
|
||||
provideZoneChangeDetection({ eventCoalescing: true }),
|
||||
provideRouter(routes)
|
||||
]
|
||||
};
|
25
frontend/src/app/app.html
Normal file
25
frontend/src/app/app.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * Delete the template below * * * * * * * * * -->
|
||||
<!-- * * * * * * * to get started with your project! * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<main class="main">
|
||||
<div class="content">
|
||||
|
||||
<header>
|
||||
<h1>OEDB</h1>
|
||||
<button class="login">login OSM</button>
|
||||
</header>
|
||||
<main>
|
||||
<router-outlet/>
|
||||
</main>
|
||||
</div>
|
||||
</main>
|
9
frontend/src/app/app.routes.ts
Normal file
9
frontend/src/app/app.routes.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { Routes } from '@angular/router';
|
||||
import {Home} from './pages/home/home';
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path : '',
|
||||
component: Home
|
||||
}
|
||||
];
|
3
frontend/src/app/app.scss
Normal file
3
frontend/src/app/app.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
html{
|
||||
font-family: "Calibri", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
23
frontend/src/app/app.spec.ts
Normal file
23
frontend/src/app/app.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
import { App } from './app';
|
||||
|
||||
describe('App', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [App],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
it('should create the app', () => {
|
||||
const fixture = TestBed.createComponent(App);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render title', () => {
|
||||
const fixture = TestBed.createComponent(App);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, frontend');
|
||||
});
|
||||
});
|
12
frontend/src/app/app.ts
Normal file
12
frontend/src/app/app.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { Component, signal } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.scss'
|
||||
})
|
||||
export class App {
|
||||
protected readonly title = signal('frontend');
|
||||
}
|
14
frontend/src/app/pages/home/home.html
Normal file
14
frontend/src/app/pages/home/home.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<p>home works!</p>
|
||||
<div class="aside">
|
||||
OpenEventDatabase
|
||||
<a href="/demo/stats">stats</a>
|
||||
<a href="https://source.cipherbliss.com/tykayn/oedb-backend">sources</a>
|
||||
</div>
|
||||
<div class="main">
|
||||
main part
|
||||
<br>
|
||||
<div id="map">
|
||||
|
||||
(map)
|
||||
</div>
|
||||
</div>
|
28
frontend/src/app/pages/home/home.scss
Normal file
28
frontend/src/app/pages/home/home.scss
Normal file
|
@ -0,0 +1,28 @@
|
|||
:host{
|
||||
header{
|
||||
background: #00acc1;
|
||||
position: fixed;
|
||||
top: 0 ;
|
||||
width: 100vw;
|
||||
min-height: 1rem;
|
||||
}
|
||||
main{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: start;
|
||||
align-content: center;
|
||||
}
|
||||
.aside{
|
||||
background: #fff8f8;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||
width : 0;
|
||||
&.expanded{
|
||||
width: 300px;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
#map{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
}
|
23
frontend/src/app/pages/home/home.spec.ts
Normal file
23
frontend/src/app/pages/home/home.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Home } from './home';
|
||||
|
||||
describe('Home', () => {
|
||||
let component: Home;
|
||||
let fixture: ComponentFixture<Home>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [Home]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(Home);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
11
frontend/src/app/pages/home/home.ts
Normal file
11
frontend/src/app/pages/home/home.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
imports: [],
|
||||
templateUrl: './home.html',
|
||||
styleUrl: './home.scss'
|
||||
})
|
||||
export class Home {
|
||||
|
||||
}
|
1
frontend/src/app/pages/home/menu/menu.html
Normal file
1
frontend/src/app/pages/home/menu/menu.html
Normal file
|
@ -0,0 +1 @@
|
|||
<p>menu works!</p>
|
0
frontend/src/app/pages/home/menu/menu.scss
Normal file
0
frontend/src/app/pages/home/menu/menu.scss
Normal file
23
frontend/src/app/pages/home/menu/menu.spec.ts
Normal file
23
frontend/src/app/pages/home/menu/menu.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Menu } from './menu';
|
||||
|
||||
describe('Menu', () => {
|
||||
let component: Menu;
|
||||
let fixture: ComponentFixture<Menu>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [Menu]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(Menu);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
11
frontend/src/app/pages/home/menu/menu.ts
Normal file
11
frontend/src/app/pages/home/menu/menu.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
imports: [],
|
||||
templateUrl: './menu.html',
|
||||
styleUrl: './menu.scss'
|
||||
})
|
||||
export class Menu {
|
||||
|
||||
}
|
13
frontend/src/index.html
Normal file
13
frontend/src/index.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Frontend</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
</html>
|
6
frontend/src/main.ts
Normal file
6
frontend/src/main.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { appConfig } from './app/app.config';
|
||||
import { App } from './app/app';
|
||||
|
||||
bootstrapApplication(App, appConfig)
|
||||
.catch((err) => console.error(err));
|
1
frontend/src/styles.scss
Normal file
1
frontend/src/styles.scss
Normal file
|
@ -0,0 +1 @@
|
|||
/* You can add global styles to this file, and also import other style files */
|
Loading…
Add table
Add a link
Reference in a new issue