_dropzone.scss 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. /* The MIT License */
  2. $preview-width: 200px;
  3. $preview-height: 150px;
  4. .dropzone {
  5. position: relative;
  6. border-radius: $form-border-radius;
  7. min-height: 4rem;
  8. &.dz-clickable {
  9. cursor: pointer;
  10. }
  11. &.dz-drag-hover {
  12. border-color: rgba(0,0,0,0.15);
  13. background: rgba(0,0,0,0.04);
  14. }
  15. &.dz-started .dz-message {
  16. display: none;
  17. }
  18. .dz-message {
  19. opacity: 1;
  20. -ms-filter: none;
  21. filter: none;
  22. }
  23. .dz-preview {
  24. position: relative;
  25. display: inline-block;
  26. margin: 1rem 1rem 1.5rem 1rem;
  27. vertical-align: top;
  28. &.dz-file-preview [data-dz-thumbnail] {
  29. display: none;
  30. }
  31. &.dz-error .dz-error-mark {
  32. display: block;
  33. }
  34. &.dz-success .dz-success-mark {
  35. display: block;
  36. }
  37. .dz-success-mark, .dz-error-mark {
  38. font-family: FontAwesome;
  39. display: none;
  40. position: absolute;
  41. width: 22px;
  42. height: 22px;
  43. font-size: 18px;
  44. line-height: 25px;
  45. border-radius: 100%;
  46. text-align: center;
  47. right: 2px;
  48. top: 2px;
  49. span {
  50. display: none;
  51. }
  52. }
  53. &:hover {
  54. .dz-success-mark, .dz-error-mark {
  55. display: none;
  56. }
  57. }
  58. .dz-success-mark {
  59. &::after {
  60. content: '\f00c';
  61. }
  62. }
  63. .dz-error-mark {
  64. &::after {
  65. content: '\f12a';
  66. }
  67. }
  68. .dz-progress {
  69. position: absolute;
  70. top: $preview-height;
  71. left: 0px;
  72. right: 0px;
  73. height: 4px;
  74. display: none;
  75. .dz-upload {
  76. display: block;
  77. position: absolute;
  78. top: 0;
  79. bottom: 0;
  80. left: 0;
  81. width: 0%;
  82. }
  83. }
  84. .dz-error-message {
  85. display: none;
  86. position: absolute;
  87. top: 0;
  88. left: 0;
  89. right: 0;
  90. font-size: 0.9rem;
  91. line-height: 1.2;
  92. padding: 8px 10px;
  93. z-index: 500;
  94. }
  95. &.dz-processing .dz-progress {
  96. display: block;
  97. }
  98. &:hover {
  99. .dz-remove, .dz-unset, .dz-view, .dz-insert, .dz-metadata {
  100. display: block;
  101. }
  102. }
  103. &.dz-processing {
  104. &:hover {
  105. .dz-unset {
  106. display: none;
  107. }
  108. }
  109. }
  110. &:hover.dz-error .dz-error-message {
  111. display: block;
  112. }
  113. //.dz-remove, .dz-unset, .dz-insert {
  114. // display: none;
  115. //}
  116. .dz-filename {
  117. position: absolute;
  118. z-index: 1;
  119. bottom: 0;
  120. width: 100%;
  121. padding: 0 5px;
  122. background: rgba(0,0,0,0.3);
  123. color: #fff;
  124. text-align: center;
  125. white-space: nowrap;
  126. overflow: hidden;
  127. text-overflow: ellipsis;
  128. }
  129. .dz-remove, .dz-unset, .dz-view, .dz-insert, .dz-metadata {
  130. display: none;
  131. position: absolute;
  132. width: 25px;
  133. height: 25px;
  134. right: -26px;
  135. font-size: 0;
  136. cursor: pointer;
  137. &:hover {
  138. &:after {
  139. color: #fff;
  140. }
  141. }
  142. &:after {
  143. text-align: center;
  144. display: block;
  145. color: #999;
  146. font-family: FontAwesome;
  147. font-size: 18px;
  148. line-height: 25px;
  149. }
  150. }
  151. .dz-insert {
  152. top: -1px;
  153. border-top-right-radius: 4px;
  154. &:after {
  155. content: '\f055';
  156. }
  157. }
  158. .dz-view {
  159. top: 24px;
  160. &:after {
  161. content: '\f06e';
  162. }
  163. }
  164. .dz-remove {
  165. top: 72px;
  166. &:after {
  167. content: '\f1f8';
  168. }
  169. }
  170. .dz-unset {
  171. top: 96px;
  172. border-bottom-right-radius: 4px;
  173. &:after {
  174. content: '\f00d';
  175. }
  176. }
  177. .dz-metadata {
  178. top: 49px;
  179. &:after {
  180. content: '\f05a';
  181. }
  182. }
  183. &.dz-no-editor {
  184. .dz-view {
  185. top: -1px;
  186. border-top-right-radius: 4px;
  187. }
  188. .dz-remove {
  189. top: 24px;
  190. }
  191. .dz-unset {
  192. top: 72px;
  193. }
  194. }
  195. &:hover .dz-remove, &:hover .dz-unset {
  196. &.file-thumbnail-remove {
  197. display: block;
  198. }
  199. &:not(.file-thumbnail-remove) {
  200. border-left: 0;
  201. }
  202. }
  203. &.dz-processing {
  204. .dz-details {
  205. overflow: hidden;
  206. }
  207. }
  208. .dz-details {
  209. width: $preview-width;
  210. height: $preview-height;
  211. position: relative;
  212. font-size: 0.8rem;
  213. background-image: url('../images/transparent.png');
  214. img {
  215. position: absolute;
  216. object-fit: contain;
  217. top: 0;
  218. left: 0;
  219. width: $preview-width;
  220. height: $preview-height;
  221. }
  222. .dz-size {
  223. position: absolute;
  224. bottom: -28px;
  225. left: 0;
  226. right: 0;
  227. text-align: center;
  228. font-size: 0.8rem;
  229. height: 28px;
  230. line-height: 28px;
  231. }
  232. }
  233. }
  234. &.dz-clickable {
  235. .dz-message, .dz-message span {
  236. cursor: pointer;
  237. text-align: center;
  238. font-size: 1.2rem;
  239. line-height: 1.4;
  240. margin: 1rem 0;
  241. }
  242. }
  243. * {
  244. cursor: default;
  245. }
  246. }