123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430 |
- /* pages/cropper/cropper.wxss */
- Page {
- /* 点的颜色 */
- --primary-color: rgb(255, 255, 255);
- /* 边框颜色 */
- --primary-color-outline: rgba(255, 255, 255, 0.75);
- /* 虚线颜色 */
- --primary-color-dashed: rgba(255, 255, 255, 0.46);
- /* 裁剪区域背景色 */
- --box-bg: transparent;
- /* 裁剪所有的背景色 */
- --cropper-bg: #000;
- }
- .wx-content-info {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: var(--cropper-bg);
- }
- .wx-content-info .cropper-content {
- min-height: calc(20%);
- width: 720rpx;
- margin: 0 auto;
- margin-top: 8rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- z-index: 2;
- bottom: 88rpx;
- }
- .wx-content-info .cropper-content .wx-corpper {
- position: relative;
- overflow: visible;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- -webkit-tap-highlight-color: transparent;
- -webkit-touch-callout: none;
- box-sizing: border-box;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content {
- position: relative;
- /* 内部的信息 */
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-content-bg {
- display: block;
- width: 100%;
- min-width: 0 !important;
- max-width: none !important;
- height: 100%;
- min-height: 0 !important;
- max-height: none !important;
- image-orientation: 0deg !important;
- margin: 0 auto;
- position: relative;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-content-bg .mask {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.7);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: var(--box-bg);
- z-index: 2;
- outline: 2500rpx solid rgba(0, 0, 0, 0.7);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box {
- position: relative;
- display: block;
- width: 100%;
- height: 100%;
- overflow: visible;
- outline: 1px solid var(--primary-color-outline);
- /* 横向虚线 */
- /* 纵向虚线 */
- /* 四个方向的线 为了之后的拖动事件*/
- /* 右下 */
- /* 右上 */
- /* 左下 */
- /* 左上 */
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-cropper-view-box-img {
- position: absolute;
- overflow: hidden;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-dashed-h {
- position: absolute;
- top: 33.33333333%;
- left: 0;
- width: 100%;
- height: 33.33333333%;
- border-top: 1px dashed var(--primary-color-dashed);
- border-bottom: 1px dashed var(--primary-color-dashed);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-dashed-v {
- position: absolute;
- left: 33.33333333%;
- top: 0;
- width: 33.33333333%;
- height: 100%;
- border-left: 1px dashed var(--primary-color-dashed);
- border-right: 1px dashed var(--primary-color-dashed);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-t {
- position: absolute;
- display: block;
- width: 100%;
- background-color: var(--primary-color);
- top: 0;
- left: 0;
- height: 1px;
- opacity: 0.1;
- cursor: n-resize;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-t::before {
- content: '';
- position: absolute;
- top: 50%;
- right: 0rpx;
- width: 100%;
- -webkit-transform: translate3d(0, -50%, 0);
- transform: translate3d(0, -50%, 0);
- bottom: 0;
- height: 41rpx;
- background: transparent;
- z-index: 11;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-r {
- position: absolute;
- display: block;
- background-color: var(--primary-color);
- top: 0;
- right: 0px;
- width: 1px;
- opacity: 0.1;
- height: 100%;
- cursor: e-resize;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-r::before {
- content: '';
- position: absolute;
- top: 0;
- left: 50%;
- width: 41rpx;
- -webkit-transform: translate3d(-50%, 0, 0);
- transform: translate3d(-50%, 0, 0);
- bottom: 0;
- height: 100%;
- background: transparent;
- z-index: 11;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-b {
- position: absolute;
- display: block;
- width: 100%;
- background-color: var(--primary-color);
- bottom: 0;
- left: 0;
- height: 1px;
- opacity: 0.1;
- cursor: s-resize;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-b::before {
- content: '';
- position: absolute;
- top: 50%;
- right: 0rpx;
- width: 100%;
- -webkit-transform: translate3d(0, -50%, 0);
- transform: translate3d(0, -50%, 0);
- bottom: 0;
- height: 41rpx;
- background: transparent;
- z-index: 11;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-l {
- position: absolute;
- display: block;
- background-color: var(--primary-color);
- top: 0;
- left: 0;
- width: 1px;
- opacity: 0.1;
- height: 100%;
- cursor: w-resize;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-line-l::before {
- content: '';
- position: absolute;
- top: 0;
- left: 50%;
- width: 41rpx;
- -webkit-transform: translate3d(-50%, 0, 0);
- transform: translate3d(-50%, 0, 0);
- bottom: 0;
- height: 100%;
- background: transparent;
- z-index: 11;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .wx-cropper-point {
- width: 5px;
- height: 5px;
- /* background-color: var(--primary-color); */
- opacity: .75;
- position: absolute;
- z-index: 3;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-t {
- top: -3px;
- left: 50%;
- margin-left: -3px;
- cursor: n-resize;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-r {
- top: 50%;
- left: 100%;
- margin-left: -3px;
- margin-top: -3px;
- cursor: n-resize;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt {
- cursor: n-resize;
- width: 29rpx;
- height: 29rpx;
- position: absolute;
- z-index: 1112;
- opacity: 1;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb {
- right: 0;
- bottom: 0;
- -webkit-transform: translate3d(50%, 50%, 0);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr {
- right: 0;
- top: 0;
- -webkit-transform: translate3d(50%, -50%, 0);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl {
- left: 0;
- bottom: 0;
- -webkit-transform: translate3d(-50%, 50%, 0);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt {
- top: 0;
- left: 0;
- -webkit-transform: translate3d(-50%, -50%, 0);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb::before,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb::after,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr::before,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr::after,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl::before,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl::after,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt::before,
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt::after {
- content: '';
- position: absolute;
- background-color: var(--primary-color);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb::before {
- width: 6rpx;
- height: 30rpx;
- right: calc(44%);
- bottom: calc(44%);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-rb::after {
- height: 6rpx;
- width: 30rpx;
- right: calc(44%);
- bottom: calc(44%);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr::before {
- width: 6rpx;
- height: 30rpx;
- right: calc(44%);
- top: calc(44%);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-tr::after {
- height: 6rpx;
- width: 30rpx;
- right: calc(44%);
- top: calc(44%);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl::before {
- width: 6rpx;
- height: 30rpx;
- left: calc(44%);
- bottom: calc(44%);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-bl::after {
- height: 6rpx;
- width: 30rpx;
- left: calc(44%);
- bottom: calc(44%);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt::before {
- width: 6rpx;
- height: 30rpx;
- left: calc(44%);
- top: calc(44%);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-lt::after {
- height: 6rpx;
- width: 30rpx;
- left: calc(44%);
- top: calc(44%);
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-b {
- left: 50%;
- top: 100%;
- margin-left: -3px;
- margin-top: -3px;
- cursor: n-resize;
- }
- .wx-content-info .cropper-content .wx-corpper .wx-corpper-content .wx-corpper-crop-box .wx-cropper-view-box .point-l {
- left: 0%;
- top: 50%;
- margin-left: -3px;
- margin-top: -3px;
- cursor: n-resize;
- }
- .wx-content-info .cropper-config {
- position: absolute;
- bottom: 100rpx;
- left: 0;
- right: 0;
- height: 88rpx;
- z-index: 3;
- display: flex;
- align-items: center;
- margin-left: 102rpx;
- margin-right: 102rpx;
- }
- .wx-content-info .cropper-config .cropper-cancle,
- .wx-content-info .cropper-config .cropper-save {
- color: #fff;
- font-size: 26rpx;
- padding: 15rpx 25px;
- display: block;
- font-weight: bold;
- width: 218rpx;
- border-radius: 44rpx;
- text-align: center;
- }
- .cropper-save-color {
- background: #6546A3;
- }
- .cropper-cancel-color {
- margin-right: 112rpx;
- background: rgba(0, 0, 0, 0.4);
- }
- /* 裁剪框预览内容 */
- .wx-cropper-viewer {
- position: relative;
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
- .wx-cropper-viewer image {
- position: absolute;
- z-index: 2;
- }
|