From 659a86eba44f4e3a886f9e7aa380e8afb2e6e4d6 Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 7 Nov 2019 23:39:33 +0100 Subject: [PATCH] Add loading animation when searching pubkey --- public/css/style.css | 32 ++++++++++++++++++++++++++++++++ public/images/ajax-loader.gif | Bin 0 -> 673 bytes src/Account/views/signup.twig | 7 +++++++ 3 files changed, 39 insertions(+) create mode 100644 public/images/ajax-loader.gif diff --git a/public/css/style.css b/public/css/style.css index 47952b5..e273b67 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -103,6 +103,38 @@ header.header img { margin: 5px auto; text-align: center; } + +/******************************************************************/ +/* LOADING PUBKEY */ +/******************************************************************/ + +/*.loadingPubkey { +// display: none; + position: fixed; + z-index: 1000; + top: 0; + left: 0; + height: 100%; + width: 100%; + background: rgba( 255, 255, 255, .8 ) + url('http://i.stack.imgur.com/FhHRx.gif') + 50% 50% + no-repeat; +}*/ + +.loadingPubkey { + display: none; + height: 20px; + width: 20px; + content:url('../images/ajax-loader.gif') +} + +body.loading .loadingPubkey { + overflow: hidden; + display: block; +} + + /******************************************************************/ /* POUR MOBILES */ /******************************************************************/ diff --git a/public/images/ajax-loader.gif b/public/images/ajax-loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..5bf51937b6e0ede9d6447709e92126d135127ae1 GIT binary patch literal 673 zcmZ?wbhEHb6krfw_{6|ay7QZYV|>D#i>3*!K!!u!46oYN0j*mV|8x7fh6Fo12DlpO z889<4Ffb_olX5OfO)N=GQ7F$W$xuklO03AqPfXFv%uCB>Q2fcl$puuU1H?e11sE8Z zjX8GR`Dbv-Gg~;B!-_+44!hrsG)~uzhKF{E%sjYFFX70c!V9|55|($Dv0F;;uzO`c z_W;_0X^siV9KRk#1?d)^-5Z{DxfD7Dh9nqDDkS*0MoX=zk=a^$|81fKdxOGtiAQbD zlABajw1lu3WX7?}NLl-oXl^srqNeY?L+OktFBhpFp z{3! {{ csrf_input() }} {{ field('username', user.username, "Pseudo") }} +
{{ field('pubkey', user.pubkey, "Clé publique") }}
{{ field('firstname', user.firstname, "Prénom") }} {{ field('lastname', user.lastname, "Nom") }} @@ -22,6 +23,9 @@ var textInput = document.getElementById('username'); var timeout = null; +$body = $("body"); +noPubKey("hide") + textInput.onkeyup = function (e) { clearTimeout(timeout); timeout = setTimeout(function () { @@ -38,12 +42,14 @@ textInput.onkeyup = function (e) { (pubkeyIsNull) ? noPubKey("block") : noPubKey("hide"); } } + $body.addClass("loading"); xmlhttp.open("GET","/ajax/getG1PubKey.php?vendeur="+textInput.value,true); xmlhttp.send(); }, 800); }; function noPubKey(state) { + $body.removeClass("loading"); var textMbr = document.getElementById("cle_pub"); if (state == "hide"){ textMbr.style.display = "none"; @@ -52,6 +58,7 @@ function noPubKey(state) { } } + {% endblock %}