_dropzone.scss 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. /* The MIT License */
  2. $preview-width: 150px;
  3. $preview-height: 100px;
  4. $success-color: lighten($secondary-accent-bg,10%);
  5. $error-color: #D55A4E;
  6. .form-uploads-wrapper h3 {
  7. font-size: 1rem;
  8. margin: 2rem 0 0.5rem 0;
  9. }
  10. .dropzone {
  11. position: relative;
  12. border: 1px $form-border solid;
  13. border-radius: $form-border-radius;
  14. min-height: 4rem;
  15. background: $white;
  16. &.dz-clickable {
  17. cursor: pointer;
  18. }
  19. &.dz-drag-hover {
  20. border-color: rgba(0,0,0,0.15);
  21. background: rgba(0,0,0,0.04);
  22. }
  23. &.dz-started .dz-message {
  24. display: none;
  25. }
  26. .dz-message {
  27. opacity: 1;
  28. -ms-filter: none;
  29. filter: none;
  30. }
  31. .dz-preview {
  32. position: relative;
  33. display: inline-block;
  34. margin: 1rem;
  35. vertical-align: top;
  36. &.dz-file-preview [data-dz-thumbnail] {
  37. display: none;
  38. }
  39. &.dz-error .dz-error-mark {
  40. display: block;
  41. }
  42. &.dz-success .dz-success-mark {
  43. display: block;
  44. }
  45. .dz-success-mark, .dz-error-mark {
  46. color: $white;
  47. font-family: FontAwesome;
  48. display: none;
  49. position: absolute;
  50. width: 22px;
  51. height: 22px;
  52. font-size: 18px;
  53. line-height: 25px;
  54. border-radius: 100%;
  55. text-align: center;
  56. right: 2px;
  57. top: 2px;
  58. span {
  59. display: none;
  60. }
  61. }
  62. &:hover {
  63. .dz-success-mark, .dz-error-mark {
  64. display: none;
  65. }
  66. }
  67. .dz-success-mark {
  68. background-color: $success-color;
  69. &::after {
  70. content: '\f00c';
  71. }
  72. }
  73. .dz-error-mark {
  74. background-color: $error-color;
  75. &::after {
  76. content: '\f12a';
  77. }
  78. }
  79. .dz-progress {
  80. position: absolute;
  81. top: $preview-height;
  82. left: 0px;
  83. right: 0px;
  84. height: 4px;
  85. background: #d7d7d7;
  86. display: none;
  87. .dz-upload {
  88. display: block;
  89. position: absolute;
  90. top: 0;
  91. bottom: 0;
  92. left: 0;
  93. width: 0%;
  94. background-color: $success-color;
  95. }
  96. }
  97. .dz-error-message {
  98. display: none;
  99. position: absolute;
  100. top: 0;
  101. left: 0;
  102. right: 0;
  103. font-size: 0.9rem;
  104. line-height: 1.2;
  105. padding: 8px 10px;
  106. background: lighten($content-bg,3%);
  107. color: $error-color;
  108. z-index: 500;
  109. }
  110. &.dz-processing .dz-progress {
  111. display: block;
  112. }
  113. &:hover:not(.hide-backface) .dz-details img {
  114. display: none;
  115. }
  116. &:hover.dz-error .dz-error-message {
  117. display: block;
  118. }
  119. .dz-remove, .dz-insert {
  120. display: none;
  121. }
  122. &:hover .dz-remove, &:hover .dz-insert {
  123. display: block;
  124. position: absolute;
  125. left: 0;
  126. right: 0;
  127. bottom: 22px;
  128. border:1px solid darken($content-bg,5%);
  129. width: 50%;
  130. text-align: center;
  131. cursor: pointer;
  132. font-size: 0.8rem;
  133. &:hover {
  134. background: $content-bg;
  135. }
  136. }
  137. &:hover .dz-remove {
  138. left: inherit;
  139. border-left: 0;
  140. }
  141. &:hover .dz-insert {
  142. right: inherit;
  143. }
  144. &.dz-processing {
  145. .dz-details {
  146. overflow: hidden;
  147. img {
  148. position: absolute;
  149. left: 50%;
  150. top: 50%;
  151. height: auto;
  152. width: 100%;
  153. -webkit-transform: translate(-50%,-50%);
  154. -ms-transform: translate(-50%,-50%);
  155. transform: translate(-50%,-50%);
  156. }
  157. }
  158. }
  159. .dz-details {
  160. width: $preview-width;
  161. height: $preview-height;
  162. position: relative;
  163. background: lighten($content-bg,3%);
  164. border:1px solid darken($content-bg,5%);
  165. font-size: 0.8rem;
  166. padding: 5px;
  167. margin-bottom: 22px;
  168. .dz-filename {
  169. line-height: 1.2;
  170. overflow: hidden;
  171. height: 100%;
  172. }
  173. img {
  174. position: absolute;
  175. top: 0;
  176. left: 0;
  177. width: $preview-width;
  178. height: $preview-height;
  179. }
  180. .dz-size {
  181. position: absolute;
  182. bottom: -28px;
  183. left: 0;
  184. right: 0;
  185. text-align: center;
  186. font-size: 0.8rem;
  187. height: 28px;
  188. line-height: 28px;
  189. }
  190. }
  191. }
  192. &.dz-clickable {
  193. .dz-message, .dz-message span {
  194. cursor: pointer;
  195. color: lighten($content-fg,30%);
  196. text-align: center;
  197. font-size: 1.4rem;
  198. line-height: 4rem;
  199. }
  200. }
  201. * {
  202. cursor: default;
  203. }
  204. }