index.wxss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. /* pages/uni-cropper/index.wxss */
  2. .uni-content-info {
  3. /* position: fixed;
  4. top: 0;
  5. left: 0;
  6. right: 0;
  7. bottom: 0;
  8. display: block;
  9. align-items: center;
  10. flex-direction: column; */
  11. }
  12. .cropper-config {
  13. padding: 20rpx 40rpx;
  14. }
  15. .cropper-content {
  16. min-height: 750rpx;
  17. width: 100%;
  18. }
  19. .uni-corpper {
  20. position: relative;
  21. overflow: hidden;
  22. -webkit-user-select: none;
  23. user-select: none;
  24. -webkit-tap-highlight-color: transparent;
  25. -webkit-touch-callout: none;
  26. box-sizing: border-box;
  27. }
  28. .uni-corpper-content {
  29. position: relative;
  30. }
  31. .uni-corpper-content image {
  32. display: block;
  33. width: 100%;
  34. min-width: 0 !important;
  35. max-width: none !important;
  36. height: 100%;
  37. min-height: 0 !important;
  38. max-height: none !important;
  39. image-orientation: 0deg !important;
  40. margin: 0 auto;
  41. }
  42. /* 移动图片效果 */
  43. .uni-cropper-drag-box {
  44. position: absolute;
  45. top: 0;
  46. right: 0;
  47. bottom: 0;
  48. left: 0;
  49. cursor: move;
  50. background: rgba(0, 0, 0, 0.6);
  51. z-index: 1;
  52. }
  53. /* 内部的信息 */
  54. .uni-corpper-crop-box {
  55. position: absolute;
  56. background: rgba(255, 255, 255, 0.3);
  57. z-index: 2;
  58. }
  59. .uni-corpper-crop-box .uni-cropper-view-box {
  60. position: relative;
  61. display: block;
  62. width: 100%;
  63. height: 100%;
  64. overflow: visible;
  65. outline: 1rpx solid #69f;
  66. outline-color: rgba(102, 153, 255, .75)
  67. }
  68. /* 横向虚线 */
  69. .uni-cropper-dashed-h {
  70. position: absolute;
  71. top: 33.33333333%;
  72. left: 0;
  73. width: 100%;
  74. height: 33.33333333%;
  75. border-top: 1rpx dashed rgba(255, 255, 255, 0.5);
  76. border-bottom: 1rpx dashed rgba(255, 255, 255, 0.5);
  77. }
  78. /* 纵向虚线 */
  79. .uni-cropper-dashed-v {
  80. position: absolute;
  81. left: 33.33333333%;
  82. top: 0;
  83. width: 33.33333333%;
  84. height: 100%;
  85. border-left: 1rpx dashed rgba(255, 255, 255, 0.5);
  86. border-right: 1rpx dashed rgba(255, 255, 255, 0.5);
  87. }
  88. /* 四个方向的线 为了之后的拖动事件*/
  89. .uni-cropper-line-t {
  90. position: absolute;
  91. display: block;
  92. width: 100%;
  93. background-color: #69f;
  94. top: 0;
  95. left: 0;
  96. height: 1rpx;
  97. opacity: 0.1;
  98. cursor: n-resize;
  99. }
  100. .uni-cropper-line-t::before {
  101. content: '';
  102. position: absolute;
  103. top: 50%;
  104. right: 0rpx;
  105. width: 100%;
  106. -webkit-transform: translate3d(0, -50%, 0);
  107. transform: translate3d(0, -50%, 0);
  108. bottom: 0;
  109. height: 41rpx;
  110. background: transparent;
  111. z-index: 11;
  112. }
  113. .uni-cropper-line-r {
  114. position: absolute;
  115. display: block;
  116. background-color: #69f;
  117. top: 0;
  118. right: 0rpx;
  119. width: 1rpx;
  120. opacity: 0.1;
  121. height: 100%;
  122. cursor: e-resize;
  123. }
  124. .uni-cropper-line-r::before {
  125. content: '';
  126. position: absolute;
  127. top: 0;
  128. left: 50%;
  129. width: 41rpx;
  130. -webkit-transform: translate3d(-50%, 0, 0);
  131. transform: translate3d(-50%, 0, 0);
  132. bottom: 0;
  133. height: 100%;
  134. background: transparent;
  135. z-index: 11;
  136. }
  137. .uni-cropper-line-b {
  138. position: absolute;
  139. display: block;
  140. width: 100%;
  141. background-color: #69f;
  142. bottom: 0;
  143. left: 0;
  144. height: 1rpx;
  145. opacity: 0.1;
  146. cursor: s-resize;
  147. }
  148. .uni-cropper-line-b::before {
  149. content: '';
  150. position: absolute;
  151. top: 50%;
  152. right: 0rpx;
  153. width: 100%;
  154. -webkit-transform: translate3d(0, -50%, 0);
  155. transform: translate3d(0, -50%, 0);
  156. bottom: 0;
  157. height: 41rpx;
  158. background: transparent;
  159. z-index: 11;
  160. }
  161. .uni-cropper-line-l {
  162. position: absolute;
  163. display: block;
  164. background-color: #69f;
  165. top: 0;
  166. left: 0;
  167. width: 1rpx;
  168. opacity: 0.1;
  169. height: 100%;
  170. cursor: w-resize;
  171. }
  172. .uni-cropper-line-l::before {
  173. content: '';
  174. position: absolute;
  175. top: 0;
  176. left: 50%;
  177. width: 41rpx;
  178. -webkit-transform: translate3d(-50%, 0, 0);
  179. transform: translate3d(-50%, 0, 0);
  180. bottom: 0;
  181. height: 100%;
  182. background: transparent;
  183. z-index: 11;
  184. }
  185. .uni-cropper-point {
  186. width: 5rpx;
  187. height: 5rpx;
  188. background-color: #69f;
  189. opacity: .75;
  190. position: absolute;
  191. z-index: 3;
  192. }
  193. .point-t {
  194. top: -3rpx;
  195. left: 50%;
  196. margin-left: -3rpx;
  197. cursor: n-resize;
  198. }
  199. .point-tr {
  200. top: -3rpx;
  201. left: 100%;
  202. margin-left: -3rpx;
  203. cursor: n-resize;
  204. }
  205. .point-r {
  206. top: 50%;
  207. left: 100%;
  208. margin-left: -3rpx;
  209. margin-top: -3rpx;
  210. cursor: n-resize;
  211. }
  212. .point-rb {
  213. left: 100%;
  214. top: 100%;
  215. -webkit-transform: translate3d(-50%, -50%, 0);
  216. transform: translate3d(-50%, -50%, 0);
  217. cursor: n-resize;
  218. width: 36rpx;
  219. height: 36rpx;
  220. background-color: #69f;
  221. position: absolute;
  222. z-index: 1112;
  223. opacity: 1;
  224. }
  225. .point-b {
  226. left: 50%;
  227. top: 100%;
  228. margin-left: -3rpx;
  229. margin-top: -3rpx;
  230. cursor: n-resize;
  231. }
  232. .point-bl {
  233. left: 0%;
  234. top: 100%;
  235. margin-left: -3rpx;
  236. margin-top: -3rpx;
  237. cursor: n-resize;
  238. }
  239. .point-l {
  240. left: 0%;
  241. top: 50%;
  242. margin-left: -3rpx;
  243. margin-top: -3rpx;
  244. cursor: n-resize;
  245. }
  246. .point-lt {
  247. left: 0%;
  248. top: 0%;
  249. margin-left: -3rpx;
  250. margin-top: -3rpx;
  251. cursor: n-resize;
  252. }
  253. /* 裁剪框预览内容 */
  254. .uni-cropper-viewer {
  255. position: relative;
  256. width: 100%;
  257. height: 100%;
  258. overflow: hidden;
  259. }
  260. .uni-cropper-viewer image {
  261. position: absolute;
  262. z-index: 2;
  263. }