index.styl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. $clipper-edge-border-width ?= 6rpx
  2. $clipper-confirm-color ?= #07c160
  3. .flex-auto
  4. flex auto
  5. .bg-transparent
  6. background-color rgba(0, 0, 0, 0.9)
  7. transition-duration 0.35s
  8. .lime-clipper
  9. width 100vw
  10. height calc( 100vh - var(--window-top))
  11. background-color rgba(0, 0, 0, 0.9)
  12. position fixed
  13. top var(--window-top)
  14. left 300vw
  15. z-index 1
  16. &.open
  17. left 0
  18. &-mask
  19. position relative
  20. z-index 2
  21. pointer-events: none
  22. &__content
  23. pointer-events: none;
  24. position absolute
  25. border 1rpx solid rgba(255,255,255,.3)
  26. box-sizing border-box
  27. box-shadow: rgba(0, 0, 0, 0.5) 0 0 0 80vh;
  28. background: transparent;
  29. // transition-duration 0.35s
  30. // transition-property left,top
  31. &::before,&::after
  32. content ''
  33. position absolute
  34. border 1rpx dashed rgba(255,255,255,.3)
  35. &::before
  36. width 100%
  37. top 33.33%
  38. height 33.33%
  39. border-left none
  40. border-right none
  41. &::after
  42. width 33.33%
  43. left 33.33%
  44. height 100%
  45. border-top none
  46. border-bottom none
  47. &__edge
  48. position absolute
  49. // left 6rpx
  50. width 34rpx
  51. height 34rpx
  52. border $clipper-edge-border-width solid #ffffff
  53. pointer-events auto
  54. &::before
  55. content ''
  56. position absolute
  57. width 40rpx
  58. height 40rpx
  59. background-color transparent
  60. &:nth-child(1)
  61. left: - $clipper-edge-border-width
  62. top: - $clipper-edge-border-width
  63. border-bottom-width 0 !important
  64. border-right-width 0 !important
  65. &:before
  66. top -50%
  67. left -50%
  68. &:nth-child(2)
  69. right: - $clipper-edge-border-width
  70. top: - $clipper-edge-border-width
  71. border-bottom-width 0 !important
  72. border-left-width 0 !important
  73. &:before
  74. top -50%
  75. left 50%
  76. &:nth-child(3)
  77. left: - $clipper-edge-border-width
  78. bottom: - $clipper-edge-border-width
  79. border-top-width 0 !important
  80. border-right-width 0 !important
  81. &:before
  82. bottom -50%
  83. left -50%
  84. &:nth-child(4)
  85. right: - $clipper-edge-border-width
  86. bottom: - $clipper-edge-border-width
  87. border-top-width 0 !important
  88. border-left-width 0 !important
  89. &:before
  90. bottom -50%
  91. left 50%
  92. &-image
  93. width 100%
  94. max-width inherit
  95. border-style none
  96. position absolute
  97. top 0
  98. left 0
  99. z-index 1
  100. -webkit-backface-visibility hidden
  101. backface-visibility hidden
  102. transform-origin center
  103. &-canvas
  104. position fixed
  105. z-index 10
  106. left -200vw
  107. top -200vw
  108. pointer-events none
  109. &-tools
  110. position absolute
  111. left 0
  112. bottom 10px
  113. width 100%
  114. z-index 99
  115. color #fff
  116. &__btns
  117. font-weight bold
  118. display flex
  119. align-items center
  120. justify-content space-between
  121. width 100%
  122. padding 20rpx 40rpx
  123. box-sizing border-box
  124. .cancel
  125. width 112rpx
  126. height 60rpx
  127. text-align center
  128. line-height 60rpx
  129. .confirm
  130. width 112rpx
  131. height 60rpx
  132. line-height 60rpx
  133. background var(--lime-clipper-confirm-color, $clipper-confirm-color)
  134. border-radius 6rpx
  135. text-align center
  136. image
  137. display block
  138. width 60rpx
  139. height 60rpx