added search loader

This commit is contained in:
Oleg Belyaev 2025-03-24 01:36:05 +03:00
parent fe72db6c49
commit 3855cf6bf0
3 changed files with 22 additions and 2 deletions

View file

@ -542,3 +542,18 @@ https://github.com/frontaid/natural-selection
float: left;
padding-right: 0.5vw;
}
.loader {
border: 2px solid #f3f3f3;
border-radius: 50%;
border-top: 2px solid #3498db;
width: 2ex;
height: 2ex;
-webkit-animation: spin 2s linear infinite; /* Safari */
animation: spin 2s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

View file

@ -1,10 +1,15 @@
$( document ).ready(function() {
// GLOBALS
// GLOBALS;
// Link elements that do not have href out of the box
$('.link').on("click", function () {
window.location=$(this)[0].dataset.href+window.location.search+window.location.hash;
});
$('#abv-search').on("submit", function () {
$('#abv-search-icon').replaceWith('<div class="loader"></div>');
});
// init Infinite Scroll
$('main').infiniteScroll({
path: '.pagination__next',

View file

@ -105,7 +105,7 @@ declare function page:header($lang as xs:string, $href-other as xs:string) {
aria-label="Search" />
{if (not(session:get('searchQuery'))) then
<button type="submit">
<svg xmlns="http://www.w3.org/2000/svg"
<svg id="abv-search-icon" xmlns="http://www.w3.org/2000/svg"
width="16" height="16"
viewBox="0 0 16 16"
fill="currentColor" class="bi bi-search">