app is responsive and stores data via localStorage

This commit is contained in:
s473561 2023-06-19 16:06:12 +02:00
parent cc59ca794e
commit 1a74cb66a9
5 changed files with 49 additions and 6 deletions

View File

@ -9,4 +9,4 @@
<app-horoscope [horoscopeData]="horoscopeData1" (newSignEvent) = "changeGender" <app-horoscope [horoscopeData]="horoscopeData1" (newSignEvent) = "changeGender"
> >
</app-horoscope> </app-horoscope>
</body> </body>

View File

@ -25,5 +25,12 @@ ul {
} }
.nav-bar { .nav-bar {
width: 800px; max-width: 800px;
margin: 0 auto;
}
@media (max-width: 768px) {
.nav-bar {
width: 90vw;
}
} }

View File

@ -1,5 +1,5 @@
.container-numerology { .container-numerology {
width: 600px; max-width: 768px;
height: 78vh; height: 78vh;
background-color: var(--green-2); background-color: var(--green-2);
border-radius: 20px; border-radius: 20px;
@ -10,6 +10,7 @@
margin-top: 0.5em; margin-top: 0.5em;
flex-direction: column; flex-direction: column;
} }
.upper-num { .upper-num {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@ -69,4 +70,14 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center text-align: center
} }
@media screen and (max-width: 768px) {
body {
font-size: 14px;
}
.container-numerology {
width: 90vw;
}
}

View File

@ -9,18 +9,21 @@ import { NumerologyData } from '../models/numerology.model';
}) })
export class NumerologyComponent implements OnInit{ export class NumerologyComponent implements OnInit{
public number: string = '7' public number!: string
public numerologyData?: NumerologyData public numerologyData?: NumerologyData
errormessage: any errormessage: any
constructor (private openNumerologyService: OpenNumerologyService) {} constructor (private openNumerologyService: OpenNumerologyService) {}
ngOnInit(): void { ngOnInit(): void {
this.number = localStorage.getItem('number') || '7';
this.getNumerology(); this.getNumerology();
this.number= ''; this.number= '';
} }
onSubmitNumber() { onSubmitNumber() {
localStorage.setItem('number', this.number);
this.getNumerology(); this.getNumerology();
this.number = ''; this.number = '';
} }

View File

@ -44,7 +44,7 @@ body {
background-color: var(--green-2); background-color: var(--green-2);
border-radius: 20px; border-radius: 20px;
box-shadow: 10px 10px 10px var(--shadow-dark); box-shadow: 10px 10px 10px var(--shadow-dark);
margin: 1em; margin: 1em auto;
margin-top: 0.5em; margin-top: 0.5em;
} }
.if-no-error{ .if-no-error{
@ -223,3 +223,25 @@ body {
margin-right: 10%; margin-right: 10%;
text-align: center; text-align: center;
} }
@media screen and (max-width: 768px) {
body {
font-size: 12px;
}
.container {
width: 90%;
margin: 0.5em;
}
.first-column,
.second-column {
width: 100%;
}
.upper-data img {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}