-
Notifications
You must be signed in to change notification settings - Fork 44
/
Annotator.scss
279 lines (235 loc) · 6.02 KB
/
Annotator.scss
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
@import 'common';
.ba-annotate-mode-background {
background-color: $fours;
}
.ba-mode-header,
.bp-header.ba-mode-header {
background-color: $twos;
border: none;
position: relative;
}
.bp-header button.ba-btn-annotate-point-exit,
.bp-header button.ba-btn-annotate-draw-cancel {
background-color: $twos;
border: solid $off-white 1px;
color: $off-white;
&:hover {
background-color: $black;
}
}
.bp-header button.ba-btn-annotate-draw-post {
background-color: $off-white;
color: $twos;
&:hover {
background-color: $white;
}
}
.bp-container .ba-point-post-cancel-container,
.bp-container .ba-draw-post-cancel-container {
margin-right: 20px;
position: absolute;
right: 0;
top: 0;
button {
height: 32px;
margin: 8px;
}
}
.bp-container .ba-draw-undo-redo-container {
margin: 0 auto;
.is-disabled.ba-btn-annotate-draw-undo,
.is-disabled.ba-btn-annotate-draw-redo,
.ba-btn-annotate-draw-undo,
.ba-btn-annotate-draw-redo,
button.ba-btn-annotate-draw-undo,
button.ba-btn-annotate-draw-redo {
background: none;
border: none;
margin: 5px;
svg {
fill: $off-white;
vertical-align: middle;
}
}
}
//------------------------------------------------------------------------------
// CSS for points and dialogs
//------------------------------------------------------------------------------
.ba-point-annotation-marker {
background-color: transparent;
border-style: none;
cursor: pointer;
padding: 0;
position: absolute;
width: 24px;
svg {
fill: fade-out($box-blue, .35);
transition: fill .5s;
}
&:hover svg {
fill: $box-blue;
}
}
//------------------------------------------------------------------------------
// CSS for highlights
//------------------------------------------------------------------------------
.ba-highlight-dialog {
border-top: 20px solid transparent; // Transparent border for hover detection
color: $fours;
display: table;
font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
position: absolute;
z-index: 130;
}
.ba-annotation-drawing-dialog,
.ba-annotation-highlight-dialog,
.ba-annotation-highlight-dialog:hover {
background-color: $white;
border: 1px solid $seesee;
border-radius: 3px;
font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 5px 6px;
// Center buttons
.ba-add-highlight-btn {
padding-top: 1px;
}
.ba-highlight-comment-btn {
padding-top: 3px;
}
.ba-btn-annotate-draw-add,
.ba-btn-annotate-draw-delete {
color: lighten($better-black, 10%);
padding: 8px;
&:hover,
&:active {
color: $better-black;
padding: 8px;
}
}
.ba-btn-annotate-draw-delete,
.ba-btn-annotate-draw-delete:active,
.ba-btn-annotate-draw-delete:hover,
.ba-btn-annotate-draw-add,
.ba-btn-annotate-draw-add:active,
.ba-btn-annotate-draw-add:hover {
font-size: 13px;
margin-top: -3px;
padding: 4px;
}
}
.ba-create-highlight-comment {
background-color: #fff;
overflow-x: hidden;
overflow-y: auto;
padding: 10px 9px;
white-space: normal;
}
.bp-use-default-cursor {
cursor: default;
// Overrides pdf_viewer.css
.textLayer > div {
cursor: default;
}
}
.ba-annotation-layer-highlight,
.ba-annotation-layer-highlight-comment {
cursor: text;
left: 0;
mix-blend-mode: multiply;
position: absolute;
top: 15px; // Match 15px padding top on page
}
// Quad point positioning - the helper divs are positioned relative to the Rangy-created element
.bp-doc .rangy-highlight {
background-color: $highlight-yellow;
position: relative;
}
// These helper divs allow us to calculate the quad points of an element
.ba-quad-corner-container {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.ba-quad-corner {
background: none;
height: 0;
position: absolute;
width: 0;
&.corner1 {
bottom: 0;
left: 0;
}
&.corner2 {
bottom: 0;
right: 0;
}
&.corner3 {
right: 0;
top: 0;
}
&.corner4 {
left: 0;
top: 0;
}
}
//------------------------------------------------------------------------------
// Draw annotation mode
//------------------------------------------------------------------------------
.ba-annotation-draw-boundary {
animation: dash 1s linear infinite;
fill: none;
stroke: rgb(0, 0, 0);
stroke-dasharray: 5;
stroke-width: 3px;
}
@keyframes dash {
from {
stroke-dashoffset: 10;
}
to {
stroke-dashoffset: 0;
}
}
.ba-annotation-draw .textLayer {
pointer-events: none;
> div {
pointer-events: auto;
}
}
.ba-annotation-layer-draw,
.ba-annotation-layer-draw-in-progress {
left: 0;
mix-blend-mode: multiply;
position: absolute;
top: 15px; // Match 15px padding top on page
}
.ba-drawing-boundary {
border: 2px dashed $sevens;
position: absolute;
}
//------------------------------------------------------------------------------
// Annotation mode
//------------------------------------------------------------------------------
.ba-annotation-mode .page,
.ba-annotation-mode .ba-annotation-layer-highlight,
.ba-annotation-mode .ba-annotation-layer-highlight-comment,
.ba-annotation-mode .textLayer > div,
.ba-annotation-mode > img,
.ba-annotation-mode img {
cursor: crosshair;
}
.ba-draw-mode .ba-point-annotation-marker {
cursor: crosshair;
&:focus {
outline: none;
}
}
// Needed to allow point annotations since PDF.js adds a funky mousedown handler
// that helps with text selection - we need to disable this since it interacts
// badly with point annotations on non-text divs in non-Chrome browsers
.ba-annotation-mode .textLayer > div,
.ba-annotation-mode .textLayer .endOfContent {
pointer-events: none;
}