_dropzone.scss 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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-view, .dz-insert, .dz-metadata {
  100. display: block;
  101. }
  102. }
  103. &:hover.dz-error .dz-error-message {
  104. display: block;
  105. }
  106. //.dz-remove, .dz-insert {
  107. // display: none;
  108. //}
  109. .dz-filename {
  110. position: absolute;
  111. z-index: 1;
  112. bottom: 0;
  113. width: 100%;
  114. padding: 0 5px;
  115. background: rgba(0,0,0,0.3);
  116. color: #fff;
  117. text-align: center;
  118. white-space: nowrap;
  119. overflow: hidden;
  120. text-overflow: ellipsis;
  121. }
  122. .dz-remove, .dz-view, .dz-insert, .dz-metadata {
  123. display: none;
  124. position: absolute;
  125. width: 25px;
  126. height: 25px;
  127. right: -25px;
  128. font-size: 0;
  129. cursor: pointer;
  130. &:hover {
  131. &:after {
  132. color: #fff;
  133. }
  134. }
  135. &:after {
  136. text-align: center;
  137. display: block;
  138. color: #999;
  139. font-family: FontAwesome;
  140. font-size: 18px;
  141. line-height: 25px;
  142. }
  143. }
  144. .dz-insert {
  145. top: -1px;
  146. border-top-right-radius: 4px;
  147. &:after {
  148. content: '\f055';
  149. }
  150. }
  151. .dz-view {
  152. top: 24px;
  153. &:after {
  154. content: '\f06e';
  155. }
  156. }
  157. .dz-remove {
  158. top: 72px;
  159. border-bottom-right-radius: 4px;
  160. &:after {
  161. content: '\f00d';
  162. }
  163. }
  164. .dz-metadata {
  165. top: 49px;
  166. &:after {
  167. content: '\f05a';
  168. }
  169. }
  170. &.dz-no-editor {
  171. .dz-view {
  172. top: -1px;
  173. border-top-right-radius: 4px;
  174. }
  175. .dz-remove {
  176. top: 24px;
  177. }
  178. }
  179. //&:hover .dz-remove:not(.file-thumbnail-remove), &:hover .dz-insert {
  180. // display: block;
  181. // position: absolute;
  182. // left: 0;
  183. // right: 0;
  184. // bottom: 22px;
  185. // width: 50%;
  186. // text-align: center;
  187. // cursor: pointer;
  188. // font-size: 0.8rem;
  189. //}
  190. &:hover .dz-remove {
  191. &.file-thumbnail-remove {
  192. display: block;
  193. }
  194. &:not(.file-thumbnail-remove) {
  195. left: inherit;
  196. border-left: 0;
  197. }
  198. }
  199. //&:hover .dz-insert {
  200. // right: inherit;
  201. //}
  202. //
  203. //&.hide-backface:hover {
  204. // .dz-remove, .dz-insert {
  205. // display: none;
  206. // }
  207. //}
  208. &.dz-processing {
  209. .dz-details {
  210. overflow: hidden;
  211. img {
  212. position: absolute;
  213. left: 50%;
  214. top: 50%;
  215. height: auto;
  216. width: 100%;
  217. -webkit-transform: translate(-50%,-50%);
  218. -ms-transform: translate(-50%,-50%);
  219. transform: translate(-50%,-50%);
  220. }
  221. }
  222. }
  223. .dz-details {
  224. width: $preview-width;
  225. height: $preview-height;
  226. position: relative;
  227. font-size: 0.8rem;
  228. img {
  229. position: absolute;
  230. top: 0;
  231. left: 0;
  232. width: $preview-width;
  233. height: $preview-height;
  234. }
  235. .dz-size {
  236. position: absolute;
  237. bottom: -28px;
  238. left: 0;
  239. right: 0;
  240. text-align: center;
  241. font-size: 0.8rem;
  242. height: 28px;
  243. line-height: 28px;
  244. }
  245. }
  246. }
  247. &.dz-clickable {
  248. .dz-message, .dz-message span {
  249. cursor: pointer;
  250. text-align: center;
  251. font-size: 1.2rem;
  252. line-height: 1.4;
  253. margin: 1rem 0;
  254. }
  255. }
  256. * {
  257. cursor: default;
  258. }
  259. }