yhdsl-cropper.wxss 5.8 KB

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