-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c3c5db
commit d5d900f
Showing
4 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
.../src/app/pages/roller-shutter-page/roller-shutter-cell/roller-shutter-cell.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div class="container"> | ||
<div id="wrapper"> | ||
<div class="stripe" [style.--lift]="rollerShutter().currentLift + '%'" | ||
[style.--tilt]="rollerShutter().currentTilt + '%'"></div> | ||
</div> | ||
|
||
<div> | ||
<span>{{ rollerShutter().name }}</span> | ||
@if (rollerShutter().config?.compassDirection; as directions) { | ||
<br> | ||
<span>{{ directions | compass }}</span> | ||
} | ||
@if (rollerShutter().config?.noAutomaticsUntil; as noAutomaticsUntil) { | ||
<br> | ||
<span>blockiert bis zum {{ noAutomaticsUntil | date:'dd.MM.yyyy' }}</span> | ||
} | ||
</div> | ||
|
||
</div> |
45 changes: 45 additions & 0 deletions
45
.../src/app/pages/roller-shutter-page/roller-shutter-cell/roller-shutter-cell.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
.container { | ||
display: grid; | ||
grid-template-columns: 130px auto; | ||
align-items: center; | ||
border: #555555 solid 1px; | ||
border-radius: 10px; | ||
height: 100px; | ||
width: 400px; | ||
margin: 15px | ||
} | ||
|
||
#wrapper { | ||
margin-left: 5px; | ||
width: 100px; | ||
height: 80px; | ||
border: #555555 1px solid; | ||
position: relative; | ||
} | ||
|
||
.stripe { | ||
--lift: 100%; | ||
--tilt: 90%; | ||
--color: gray; | ||
|
||
--tilt-start: calc(10% - var(--tilt) / 100 * 10); | ||
|
||
position: absolute; | ||
width: 100%; | ||
height: calc(100% - var(--lift)); | ||
background: repeating-linear-gradient( | ||
var(--color), | ||
var(--color) var(--tilt-start), | ||
transparent var(--tilt-start), | ||
transparent 10% | ||
); | ||
z-index: 1; | ||
transition: height 500ms ease-in-out; | ||
} | ||
|
||
.stripe:first-child { | ||
border-bottom: 1px solid transparent; | ||
top: 0; | ||
} | ||
|
23 changes: 23 additions & 0 deletions
23
...c/app/pages/roller-shutter-page/roller-shutter-cell/roller-shutter-cell.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {RollerShutterCellComponent} from './roller-shutter-cell.component'; | ||
|
||
describe('RollerShutterCellComponent', () => { | ||
let component: RollerShutterCellComponent; | ||
let fixture: ComponentFixture<RollerShutterCellComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [RollerShutterCellComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(RollerShutterCellComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
...nd/src/app/pages/roller-shutter-page/roller-shutter-cell/roller-shutter-cell.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {Component, input} from '@angular/core'; | ||
import {RollerShutter} from "../../../models/devices/roller-shutter.dto"; | ||
import {CompassPipe} from "../../../core/pipes/compass.pipe"; | ||
import {DatePipe} from "@angular/common"; | ||
|
||
@Component({ | ||
selector: 'app-roller-shutter-cell', | ||
standalone: true, | ||
imports: [ | ||
CompassPipe, | ||
DatePipe | ||
], | ||
templateUrl: './roller-shutter-cell.component.html', | ||
styleUrl: './roller-shutter-cell.component.scss' | ||
}) | ||
export class RollerShutterCellComponent { | ||
|
||
public rollerShutter = input.required<RollerShutter>(); | ||
|
||
} |