// SweetAlert // 2014 (c) - Tristan Edwards // github.com/t4t5/sweetalert @import 'vars'; $sweet-alert-width: 478px; $sweet-alert-padding-horizontal: 30px; $sweet-alert-padding-vertical: 20px; $sweet-alert-bg: $inverse; // z-index $sweet-alert-z-index: $zindex-modal; body.stop-scrolling { height: 100%; overflow: hidden; } .sweet-overlay { background-color: rgba(#000, (40/100)); position: fixed; left: 0; right: 0; top: 0; bottom: 0; display: none; z-index: $sweet-alert-z-index; } .sweet-alert { background-color: $sweet-alert-bg; width: $sweet-alert-width; padding: $sweet-alert-padding-vertical $sweet-alert-padding-horizontal; border-radius: $border-radius; text-align: center; position: fixed; left: 50%; top: 50%; margin-left: -($sweet-alert-width / 2 + $sweet-alert-padding-horizontal); margin-top: -200px; overflow: hidden; display: none; z-index: $sweet-alert-z-index; @include media-breakpoint-down(sm) { width: auto; margin-left: 0; margin-right: 0; left: ($grid-gutter-width-base / 2); right: ($grid-gutter-width-base / 2); } .form-group { display: none; .sa-input-error { display: none; } } &.show-input .form-group { display: block; } .sa-confirm-button-container { display: inline-block; position: relative; } .la-ball-fall { position: absolute; left: 50%; top: 50%; margin-left: -27px; margin-top: -9px; opacity: 0; visibility: hidden; } button { &[disabled] { opacity: .6; cursor: default; } &.confirm[disabled] { color: transparent; ~ .la-ball-fall { opacity: 1; visibility: visible; transition-delay: 0s; } } } .sa-icon { width: 80px; height: 80px; border: 4px solid gray; border-radius: 50%; margin: 20px auto; position: relative; box-sizing: content-box; &.sa-error { border-color: $btn-danger-border; .sa-x-mark { position: relative; display: block; } .sa-line { position: absolute; height: 5px; width: 47px; background-color: $btn-danger-bg; display: block; top: 37px; border-radius: 2px; &.sa-left { transform: rotate(45deg); left: 17px; } &.sa-right { transform: rotate(-45deg); right: 16px; } } } &.sa-warning { border-color: $btn-warning-border; .sa-body { // Exclamation mark body position: absolute; width: 5px; height: 47px; left: 50%; top: 10px; border-radius: 2px; margin-left: -2px; background-color: $btn-warning-bg; } .sa-dot { // Exclamation mark dot position: absolute; width: 7px; height: 7px; border-radius: 50%; margin-left: -3px; left: 50%; bottom: 10px; background-color: $btn-warning-bg; } } &.sa-info { border-color: $btn-info-border; &::before { // i-letter body content: ""; position: absolute; width: 5px; height: 29px; left: 50%; bottom: 17px; border-radius: 2px; margin-left: -2px; background-color: $btn-info-bg; } &::after { // i-letter dot content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; margin-left: -3px; top: 19px; background-color: $btn-info-bg; } } &.sa-success { border-color: $btn-success-border; &::before, &::after { // Emulate moving circular line content: ''; border-radius: 50%; position: absolute; width: 60px; height: 120px; background: $body-bg; transform: rotate(45deg); } &::before { border-radius: 120px 0 0 120px; top: -7px; left: -33px; transform: rotate(-45deg); transform-origin: 60px 60px; } &::after { border-radius: 0 120px 120px 0; top: -11px; left: 30px; transform: rotate(-45deg); transform-origin: 0px 60px; } .sa-placeholder { // Ring width: 80px; height: 80px; border: 4px solid rgba($brand-success, (20/100)); border-radius: 50%; box-sizing: content-box; position: absolute; left: -4px; top: -4px; z-index: 2; } .sa-fix { // Hide corners left from animation width: 7px; height: 90px; background-color: $sweet-alert-bg; position: absolute; left: 27px; top: 8px; z-index: 1; transform: rotate(-45deg); } .sa-line { height: 5px; background-color: $btn-success-bg; display: block; border-radius: 2px; position: absolute; z-index: 2; &.sa-tip { width: 25px; left: 14px; top: 46px; transform: rotate(45deg); } &.sa-long { width: 47px; right: 8px; top: 38px; transform: rotate(-45deg); } } } &.sa-custom { background-size: contain; border-radius: 0; border: none; background-position: center center; background-repeat: no-repeat; } } .btn-default { @include form-control-focus($btn-default-border); } .btn-success { @include form-control-focus($btn-success-border); } .btn-info { @include form-control-focus($btn-info-border); } .btn-danger { @include form-control-focus($btn-danger-border); } .btn-warning { @include form-control-focus($btn-warning-border); } button::-moz-focus-inner { border: 0; } } @keyframes showSweetAlert { 0% { transform: scale(0.7); } 45% { transform: scale(1.05); } 80% { transform: scale(0.95); } 100% { transform: scale(1); } }; @keyframes hideSweetAlert { 0% { transform: scale(1); } 100% { transform: scale(0.5); } }; @keyframes slideFromTop { 0% { top: 0%; } 100% { top: 50%; } }; @keyframes slideToTop { 0% { top: 50%; } 100% { top: 0%; } }; @keyframes slideFromBottom { 0% { top: 70%; } 100% { top: 50%; } } @keyframes slideToBottom { 0% { top: 50%; } 100% { top: 70%; } } .showSweetAlert { animation: showSweetAlert 0.3s; &[data-animation=none] { animation: none; } &[data-animation=slide-from-top] { animation: slideFromTop 0.3s; } &[data-animation=slide-from-bottom] { animation: slideFromBottom 0.3s; } } .hideSweetAlert { animation: hideSweetAlert 0.3s; &[data-animation=none] { animation: none; } &[data-animation=slide-from-top] { animation: slideToTop 0.3s; } &[data-animation=slide-from-bottom] { animation: slideToBottom 0.3s; } } @keyframes animateSuccessTip { 0% { width: 0; left: 1px; top: 19px; } 54% { width: 0; left: 1px; top: 19px; } 70% { width: 50px; left: -8px; top: 37px; } 84% { width: 17px; left: 21px; top: 48px; } 100% { width: 25px; left: 14px; top: 45px; } } @keyframes animateSuccessLong { 0% { width: 0; right: 46px; top: 54px; } 65% { width: 0; right: 46px; top: 54px; } 84% { width: 55px; right: 0px; top: 35px; } 100% { width: 47px; right: 8px; top: 38px; } } @keyframes rotatePlaceholder { 0% { transform: rotate(-45deg); } 5% { transform: rotate(-45deg); } 12% { transform: rotate(-405deg); } 100% { transform: rotate(-405deg); } } .animateSuccessTip { animation: animateSuccessTip 0.75s; } .animateSuccessLong { animation: animateSuccessLong 0.75s; } .sa-icon.sa-success.animate::after { animation: rotatePlaceholder 4.25s ease-in; } @keyframes animateErrorIcon { 0% { transform: rotateX(100deg); opacity: 0; } 100% { transform: rotateX(0deg); opacity: 1; } } .animateErrorIcon { animation: animateErrorIcon 0.5s; } @keyframes animateXMark { 0% { transform: scale(0.4); margin-top: 26px; opacity: 0; } 50% { transform: scale(0.4); margin-top: 26px; opacity: 0; } 80% { transform: scale(1.15); margin-top: -6px; } 100% { transform: scale(1); margin-top: 0; opacity: 1; } } .animateXMark { animation: animateXMark 0.5s; } @keyframes pulseWarning { 0% { border-color: #F8D486; } 100% { border-color: #F8BB86; } } .pulseWarning { animation: pulseWarning 0.75s infinite alternate; } @keyframes pulseWarningIns { 0% { background-color: #F8D486; } 100% { background-color: #F8BB86; } } .pulseWarningIns { animation: pulseWarningIns 0.75s infinite alternate; } @keyframes rotate-loading { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }