css animations

htmx
lza_menace 6 months ago
parent b721a14402
commit 31002694c9

@ -29,11 +29,11 @@ input {
display: none !important;
}
.htmx-request .indicator{
.indicator .htmx-request{
display:inline;
}
.htmx-request.indicator{
.indicator.htmx-request{
display:inline;
}
@ -41,12 +41,16 @@ input {
text-decoration: underline dotted;
}
#show_wallets {
animation-name: example;
animation-duration: 4s;
.showFade {
animation-name: render;
animation-duration: .5s;
}
@keyframes example {
from {background-color: red;}
to {background-color: yellow;}
@keyframes render {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

@ -14,11 +14,24 @@
<div>
<h3>Accounts</h3>
<div hx-get="/htmx/show_wallets" hx-target="#show_wallets" class="button outline" hx-indicator="#refreshLoader">
<div hx-get="/htmx/show_wallets" hx-target="#show_wallets" class="button outline" hx-indicator="#refresh_loader" onclick="handleRefresh()">
Refresh
<i class="fa-solid fa-rotate-right indicator" id="refreshLoader"></i>
<i class="fa-solid fa-rotate-right indicator" id="refresh_loader"></i>
</div>
<div hx-trigger="load" hx-get="/htmx/show_wallets" id="show_wallets"></div>
<div hx-trigger="load" hx-get="/htmx/show_wallets" id="show_wallets" onload=""></div>
</div>
<script>
function handleRefresh() {
const show_wallets = document.getElementById('show_wallets');
const loader = document.getElementById('refresh_loader');
loader.classList.add('fa-spin');
show_wallets.classList.add('showFade');
setTimeout(function() {
show_wallets.classList.remove('showFade');
loader.classList.remove('fa-spin');
}, 2000)
}
</script>
{% endblock %}

Loading…
Cancel
Save