index.wxss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. /* pages/cropper/cropper.wxss */
  2. Page {
  3. /* 点的颜色 */
  4. --primary-color: rgb(255, 255, 255);
  5. /* 边框颜色 */
  6. --primary-color-outline: rgba(255, 255, 255, 0.75);
  7. /* 虚线颜色 */
  8. --primary-color-dashed: rgba(255, 255, 255, 0.46);
  9. /* 裁剪区域背景色 */
  10. --box-bg: transparent;
  11. /* 裁剪所有的背景色 */
  12. --cropper-bg: #000;
  13. }
  14. .wx-content-info {
  15. position: fixed;
  16. top: 0;
  17. left: 0;
  18. right: 0;
  19. bottom: 0;
  20. background: var(--cropper-bg);
  21. }
  22. .wx-content-info .cropper-content {
  23. min-height: calc(20%);
  24. width: 720rpx;
  25. margin: 0 auto;
  26. margin-top: 8rpx;
  27. display: flex;
  28. align-items: center;
  29. justify-content: center;
  30. position: absolute;
  31. top: 0;
  32. left: 0;
  33. right: 0;
  34. z-index: 2;
  35. bottom: 88rpx;
  36. }
  37. .wx-content-info .cropper-content .wx-corpper {
  38. position: relative;
  39. overflow: visible;
  40. -webkit-user-select: none;
  41. -moz-user-select: none;
  42. -ms-user-select: none;
  43. user-select: none;
  44. -webkit-tap-highlight-color: transparent;
  45. -webkit-touch-callout: none;
  46. box-sizing: border-box;
  47. }
  48. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content {
  49. position: relative;
  50. /* 内部的信息 */
  51. }
  52. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-content-bg {
  53. display: block;
  54. width: 100%;
  55. min-width: 0 !important;
  56. max-width: none !important;
  57. height: 100%;
  58. min-height: 0 !important;
  59. max-height: none !important;
  60. image-orientation: 0deg !important;
  61. margin: 0 auto;
  62. position: relative;
  63. }
  64. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-content-bg .mask{
  65. position: absolute;
  66. top: 0;
  67. left: 0;
  68. right: 0;
  69. bottom: 0;
  70. background: rgba(0, 0, 0, 0.7);
  71. }
  72. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box {
  73. position: absolute;
  74. top: 0;
  75. left: 0;
  76. right: 0;
  77. bottom: 0;
  78. background: var(--box-bg);
  79. z-index: 2;
  80. outline: 2500rpx solid rgba(0, 0, 0, 0.7);
  81. }
  82. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box {
  83. position: relative;
  84. display: block;
  85. width: 100%;
  86. height: 100%;
  87. overflow: visible;
  88. outline: 1px solid var(--primary-color-outline);
  89. /* 横向虚线 */
  90. /* 纵向虚线 */
  91. /* 四个方向的线 为了之后的拖动事件*/
  92. /* 右下 */
  93. /* 右上 */
  94. /* 左下 */
  95. /* 左上 */
  96. }
  97. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-cropper-view-box-img {
  98. position: absolute;
  99. overflow: hidden;
  100. }
  101. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-dashed-h {
  102. position: absolute;
  103. top: 33.33333333%;
  104. left: 0;
  105. width: 100%;
  106. height: 33.33333333%;
  107. border-top: 1px dashed var(--primary-color-dashed);
  108. border-bottom: 1px dashed var(--primary-color-dashed);
  109. }
  110. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-dashed-v {
  111. position: absolute;
  112. left: 33.33333333%;
  113. top: 0;
  114. width: 33.33333333%;
  115. height: 100%;
  116. border-left: 1px dashed var(--primary-color-dashed);
  117. border-right: 1px dashed var(--primary-color-dashed);
  118. }
  119. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-t {
  120. position: absolute;
  121. display: block;
  122. width: 100%;
  123. background-color: var(--primary-color);
  124. top: 0;
  125. left: 0;
  126. height: 1px;
  127. opacity: 0.1;
  128. cursor: n-resize;
  129. }
  130. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-t::before {
  131. content: '';
  132. position: absolute;
  133. top: 50%;
  134. right: 0rpx;
  135. width: 100%;
  136. -webkit-transform: translate3d(0, -50%, 0);
  137. transform: translate3d(0, -50%, 0);
  138. bottom: 0;
  139. height: 41rpx;
  140. background: transparent;
  141. z-index: 11;
  142. }
  143. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-r {
  144. position: absolute;
  145. display: block;
  146. background-color: var(--primary-color);
  147. top: 0;
  148. right: 0px;
  149. width: 1px;
  150. opacity: 0.1;
  151. height: 100%;
  152. cursor: e-resize;
  153. }
  154. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-r::before {
  155. content: '';
  156. position: absolute;
  157. top: 0;
  158. left: 50%;
  159. width: 41rpx;
  160. -webkit-transform: translate3d(-50%, 0, 0);
  161. transform: translate3d(-50%, 0, 0);
  162. bottom: 0;
  163. height: 100%;
  164. background: transparent;
  165. z-index: 11;
  166. }
  167. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-b {
  168. position: absolute;
  169. display: block;
  170. width: 100%;
  171. background-color: var(--primary-color);
  172. bottom: 0;
  173. left: 0;
  174. height: 1px;
  175. opacity: 0.1;
  176. cursor: s-resize;
  177. }
  178. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-b::before {
  179. content: '';
  180. position: absolute;
  181. top: 50%;
  182. right: 0rpx;
  183. width: 100%;
  184. -webkit-transform: translate3d(0, -50%, 0);
  185. transform: translate3d(0, -50%, 0);
  186. bottom: 0;
  187. height: 41rpx;
  188. background: transparent;
  189. z-index: 11;
  190. }
  191. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-l {
  192. position: absolute;
  193. display: block;
  194. background-color: var(--primary-color);
  195. top: 0;
  196. left: 0;
  197. width: 1px;
  198. opacity: 0.1;
  199. height: 100%;
  200. cursor: w-resize;
  201. }
  202. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-l::before {
  203. content: '';
  204. position: absolute;
  205. top: 0;
  206. left: 50%;
  207. width: 41rpx;
  208. -webkit-transform: translate3d(-50%, 0, 0);
  209. transform: translate3d(-50%, 0, 0);
  210. bottom: 0;
  211. height: 100%;
  212. background: transparent;
  213. z-index: 11;
  214. }
  215. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-point {
  216. width: 5px;
  217. height: 5px;
  218. /* background-color: var(--primary-color); */
  219. opacity: .75;
  220. position: absolute;
  221. z-index: 3;
  222. }
  223. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-t {
  224. top: -3px;
  225. left: 50%;
  226. margin-left: -3px;
  227. cursor: n-resize;
  228. }
  229. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-r {
  230. top: 50%;
  231. left: 100%;
  232. margin-left: -3px;
  233. margin-top: -3px;
  234. cursor: n-resize;
  235. }
  236. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr,
  237. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb,
  238. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl,
  239. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt {
  240. cursor: n-resize;
  241. width: 29rpx;
  242. height: 29rpx;
  243. position: absolute;
  244. z-index: 1112;
  245. opacity: 1;
  246. }
  247. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb {
  248. right: 0;
  249. bottom: 0;
  250. -webkit-transform: translate3d(50%, 50%, 0);
  251. }
  252. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr {
  253. right: 0;
  254. top: 0;
  255. -webkit-transform: translate3d(50%, -50%, 0);
  256. }
  257. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl {
  258. left: 0;
  259. bottom: 0;
  260. -webkit-transform: translate3d(-50%, 50%, 0);
  261. }
  262. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt {
  263. top: 0;
  264. left: 0;
  265. -webkit-transform: translate3d(-50%, -50%, 0);
  266. }
  267. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb::before,
  268. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb::after,
  269. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr::before,
  270. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr::after,
  271. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl::before,
  272. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl::after,
  273. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt::before,
  274. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt::after {
  275. content: '';
  276. position: absolute;
  277. background-color: var(--primary-color);
  278. }
  279. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb::before {
  280. width: 6rpx;
  281. height: 30rpx;
  282. right: calc(44%);
  283. bottom: calc(44%);
  284. }
  285. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb::after {
  286. height: 6rpx;
  287. width: 30rpx;
  288. right: calc(44%);
  289. bottom: calc(44%);
  290. }
  291. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr::before {
  292. width: 6rpx;
  293. height: 30rpx;
  294. right: calc(44%);
  295. top: calc(44%);
  296. }
  297. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr::after {
  298. height: 6rpx;
  299. width: 30rpx;
  300. right: calc(44%);
  301. top: calc(44%);
  302. }
  303. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl::before {
  304. width: 6rpx;
  305. height: 30rpx;
  306. left: calc(44%);
  307. bottom: calc(44%);
  308. }
  309. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl::after {
  310. height: 6rpx;
  311. width: 30rpx;
  312. left: calc(44%);
  313. bottom: calc(44%);
  314. }
  315. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt::before {
  316. width: 6rpx;
  317. height: 30rpx;
  318. left: calc(44%);
  319. top: calc(44%);
  320. }
  321. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt::after {
  322. height: 6rpx;
  323. width: 30rpx;
  324. left: calc(44%);
  325. top: calc(44%);
  326. }
  327. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-b {
  328. left: 50%;
  329. top: 100%;
  330. margin-left: -3px;
  331. margin-top: -3px;
  332. cursor: n-resize;
  333. }
  334. .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-l {
  335. left: 0%;
  336. top: 50%;
  337. margin-left: -3px;
  338. margin-top: -3px;
  339. cursor: n-resize;
  340. }
  341. .wx-content-info .cropper-config {
  342. position: absolute;
  343. bottom: 0;
  344. left: 0;
  345. right: 0;
  346. height: 80rpx;
  347. z-index: 3;
  348. width: 100%;
  349. display: flex;
  350. align-items: center;
  351. justify-content: space-between;
  352. border-top: 1px solid rgba(255, 255, 255, 0.12);
  353. }
  354. .wx-content-info .cropper-config .cropper-cancle,
  355. .wx-content-info .cropper-config .cropper-save {
  356. color: #fff;
  357. font-size: 26rpx;
  358. padding: 15rpx 25px;
  359. display: block;
  360. }
  361. /* 裁剪框预览内容 */
  362. .wx-cropper-viewer {
  363. position: relative;
  364. width: 100%;
  365. height: 100%;
  366. overflow: hidden;
  367. }
  368. .wx-cropper-viewer image {
  369. position: absolute;
  370. z-index: 2;
  371. }