mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-27 07:22:28 +03:00
123
This commit is contained in:
@@ -2,6 +2,26 @@
|
||||
export let widget;
|
||||
export let value;
|
||||
value = value;
|
||||
|
||||
$: widget.status, blink();
|
||||
|
||||
let prevStatus;
|
||||
|
||||
let green = false;
|
||||
|
||||
function blink() {
|
||||
if (widget.status) {
|
||||
if (widget.status != prevStatus) {
|
||||
setTimeout(stopBlink, 4000);
|
||||
green = true;
|
||||
}
|
||||
prevStatus = widget.status;
|
||||
}
|
||||
}
|
||||
|
||||
function stopBlink() {
|
||||
green = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="crd-itm-psn">
|
||||
@@ -11,8 +31,8 @@
|
||||
</div>
|
||||
<div class="flex justify-end w-1/3">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="wgt-adt-stl">{!widget.status ? "" : widget.status}</label>
|
||||
<label class="wgt-adt-stl {green ? 'text-green-500 animate-pulse' : ''}">{!widget.status ? "" : widget.status}</label>
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="wgt-adt-stl"> {!widget.after ? "" : widget.after}</label>
|
||||
<label class="wgt-adt-stl {green ? 'text-green-500 animate-pulse' : ''}"> {!widget.after ? "" : widget.after}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user