init
This commit is contained in:
31
src/app/menu/menu.component.css
Normal file
31
src/app/menu/menu.component.css
Normal file
@@ -0,0 +1,31 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: 10px 20px;
|
||||
background-color: #ff561e;
|
||||
color: white;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.left .name, .right .score {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.menu {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
8
src/app/menu/menu.component.html
Normal file
8
src/app/menu/menu.component.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="menu">
|
||||
<div class="left">
|
||||
<span class="name">Naam: {{ getName() }}</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span class="score">Score: {{ getScore() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
23
src/app/menu/menu.component.spec.ts
Normal file
23
src/app/menu/menu.component.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MenuComponent } from './menu.component';
|
||||
|
||||
describe('MenuComponent', () => {
|
||||
let component: MenuComponent;
|
||||
let fixture: ComponentFixture<MenuComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [MenuComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(MenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
18
src/app/menu/menu.component.ts
Normal file
18
src/app/menu/menu.component.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
imports: [],
|
||||
templateUrl: './menu.component.html',
|
||||
styleUrl: './menu.component.css'
|
||||
})
|
||||
export class MenuComponent {
|
||||
|
||||
getName() {
|
||||
return localStorage.getItem('name')
|
||||
}
|
||||
|
||||
getScore() {
|
||||
return localStorage.getItem('score');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user