From: Ardis Lu Date: Sun, 7 May 2023 02:58:46 +0000 (-0700) Subject: Disable button and show spinner while loading X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=f78619090ce45336282dd219d66429a828064729;p=solc-metadata Disable button and show spinner while loading --- diff --git a/index.html b/index.html index b920de3..0b70cf7 100644 --- a/index.html +++ b/index.html @@ -60,11 +60,17 @@ background: hsl(216deg 50% 95%); border: 1px solid hsl(216deg 70% 50%); border-radius: 4px; + margin-inline-end: 8px; cursor: pointer; transition: filter 600ms; } - :is(input, output, button):is(:hover, :focus-within) { + button:disabled { + cursor: not-allowed; + border: 1px solid hsl(216deg 70% 75%); + } + + :is(input, output, button:not(:disabled)):is(:hover, :focus-within) { filter: drop-shadow(0 0 2px hsl(216deg 70% 50%)); transition: filter 200ms; } @@ -88,6 +94,24 @@ white-space: nowrap; border-width: 0; } + + @keyframes spin { + 100% { + transform: rotate(360deg); + } + } + + .inline-spinner { + display: inline-block; + box-sizing: border-box; + block-size: 1em; + inline-size: 1em; + border: 0.25em solid transparent; + border-block-start: 0.25em solid black; + border-radius: 50%; + animation: spin 1s infinite; + visibility: hidden; + } @@ -109,7 +133,10 @@ - +
+ + +
@@ -119,6 +146,9 @@