From 7f5b057e8e7f001aac3e113c65b7387a3d57f09d Mon Sep 17 00:00:00 2001 From: s473561 Date: Sat, 10 Jun 2023 19:22:13 +0200 Subject: [PATCH] page about zodiac sign done, added buttons for man and woman info --- src/app/app-routing.module.ts | 11 ++++++++- src/app/app.component.html | 4 +++- src/app/app.module.ts | 4 ++-- .../horoscope-data-container.component.html | 3 ++- .../horoscope-data-container.component.ts | 5 ++++ src/app/horoscope/horoscope.component.html | 21 +++++++++-------- src/app/horoscope/horoscope.component.ts | 17 ++++++++++---- src/app/mock-login/mock-login.component.css | 0 src/app/mock-login/mock-login.component.html | 1 + .../mock-login/mock-login.component.spec.ts | 21 +++++++++++++++++ src/app/mock-login/mock-login.component.ts | 10 ++++++++ src/styles.css | 23 +++++++++++++++++++ 12 files changed, 101 insertions(+), 19 deletions(-) create mode 100644 src/app/mock-login/mock-login.component.css create mode 100644 src/app/mock-login/mock-login.component.html create mode 100644 src/app/mock-login/mock-login.component.spec.ts create mode 100644 src/app/mock-login/mock-login.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 0297262..eb9dd26 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,7 +1,16 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { HoroscopeDataContainerComponent } from './horoscope-data-container/horoscope-data-container.component'; +import {MockLoginComponent} from './mock-login/mock-login.component'; -const routes: Routes = []; +const routes: Routes = [ + { + path: 'horoscope', + component: HoroscopeDataContainerComponent + }, + { path: 'login', component: MockLoginComponent }, + { path: '', redirectTo: '/horoscope', pathMatch: 'full' }, + ]; @NgModule({ imports: [RouterModule.forRoot(routes)], diff --git a/src/app/app.component.html b/src/app/app.component.html index d2f025b..ef0914d 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -2,4 +2,6 @@ - \ No newline at end of file + + diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6e7cee8..5d78a59 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -// import { AppRoutingModule } from './app-routing.module'; +import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { HttpClientModule } from '@angular/common/http'; import { HoroscopeComponent } from './horoscope/horoscope.component'; @@ -18,7 +18,7 @@ import { HoroscopeDataContainerComponent } from './horoscope-data-container/horo ], imports: [ BrowserModule, - // AppRoutingModule, + AppRoutingModule, HttpClientModule, FormsModule, FontAwesomeModule diff --git a/src/app/horoscope-data-container/horoscope-data-container.component.html b/src/app/horoscope-data-container/horoscope-data-container.component.html index 4c5d96a..384772c 100644 --- a/src/app/horoscope-data-container/horoscope-data-container.component.html +++ b/src/app/horoscope-data-container/horoscope-data-container.component.html @@ -4,5 +4,6 @@ - + \ No newline at end of file diff --git a/src/app/horoscope-data-container/horoscope-data-container.component.ts b/src/app/horoscope-data-container/horoscope-data-container.component.ts index 54da112..e0e944b 100644 --- a/src/app/horoscope-data-container/horoscope-data-container.component.ts +++ b/src/app/horoscope-data-container/horoscope-data-container.component.ts @@ -16,6 +16,7 @@ export class HoroscopeDataContainerComponent implements OnInit { public sunSign: string = 'Libra' public horoscopeData1?: HoroscopeData; + public gender: string = 'woman'; constructor (private openHoroscopeService: OpenHoroscopeService) { @@ -41,4 +42,8 @@ export class HoroscopeDataContainerComponent implements OnInit { }); } + changeGender(newValue: string) { + this.gender = newValue; + } + } diff --git a/src/app/horoscope/horoscope.component.html b/src/app/horoscope/horoscope.component.html index e9aaf0f..a314a51 100644 --- a/src/app/horoscope/horoscope.component.html +++ b/src/app/horoscope/horoscope.component.html @@ -58,17 +58,20 @@
-
-

- {{ horoscopeData.about }} -

+
+ +
- Compatibility -
-
- {{ horoscopeData.compatibility }} +

+ Get to know yourself {{ gender }} +

+
+ {{ horoscopeData.woman }} +
+
+ {{ horoscopeData.man }} +
-
\ No newline at end of file diff --git a/src/app/horoscope/horoscope.component.ts b/src/app/horoscope/horoscope.component.ts index ea244d3..89956c3 100644 --- a/src/app/horoscope/horoscope.component.ts +++ b/src/app/horoscope/horoscope.component.ts @@ -15,21 +15,28 @@ export class HoroscopeComponent implements OnInit { faFire = faFire; faCalendar = faCalendar; - @Input() + public gender: string = 'woman' + @Input() public horoscopeData?: HoroscopeData; + @Output() public sunSign: string = 'Libra' - + newSignEvent = new EventEmitter(); constructor( ) { } - onSubmit() { + onSubmit() { + } + ngOnInit(): void { } - ngOnInit(): void { - } + + changeGender(value: string) { + this.gender = value; + this.newSignEvent.emit(this.gender) + } } diff --git a/src/app/mock-login/mock-login.component.css b/src/app/mock-login/mock-login.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/mock-login/mock-login.component.html b/src/app/mock-login/mock-login.component.html new file mode 100644 index 0000000..f89b731 --- /dev/null +++ b/src/app/mock-login/mock-login.component.html @@ -0,0 +1 @@ +

mock-login works!

diff --git a/src/app/mock-login/mock-login.component.spec.ts b/src/app/mock-login/mock-login.component.spec.ts new file mode 100644 index 0000000..26ee211 --- /dev/null +++ b/src/app/mock-login/mock-login.component.spec.ts @@ -0,0 +1,21 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MockLoginComponent } from './mock-login.component'; + +describe('MockLoginComponent', () => { + let component: MockLoginComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [MockLoginComponent] + }); + fixture = TestBed.createComponent(MockLoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/mock-login/mock-login.component.ts b/src/app/mock-login/mock-login.component.ts new file mode 100644 index 0000000..939ca30 --- /dev/null +++ b/src/app/mock-login/mock-login.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-mock-login', + templateUrl: './mock-login.component.html', + styleUrls: ['./mock-login.component.css'] +}) +export class MockLoginComponent { + +} diff --git a/src/styles.css b/src/styles.css index 8af12f0..f9b5176 100644 --- a/src/styles.css +++ b/src/styles.css @@ -174,4 +174,27 @@ body { .details-label { margin-top: 1em; color: var(--white) +} +.details-label p { + text-align: center; +} +.button-row { + display: flex; + flex-direction: row; + padding-top: 1em; + justify-content: center; + align-items: center; +} +.button { + border-radius: 20px; + padding: 0.8em; + background-color: var(--green-1); + color: black; + border: none; + color: white; + margin-right: 10%; +} + +.button #woman{ + background-color: pink; } \ No newline at end of file