tt-cropper.scss 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. $clipper-edge-border-width: 6rpx !default;
  2. .t-cropper {
  3. position: fixed;
  4. width: 100%;
  5. height: 100%;
  6. top: 0;
  7. bottom: 0;
  8. z-index: 1000;
  9. overflow: hidden;
  10. .canvas {
  11. position: absolute;
  12. top: 5000px;
  13. left: 5000px;
  14. }
  15. // 裁剪区域
  16. .t-preview-container {
  17. position: fixed;
  18. width: 100%;
  19. height: 100%;
  20. top: 0;
  21. bottom: 0;
  22. z-index: 1000;
  23. opacity: 0;
  24. overflow: hidden;
  25. .preview-body {
  26. position: absolute;
  27. left: 0;
  28. right: 0;
  29. top: 0;
  30. bottom: 0;
  31. background: #000;
  32. overflow: hidden;
  33. .mask-model {
  34. position: absolute;
  35. left: 0;
  36. right: 0;
  37. top: 0;
  38. bottom: 0;
  39. background: #000;
  40. opacity: 0.4;
  41. pointer-events: none;
  42. }
  43. .image-wrap {
  44. position: absolute;
  45. .image {
  46. position: absolute;
  47. }
  48. }
  49. // 裁剪框盒子
  50. .frame-box {
  51. position: absolute;
  52. left: 100px;
  53. top: 100px;
  54. width: 200px;
  55. height: 200px;
  56. // 矩形图片
  57. .rect {
  58. position: absolute;
  59. left: -2px;
  60. top: -2px;
  61. width: 100%;
  62. height: 100%;
  63. border: 2rpx solid white;
  64. overflow: hidden;
  65. box-sizing: content-box;
  66. .image-rect {
  67. position: absolute;
  68. .rect-img {
  69. position: absolute;
  70. }
  71. }
  72. }
  73. //裁剪框线条
  74. .line-one {
  75. position: absolute;
  76. width: 100%;
  77. border-top: 1px dashed #ccc;
  78. left: 0;
  79. top: 33.3%;
  80. box-sizing: content-box;
  81. }
  82. .line-two {
  83. position: absolute;
  84. width: 100%;
  85. border-top: 1px dashed #ccc;
  86. left: 0;
  87. top: 66.7%;
  88. box-sizing: content-box;
  89. }
  90. .line-three {
  91. position: absolute;
  92. height: 100%;
  93. border-right: 1px dashed #ccc;
  94. top: 0;
  95. left: 33.3%;
  96. box-sizing: content-box;
  97. }
  98. .line-four {
  99. position: absolute;
  100. height: 100%;
  101. border-right: 1px dashed #ccc;
  102. top: 0;
  103. left: 66.7%;
  104. box-sizing: content-box;
  105. }
  106. .frame-left-top {
  107. position: absolute;
  108. width: 20px;
  109. height: 20px;
  110. left: -8rpx;
  111. top: -8rpx;
  112. border-left: 4rpx solid #fff;
  113. border-top: 4rpx solid #fff;
  114. box-sizing: content-box;
  115. }
  116. .frame-left-bottom {
  117. position: absolute;
  118. width: 20px;
  119. height: 20px;
  120. left: -8rpx;
  121. bottom: -4rpx;
  122. border-left: 4rpx solid #fff;
  123. border-bottom: 4rpx solid #fff;
  124. box-sizing: content-box;
  125. }
  126. .frame-right-top {
  127. position: absolute;
  128. width: 20px;
  129. height: 20px;
  130. right: -4rpx;
  131. top: -8rpx;
  132. border-right: 4rpx solid #fff;
  133. border-top: 4rpx solid #fff;
  134. box-sizing: content-box;
  135. }
  136. .frame-right-bottom {
  137. position: absolute;
  138. width: 20px;
  139. height: 20px;
  140. right: -4rpx;
  141. bottom: -4rpx;
  142. border-right: 4rpx solid #fff;
  143. border-bottom: 4rpx solid #fff;
  144. box-sizing: content-box;
  145. }
  146. }
  147. }
  148. // 底部工具栏
  149. .toolbar {
  150. position: absolute;
  151. width: calc(100% - 64rpx);
  152. height: 100rpx;
  153. left: 0;
  154. bottom: 10rpx;
  155. text-align: center;
  156. display: flex;
  157. justify-content: space-between;
  158. padding: 0 32rpx;
  159. align-items: center;
  160. // IOS 底部安全距离
  161. padding-bottom: constant(safe-area-inset-bottom);
  162. padding-bottom: env(safe-area-inset-bottom);
  163. .btn-cancel {
  164. width: 112rpx;
  165. font-size: 28rpx;
  166. color: #d5dfe5;
  167. font-weight: bold;
  168. }
  169. .btn-rotate {
  170. width: 112rpx;
  171. font-size: 28rpx;
  172. color: #d5dfe5;
  173. font-weight: bold;
  174. image {
  175. width: 60rpx;
  176. height: 60rpx;
  177. }
  178. }
  179. .btn-confirm {
  180. font-size: 28rpx;
  181. color: #ffffff;
  182. font-weight: bold;
  183. width: 112rpx;
  184. height: 60rpx;
  185. line-height: 60rpx;
  186. background: #07c160;
  187. border-radius: 6rpx;
  188. text-align: center;
  189. }
  190. }
  191. .transit {
  192. transition: width 0.3s, height 0.3s, left 0.3s, top 0.3s, transform 0.3s;
  193. }
  194. }
  195. .showPage {
  196. opacity: 1 !important;
  197. }
  198. }