Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/misc UI fixes #1961

Merged
merged 12 commits into from
Nov 23, 2022
Prev Previous commit
Next Next commit
refactor card widget input as full card details; more card resizing f…
…or home page
  • Loading branch information
elvece committed Nov 23, 2022
commit 30ce7107ebe1bf130b5d6239f78a04e7c6fc68f4
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@
[ngStyle]="{ transform: innerTransform }"
>
<ion-card>
<any-link link="{{ link }}" [qp]="qp">
<any-link link="{{ cardDetails.link }}" [qp]="qp">
<ion-card-header>
<ion-card-title>{{ title }}</ion-card-title>
<ion-card-title>{{ cardDetails.title }}</ion-card-title>
</ion-card-header>
<ion-card-content>
<ion-icon name="{{ icon }}" style="color: {{ color }}"></ion-icon>
<ion-icon
name="{{ cardDetails.icon }}"
style="color: {{ cardDetails.color }}"
></ion-icon>
</ion-card-content>
<ion-footer>
<p>{{ description }}</p>
<p>{{ cardDetails.description }}</p>
</ion-footer>
</any-link>
</ion-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ion-card {
padding: 0.6rem;
font-weight: 600;
font-size: calc(12px + 0.5vw);
height: 3rem;
}

ion-card-content {
Expand All @@ -40,6 +41,11 @@ ion-card {
font-family: 'Open Sans';
font-size: clamp(1rem, calc(12px + 0.5vw), 1.3rem);
height: 9rem;
width: clamp(13rem, 80%, 18rem);
margin: 0 auto;
* {
max-width: 100%;
}
}

.footer-md::before {
Expand All @@ -48,7 +54,16 @@ ion-card {
}

@media (max-width: 900px) {
ion-footer {
ion-card-title, ion-footer {
height: auto !important;
}
ion-footer {
width: 10rem;
}
}

@media (max-width: 1200px) {
ion-footer {
width: 14rem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WidgetCardComponent {
@Input() title: string = ''
@Input() icon: string = ''
@Input() color: string = ''
@Input() description: string = ''
@Input() link: string = ''
@Input() cardDetails!: Card
@Input() qp?: Record<string, string>
@Input() containerDimensions: any
@ViewChild('outerWrapper') outerWrapper: ElementRef<HTMLElement> =
Expand Down Expand Up @@ -62,3 +58,11 @@ interface Dimension {
height: number
width: number
}

interface Card {
title: string
icon: string
color: string
description: string
link: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
class="ion-align-self-center"
>
<widget-card
title="{{ card.title }}"
icon="{{ card.icon }}"
color="{{ card.color }}"
description="{{ card.description }}"
link="{{ card.link }}"
[cardDetails]="card"
[qp]="card.qp"
[containerDimensions]="containerDimensions"
></widget-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ export class WidgetListComponent {
color: 'var(--alt-orange)',
description:
'Install your Embassy certificate for a secure local connection',
link: '/settings/lan',
link: '/system/lan',
},
{
title: 'Create Backup',
icon: 'duplicate-outline',
color: 'var(--alt-purple)',
description: 'Back up your Embassy and service data',
link: '/settings/backup',
link: '/system/backup',
},
{
title: 'Embassy Info',
icon: 'information-circle-outline',
color: 'var(--alt-green)',
description: 'View basic information about your Embassy',
link: '/settings/specs',
link: '/system/specs',
},
{
title: 'User Manual',
Expand Down