minimise settle time

This commit is contained in:
perennial
2024-10-19 02:29:53 +11:00
parent 44cae5ac44
commit 2eb6c9dd93
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -505,6 +505,7 @@ body {
&:has(.htmx-request) {
opacity: 0.25;
/// based on how long it takes to get a response from the server
transition: opacity 500ms ease-out;
}
@@ -515,6 +516,8 @@ body {
&.htmx-settling {
opacity: 0;
/// the duration here doesn't really matter
/// this is just so that htmx animates the change
transition: opacity 0ms;
}
}
+2 -2
View File
@@ -66,11 +66,11 @@
</head>
{* NOTE: hx-swap="show:window:top" isn't needed when we hx-boost the body *}
{* NOTE: we need to specify swap and settle in hx-swap otherwise htmx won't apply the classes; durations set low for minimal impact *}
{* NOTE: we need to specify settle in hx-swap otherwise htmx won't apply the classes; duration set low for minimal impact *}
<body
class="bg-neutral-900"
hx-boost="true"
hx-swap="innerHTML settle:100ms"
hx-swap="innerHTML settle:1ms"
hx-target="this"
hx-indicator="#loading-indicator"
>