Skip to content

Commit

Permalink
Keep a notification around by mouseover
Browse files Browse the repository at this point in the history
  • Loading branch information
V13Axel committed Jul 19, 2024
1 parent e36badf commit cca6497
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions resources/views/components/notification-area.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,29 @@ class="fixed bottom-0 right-0 flex w-full max-w-xs flex-col space-y-4 pr-4 pb-4
<div
x-data="{
show: false,
timeout: null,
init() {
this.$nextTick(() => this.show = true)
this.$nextTick(() => this.show = true);
setTimeout(() => this.transitionOut(), 2000)
this.startTimeout();
},
transitionOut() {
this.show = false
this.show = false;
setTimeout(() => this.remove(this.notification), 500)
setTimeout(() => this.remove(this.notification), 500);
},
cancelTimeout() {
clearTimeout(this.timeout);
},
startTimeout() {
this.timeout = setTimeout(() => this.transitionOut(), 2000);
}
}"
x-show="show"
x-transition.duration.500ms
class="pointer-events-auto relative w-full max-w-sm rounded-md border border-gray-200 bg-white py-4 pl-6 pr-4 shadow-lg"
@mouseenter="cancelTimeout"
@mouseleave="startTimeout"
>
<div class="flex items-start">
<!-- Icons -->
Expand Down

0 comments on commit cca6497

Please sign in to comment.