| 1 |
.givewp-donation-form-modal { |
| 2 |
outline: none; |
| 3 |
width: 100%; |
| 4 |
padding: 1rem; |
| 5 |
overflow-y: scroll; |
| 6 |
|
| 7 |
/* |
| 8 |
* The zoom runs on the content, not on this element: the close button |
| 9 |
* inside is position: fixed, and a transformed ancestor would pin it to |
| 10 |
* the dialog for the length of the animation, then let it jump to the |
| 11 |
* viewport corner. |
| 12 |
*/ |
| 13 |
&[data-entering='true']='true'] { |
| 14 |
animation: modal-fade 300ms; |
| 15 |
|
| 16 |
.givewp-donation-form-modal__dialog__content { |
| 17 |
animation: modal-zoom 600ms; |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
@keyframes modal-fade { |
| 22 |
from { |
| 23 |
opacity: 0; |
| 24 |
} |
| 25 |
|
| 26 |
to { |
| 27 |
opacity: 1; |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
@keyframes modal-zoom { |
| 32 |
from { |
| 33 |
transform: scale(0.8); |
| 34 |
} |
| 35 |
|
| 36 |
to { |
| 37 |
transform: scale(1); |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
&__overlay { |
| 42 |
position: fixed; |
| 43 |
top: 0; |
| 44 |
left: 0; |
| 45 |
width: 100vw; |
| 46 |
height: 100dvh; |
| 47 |
background: rgba(0 0 0 / 0.7); |
| 48 |
display: flex; |
| 49 |
flex-direction: column; |
| 50 |
align-items: center; |
| 51 |
justify-content: center; |
| 52 |
z-index: 100; |
| 53 |
|
| 54 |
&[data-loading='true']='true'] { |
| 55 |
display: none; |
| 56 |
} |
| 57 |
|
| 58 |
&[data-entering='true']='true'] { |
| 59 |
animation: modal-fade 300ms; |
| 60 |
} |
| 61 |
|
| 62 |
&[data-exiting='true']='true'] { |
| 63 |
animation: modal-fade 150ms reverse ease-in; |
| 64 |
} |
| 65 |
} |
| 66 |
|
| 67 |
/* |
| 68 |
* While the form loads the launcher keeps its size and swaps the label |
| 69 |
* for a spinner. Drawn in CSS so the external embed, which has no |
| 70 |
* @wordpress/components, renders the same thing. `data-pending` is what |
| 71 |
* react-aria's Button sets from isPending; the embed sets it by hand. |
| 72 |
*/ |
| 73 |
&__open { |
| 74 |
position: relative; |
| 75 |
|
| 76 |
&[data-pending]] &__label { |
| 77 |
visibility: hidden; |
| 78 |
} |
| 79 |
} |
| 80 |
|
| 81 |
&__open__spinner { |
| 82 |
position: absolute; |
| 83 |
top: 50%; |
| 84 |
left: 50%; |
| 85 |
transform: translate(-50%, -50%); |
| 86 |
z-index: 100; |
| 87 |
line-height: 1; |
| 88 |
width: 16px; |
| 89 |
height: 16px; |
| 90 |
border-radius: 50%; |
| 91 |
border: 1.5px solid currentColor; |
| 92 |
border-right-color: transparent; |
| 93 |
animation: modal-spin 1.4s linear infinite; |
| 94 |
} |
| 95 |
|
| 96 |
@keyframes modal-spin { |
| 97 |
from { |
| 98 |
transform: translate(-50%, -50%) rotate(0deg); |
| 99 |
} |
| 100 |
|
| 101 |
to { |
| 102 |
transform: translate(-50%, -50%) rotate(360deg); |
| 103 |
} |
| 104 |
} |
| 105 |
|
| 106 |
&__close { |
| 107 |
display: flex; |
| 108 |
position: fixed; |
| 109 |
top: 25px; |
| 110 |
right: 25px; |
| 111 |
padding: 0.75rem; |
| 112 |
width: fit-content; |
| 113 |
background: #e7e8ed; |
| 114 |
cursor: pointer; |
| 115 |
border: 1px solid transparent; |
| 116 |
border-radius: 50%; |
| 117 |
z-index: 999; |
| 118 |
transition: 0.2s; |
| 119 |
|
| 120 |
svg { |
| 121 |
height: 1rem; |
| 122 |
width: 1rem; |
| 123 |
} |
| 124 |
|
| 125 |
&:hover, |
| 126 |
&:focus, |
| 127 |
&:active { |
| 128 |
border: 1px solid darken(#e7e8ed, 10%); |
| 129 |
background-color: darken(#e7e8ed, 10%); |
| 130 |
} |
| 131 |
} |
| 132 |
} |
| 133 |
|
| 134 |
// Account for admin bar |
| 135 |
.admin-bar { |
| 136 |
.givewp-donation-form-modal { |
| 137 |
margin-top: 32px; |
| 138 |
&__close { |
| 139 |
top: calc(32px + 25px); |
| 140 |
} |
| 141 |
} |
| 142 |
} |
| 143 |
|