File size: 3,169 Bytes
74aacd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
@use 'sass:math';

$drag-handle-shortside: 12px;
$drag-handle-longside: 40px;
$drag-bar-size: 12px;

$half-handle-shortside: math.div($drag-handle-shortside, 2);
$half-handle-longside: math.div($drag-handle-longside, 2);
$half-drag-bar-size: math.div($drag-bar-size, 2);

.crop-border {
  outline-color: var(--yellow-accent);
  outline-style: dashed;
}

.info-bar {
  position: absolute;
  pointer-events: auto;
  font-size: 1rem;
  padding: 0.2rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-color);
  background-color: var(--page-bg);
  border-radius: 9999px;

  border: var(--editor-toolkit-panel-border);
  box-shadow: 0 0 0 1px #0000001a, 0 3px 16px #00000014, 0 2px 6px 1px #00000017;

  &:hover {
    cursor: move;
  }
}

.croper-wrapper {
  position: absolute;
  height: 100%;
  width: 100%;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.croper {
  position: relative;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;

  // display: flex;
  // flex-direction: column;
  // align-items: center;

  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.drag-bar {
  position: absolute;
  pointer-events: auto;
  // display: none;

  &.ord-top {
    top: 0;
    left: 0;
    width: 100%;
    height: $drag-bar-size;
    margin-top: -$half-drag-bar-size;
    cursor: ns-resize;
  }
  &.ord-right {
    right: 0;
    top: 0;
    width: $drag-bar-size;
    height: 100%;
    margin-right: -$half-drag-bar-size;
    cursor: ew-resize;
  }
  &.ord-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: $drag-bar-size;
    margin-bottom: -$half-drag-bar-size;
    cursor: ns-resize;
  }
  &.ord-left {
    top: 0;
    left: 0;
    width: $drag-bar-size;
    height: 100%;
    margin-left: -$half-drag-bar-size;
    cursor: ew-resize;
  }
}

.drag-handle {
  width: $drag-handle-shortside;
  height: $drag-handle-shortside;
  z-index: 4;
  position: absolute;
  display: block;
  content: '';
  border: 2px solid var(--yellow-accent);
  background-color: var(--yellow-accent-light);
  pointer-events: auto;

  &:hover {
    background-color: var(--yellow-accent);
  }

  &.ord-topleft {
    cursor: nw-resize;
    top: (-$half-handle-shortside)-1px;
    left: (-$half-handle-shortside)-1px;
  }

  &.ord-topright {
    cursor: ne-resize;
    top: -($half-handle-shortside)-1px;
    right: -($half-handle-shortside)-1px;
  }

  &.ord-bottomright {
    cursor: se-resize;
    bottom: -($half-handle-shortside)-1px;
    right: -($half-handle-shortside)-1px;
  }

  &.ord-bottomleft {
    cursor: sw-resize;
    bottom: -($half-handle-shortside)-1px;
    left: -($half-handle-shortside)-1px;
  }

  &.ord-top,
  &.ord-bottom {
    left: calc(50% - $half-handle-shortside);
    cursor: ns-resize;
  }

  &.ord-top {
    top: (-$half-handle-shortside)-1px;
  }

  &.ord-bottom {
    bottom: -($half-handle-shortside)-1px;
  }

  &.ord-left,
  &.ord-right {
    top: calc(50% - $half-handle-shortside);
    cursor: ew-resize;
  }

  &.ord-left {
    left: (-$half-handle-shortside)-1px;
  }

  &.ord-right {
    right: -($half-handle-shortside)-1px;
  }
}