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>
</body>
</body>

View File

@ -25,5 +25,12 @@ ul {
}
.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 {
width: 600px;
max-width: 768px;
height: 78vh;
background-color: var(--green-2);
border-radius: 20px;
@ -10,6 +10,7 @@
margin-top: 0.5em;
flex-direction: column;
}
.upper-num {
position: relative;
overflow: hidden;
@ -69,4 +70,14 @@
align-items: center;
justify-content: 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{
public number: string = '7'
public number!: string
public numerologyData?: NumerologyData
errormessage: any
constructor (private openNumerologyService: OpenNumerologyService) {}
ngOnInit(): void {
this.number = localStorage.getItem('number') || '7';
this.getNumerology();
this.number= '';
}
onSubmitNumber() {
localStorage.setItem('number', this.number);
this.getNumerology();
this.number = '';
}

View File

@ -44,7 +44,7 @@ body {
background-color: var(--green-2);
border-radius: 20px;
box-shadow: 10px 10px 10px var(--shadow-dark);
margin: 1em;
margin: 1em auto;
margin-top: 0.5em;
}
.if-no-error{
@ -223,3 +223,25 @@ body {
margin-right: 10%;
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;
}
}