Skip to content

Commit

Permalink
feat(demo): improve config layout
Browse files Browse the repository at this point in the history
  • Loading branch information
DerStimmler committed Jul 27, 2023
1 parent 0669d3a commit 6199409
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
24 changes: 14 additions & 10 deletions apps/demo/src/app/config/config.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
*ngFor="let layerForm of layers.controls; let i = index"
class="card"
>
<mat-card-header class="card-header">
<mat-card-title>Layer #{{i + 1}}</mat-card-title>
<button
mat-icon-button
color="primary"
class="control-delete"
aria-label="Button to delete a layer with delete icon"
matTooltip="Remove layer"
(click)="deleteLayer(i)"
>
<mat-icon>delete</mat-icon>
</button>
</mat-card-header>
<div [formGroupName]="i" class="control-container">
<mat-form-field
appearance="outline"
Expand Down Expand Up @@ -69,19 +82,10 @@
>
isRound
</mat-checkbox>
<button
mat-icon-button
color="primary"
class="control-delete"
aria-label="Button to delete a layer with delete icon"
(click)="deleteLayer(i)"
>
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-card>
</ng-container>
<button mat-mini-fab color="primary" (click)="addLayer()">
<button mat-mini-fab color="primary" matTooltip="Add layer" (click)="addLayer()">
<mat-icon>add</mat-icon>
</button>
<div class="others-form">
Expand Down
8 changes: 7 additions & 1 deletion apps/demo/src/app/config/config.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.control-container {
align-items: center;
display: grid;
grid-template-columns: 1fr 1fr max-content;
grid-template-columns: 1fr 1fr;
column-gap: 0.5rem;

&:first-child {
Expand Down Expand Up @@ -45,6 +45,12 @@

.card {
padding: 1em;

.card-header {
display: flex;
justify-content: space-between;
padding: 0 0 1rem 0;
}
}

:host::ng-deep {
Expand Down
2 changes: 2 additions & 0 deletions apps/demo/src/app/config/config.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ConfigForm } from './config-form';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { Clipboard } from '@angular/cdk/clipboard';
import {MatTooltipModule} from "@angular/material/tooltip";

@Component({
selector: 'ngx-parallax-stars-config',
Expand All @@ -33,6 +34,7 @@ import { Clipboard } from '@angular/cdk/clipboard';
MatSelectModule,
MatSlideToggleModule,
MatCheckboxModule,
MatTooltipModule,
],
templateUrl: './config.component.html',
styleUrls: ['./config.component.scss'],
Expand Down

0 comments on commit 6199409

Please sign in to comment.