Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Create header component
Browse files Browse the repository at this point in the history
* Move existing header code into own component.
* Change location of logo sources to assets/logos.
* Make background of header white to avoid render issues for poor mooc.house logo.
* Add visual cues for header
* Underline the currently selected data source(s).
* Add variables for piping selected data later.

See #4 and #5
  • Loading branch information
Florian committed Jul 2, 2017
1 parent 3f69633 commit e2aa79b
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@


<div style="height:100px; margin: 20px 0 50px 0;">
<img src="https://open.hpi.de/assets/logo_openhpi-155a11eefd46841c38fb009a2d9b84d28550a0c920fbf50b591b3aa1f7c0190c.png" style="display: block;
margin: 0 auto; width:350px;" />
</div>
<jenz-header></jenz-header>

<world-map></world-map>
<div class="container">
Expand Down
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { CoursesComponent } from './courses/courses.component';

import { CourseService } from './courses/course.service';
import { ReviewCardComponent } from './review-card/review-card.component';
import { HeaderComponent } from './header/header.component';

@NgModule({
declarations: [
Expand All @@ -30,7 +31,8 @@ import { ReviewCardComponent } from './review-card/review-card.component';
WorldMapComponent,
StatisticsComponent,
CoursesComponent,
ReviewCardComponent
ReviewCardComponent,
HeaderComponent
],
imports: [
BrowserModule,
Expand Down
11 changes: 11 additions & 0 deletions src/app/header/header.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
img {
margin-right: 3rem;
height: 100px;
cursor: pointer;
}
.section {
background-color: white;
}
.selected {
border-bottom: 1rem solid #67DE91;
}
18 changes: 18 additions & 0 deletions src/app/header/header.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="section center-align">
<!-- DISCLAIMER -->
<!-- This code is super hacky and ugly,
and I really wish that we find something
prettier and more sophisticated. -->
<img [class.selected]="openhpi"
(click)="openhpi = !openhpi"
src="../assets/logos/OpenHPI-logo.png" />
<img [class.selected]="opensap"
(click)="opensap = !opensap"
src="../assets/logos/OpenSAP-logo.png" />
<img [class.selected]="moochouse"
(click)="moochouse = !moochouse"
src="../assets/logos/mooc-house-logo.png" />
<img [class.selected]="openwho"
(click)="openwho = !openwho"
src="../assets/logos/OpenWHO-logo.png" />
</div>
25 changes: 25 additions & 0 deletions src/app/header/header.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { HeaderComponent } from './header.component';

describe('HeaderComponent', () => {
let component: HeaderComponent;
let fixture: ComponentFixture<HeaderComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HeaderComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(HeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should be created', () => {
expect(component).toBeTruthy();
});
});
21 changes: 21 additions & 0 deletions src/app/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Component } from '@angular/core';

@Component({
selector: 'jenz-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent {
openhpi: boolean;
opensap: boolean;
moochouse: boolean;
openwho: boolean;

constructor() {
this.openhpi = true;
this.opensap = true;
this.moochouse = false;
this.openwho = false;
}

}
Binary file removed src/app/img/OpenHPI-logo.png
Binary file not shown.
Binary file added src/assets/logos/OpenHPI-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/logos/OpenSAP-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/logos/OpenWHO-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/logos/mooc-house-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e2aa79b

Please sign in to comment.