Skip to content

Instantly share code, notes, and snippets.

@owkx
Created May 10, 2023 00:32
Show Gist options
  • Save owkx/ffb6423839c535122e7cef8bf5654a0b to your computer and use it in GitHub Desktop.
Save owkx/ffb6423839c535122e7cef8bf5654a0b to your computer and use it in GitHub Desktop.
Loading spinner
 .loading {
            position: relative;
            transition: padding-right .3s ease-out;
            background-color: #CCC;
            padding-right: 40px;
        }
        .loading:after {
            content: "";
            position: absolute;
            border-radius: 100%;
            right: 6px;
            top: 50%;
            width: 0px;
            height: 0px;
            margin-top: -2px;
            border: 2px solid rgba(255,255,255,0.5);
            border-left-color: #FFF;
            border-top-color: #FFF;
            animation: spin .6s infinite linear, grow .3s forwards ease-out;
        }
        @keyframes spin {
            to {
                transform: rotate(359deg);
            }
        }
        @keyframes grow {
            to {
                width: 14px;
                height: 14px;
                margin-top: -8px;
                right: 13px;
            }
        }
            <button type="button" class="btn btn-primary button loading" name="saveData" id="save-data">Valider</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment