page about zodiac sign done, added buttons for man and woman info
This commit is contained in:
parent
362c6a2a06
commit
7f5b057e8e
@ -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)],
|
||||
|
@ -2,4 +2,6 @@
|
||||
|
||||
<!-- <router-outlet></router-outlet> -->
|
||||
<!-- <app-horoscope></app-horoscope> -->
|
||||
<app-horoscope-data-container></app-horoscope-data-container>
|
||||
<!-- <app-horoscope-data-container></app-horoscope-data-container>
|
||||
-->
|
||||
<router-outlet></router-outlet>
|
||||
|
@ -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
|
||||
|
@ -4,5 +4,6 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<app-horoscope [horoscopeData]="horoscopeData1" >
|
||||
<app-horoscope [horoscopeData]="horoscopeData1" (newSignEvent) = "changeGender"
|
||||
>
|
||||
</app-horoscope>
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,17 +58,20 @@
|
||||
|
||||
|
||||
<div class="second-column">
|
||||
<div class="details-block">
|
||||
<p class="text-center">
|
||||
{{ horoscopeData.about }}
|
||||
</p>
|
||||
<div class="button-row">
|
||||
<button class="button" (click)="changeGender('woman')" [style.background-color]=" gender == 'woman'? '#9c6464 ': '#728c5d' ">Woman</button>
|
||||
<button class="button" (click)="changeGender('man')" [style.background-color]=" gender == 'man'? '#D3774b': '#728c5d' ">Man</button>
|
||||
</div>
|
||||
<div class="details-label">
|
||||
Compatibility
|
||||
</div>
|
||||
<div class="details-block">
|
||||
{{ horoscopeData.compatibility }}
|
||||
<p>
|
||||
Get to know yourself {{ gender }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="details-block" *ngIf="gender === 'woman'">
|
||||
{{ horoscopeData.woman }}
|
||||
</div>
|
||||
<div class="details-block" *ngIf="gender === 'man'">
|
||||
{{ horoscopeData.man }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -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<string>();
|
||||
|
||||
constructor(
|
||||
) { }
|
||||
|
||||
onSubmit() {
|
||||
onSubmit() {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
changeGender(value: string) {
|
||||
this.gender = value;
|
||||
this.newSignEvent.emit(this.gender)
|
||||
}
|
||||
|
||||
}
|
||||
|
0
src/app/mock-login/mock-login.component.css
Normal file
0
src/app/mock-login/mock-login.component.css
Normal file
1
src/app/mock-login/mock-login.component.html
Normal file
1
src/app/mock-login/mock-login.component.html
Normal file
@ -0,0 +1 @@
|
||||
<p>mock-login works!</p>
|
21
src/app/mock-login/mock-login.component.spec.ts
Normal file
21
src/app/mock-login/mock-login.component.spec.ts
Normal file
@ -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<MockLoginComponent>;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [MockLoginComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(MockLoginComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
10
src/app/mock-login/mock-login.component.ts
Normal file
10
src/app/mock-login/mock-login.component.ts
Normal file
@ -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 {
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user