dialog.scss 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. @import '../../styles/animation/fade';
  2. @import '../../styles/animation/ease';
  3. body.dialog-open {
  4. position: fixed;
  5. }
  6. .nut-dialog-wrapper {
  7. position: relative;
  8. z-index: $zindex-mask;
  9. }
  10. .nut-dialog-box {
  11. width: 85vw;
  12. display: flex;
  13. align-items: center;
  14. justify-content: center;
  15. color: $normal-color;
  16. }
  17. .nut-dialog-mask {
  18. position: fixed;
  19. background: $mask-bg;
  20. }
  21. .nut-dialog {
  22. position: relative;
  23. width: 85vw;
  24. max-height: 70vh;
  25. background: #fff;
  26. border-radius: $border-radius-base;
  27. overflow: hidden;
  28. display: flex;
  29. flex-direction: column;
  30. }
  31. .nut-dialog-title {
  32. display: block;
  33. line-height: 1.5;
  34. color: $title-color;
  35. font-size: $font-size-large;
  36. text-align: center;
  37. flex-shrink: 0;
  38. @include text-ellipsis;
  39. padding-bottom: 8px; // &:only-child {
  40. // padding-bottom: 0;
  41. // }
  42. }
  43. .nut-dialog-close {
  44. position: absolute;
  45. right: 0;
  46. top: 0;
  47. width: 30px;
  48. height: 30px;
  49. font-size: 20px;
  50. text-align: center;
  51. text-decoration: none;
  52. background: url("data:image/svg+xml, %3Csvg width='30' height='30' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgb(132,132,132)' fill-rule='evenodd'%3E%3Cpath d='M.44 2.56A1.5 1.5 0 1 1 2.56.44l27 27a1.5 1.5 0 1 1-2.12 2.12L15 17.123 2.56 29.56A1.5 1.5 0 1 1 .44 27.44L12.878 15 .44 2.56zM27.44.44a1.5 1.5 0 1 1 2.12 2.12l-9 9a1.5 1.5 0 1 1-2.12-2.12l9-9z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center;
  53. background-size: 13px 13px;
  54. img {
  55. height: 13px;
  56. }
  57. }
  58. .nut-dialog-image-wrapper {
  59. .nut-dialog {
  60. width: auto;
  61. max-width: 80%;
  62. max-height: 75%;
  63. background: transparent;
  64. border-radius: none;
  65. display: inline-block;
  66. overflow: visible;
  67. }
  68. .nut-dialog-close {
  69. position: absolute;
  70. right: 0;
  71. top: -40px;
  72. width: 25px;
  73. height: 25px;
  74. font-size: 20px;
  75. text-align: center;
  76. text-decoration: none;
  77. border: 2px solid #fff;
  78. border-radius: 50%;
  79. background: url("data:image/svg+xml, %3Csvg width='30' height='30' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgb(255,255,255)' fill-rule='evenodd'%3E%3Cpath d='M.44 2.56A1.5 1.5 0 1 1 2.56.44l27 27a1.5 1.5 0 1 1-2.12 2.12L15 17.123 2.56 29.56A1.5 1.5 0 1 1 .44 27.44L12.878 15 .44 2.56zM27.44.44a1.5 1.5 0 1 1 2.12 2.12l-9 9a1.5 1.5 0 1 1-2.12-2.12l9-9z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center;
  80. background-size: 13px 13px;
  81. img {
  82. height: 13px;
  83. }
  84. }
  85. }
  86. .nut-dialog-link {
  87. display: inline-block;
  88. }
  89. .nut-dialog-image {
  90. max-width: 100%;
  91. max-height: 100%;
  92. vertical-align: bottom;
  93. }
  94. .nut-dialog-body {
  95. box-sizing: border-box;
  96. padding: 30px 20px 20px;
  97. display: flex;
  98. flex-direction: column;
  99. flex: 0 1 auto;
  100. }
  101. .nut-dialog-content {
  102. flex: 1;
  103. justify-content: center;
  104. overflow: auto;
  105. font-size: $font-size-base;
  106. word-break: break-all;
  107. padding-bottom: 10px;
  108. -webkit-overflow-scrolling: touch;
  109. }
  110. .nut-dialog-footer {
  111. height: 50px;
  112. width: 100%;
  113. line-height: 50px;
  114. display: flex;
  115. flex-shrink: 0;
  116. border-radius: 0 0 5px 5px;
  117. overflow: hidden;
  118. flex-direction: row;
  119. }
  120. .nut-dialog-btn {
  121. display: block;
  122. width: 100%;
  123. height: 100%;
  124. position: relative;
  125. flex: 1;
  126. font-size: $font-size-base;
  127. border: none;
  128. background: transparent;
  129. appearance: none;
  130. outline: none;
  131. user-select: none;
  132. &.disabled {
  133. background: $btn-disable-bg;
  134. background-origin: border-box;
  135. color: $btn-disable-color;
  136. }
  137. &:only-child {
  138. border-radius: 0 0 5px 5px;
  139. background: transparent;
  140. color: $primary-color;
  141. border-top: 1px solid $light-color;
  142. }
  143. }
  144. .nut-dialog-ok {
  145. border-radius: 0 0 5px 0;
  146. background: $btn-gradient-bg;
  147. background-origin: border-box;
  148. color: $btn-gradient-color;
  149. margin-right: -1px;
  150. &:active {
  151. background: $btn-gradient-active-bg;
  152. }
  153. }
  154. .nut-dialog-cancel {
  155. border-radius: 0 0 0 5px;
  156. border-top: 1px solid $light-color;
  157. background: #fff;
  158. background-origin: border-box;
  159. &:active {
  160. border-top: 1px solid #ccc;
  161. background: #ccc;
  162. }
  163. }