Enhancement: improved loading visuals (#8435)

This commit is contained in:
shamoon
2024-12-05 20:26:28 -08:00
committed by GitHub
parent 8722ff481c
commit 0647812699
35 changed files with 792 additions and 490 deletions

View File

@@ -1,4 +1,4 @@
<div class="card shadow-sm bg-light" cdkDrag [cdkDragDisabled]="!draggable" cdkDragPreviewContainer="parent">
<div class="card shadow-sm bg-light fade" [class.reveal]="reveal" cdkDrag [cdkDragDisabled]="!draggable" cdkDragPreviewContainer="parent">
<div class="card-header">
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex">

View File

@@ -1,3 +1,12 @@
i-bs {
cursor: move;
}
.card {
opacity: 0;
transition: opacity .2s;
}
.reveal {
opacity: 1;
}

View File

@@ -35,6 +35,7 @@ describe('WidgetFrameComponent', () => {
fixture = TestBed.createComponent(WidgetFrameComponent)
component = fixture.componentInstance
jest.useFakeTimers()
fixture.detectChanges()
})
@@ -51,4 +52,10 @@ describe('WidgetFrameComponent', () => {
fixture.detectChanges()
expect(fixture.debugElement.query(By.css('.spinner-border'))).not.toBeNull()
})
it('should reveal', () => {
expect(component.reveal).toBeFalsy()
jest.advanceTimersByTime(100)
expect(component.reveal).toBeTruthy()
})
})

View File

@@ -1,11 +1,11 @@
import { Component, Input } from '@angular/core'
import { AfterViewInit, Component, Input } from '@angular/core'
@Component({
selector: 'pngx-widget-frame',
templateUrl: './widget-frame.component.html',
styleUrls: ['./widget-frame.component.scss'],
})
export class WidgetFrameComponent {
export class WidgetFrameComponent implements AfterViewInit {
constructor() {}
@Input()
@@ -16,4 +16,12 @@ export class WidgetFrameComponent {
@Input()
draggable: any
public reveal: boolean = false
ngAfterViewInit(): void {
setTimeout(() => {
this.reveal = true
}, 100)
}
}