Skip to content

Commit a2bc2e8

Browse files
committed
Adjust dark-theme styling
1 parent 6ef42af commit a2bc2e8

File tree

21 files changed

+676
-668
lines changed

21 files changed

+676
-668
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ root = true
22

33
[*]
44
indent_style = space
5-
indent_size = 2
5+
indent_size = 4
66
end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true

index.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/fieldMethods.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
return $field->value != 'rect';
2121
},
2222
'toPercent' => function($field) {
23-
return floatval($field->value) * 100;
23+
return floatval($field->value) * 100;
2424
},
2525
'toPercentString' => function($field) {
2626
// Floatval isn't locale aware and outputs commas instead of dots for decimal separator
2727
// This doesn't work in CSS, which expects a dot
28-
return str_replace(',','.', floatval($field->value) * 100) . '%';
28+
return str_replace(',','.', floatval($field->value) * 100) . '%';
2929
},
3030
);

lib/functions.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
22

33
function markerStyle($marker) {
4-
$style = 'left:'. $marker->x()->toPercentString() .';';
5-
$style .= ' top:'. $marker->y()->toPercentString() .';';
4+
$style = 'left:'. $marker->x()->toPercentString() .';';
5+
$style .= ' top:'. $marker->y()->toPercentString() .';';
66

7-
if($marker->type()->isNotPin()) {
8-
$style .= ' width:'. $marker->w()->toPercentString() .';';
9-
$style .= ' height:'. $marker->h()->toPercentString() .';';
10-
}
7+
if($marker->type()->isNotPin()) {
8+
$style .= ' width:'. $marker->w()->toPercentString() .';';
9+
$style .= ' height:'. $marker->h()->toPercentString() .';';
10+
}
1111

12-
if($marker->type()->isCircle()) {
13-
$style .= ' border-radius:50%;';
14-
$style .= ' transform:translate(-50%, -50%);';
15-
}
12+
if($marker->type()->isCircle()) {
13+
$style .= ' border-radius:50%;';
14+
$style .= ' transform:translate(-50%, -50%);';
15+
}
1616

17-
return $style;
18-
}
17+
return $style;
18+
}

src/annotator.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div :class="['annotator', {'annotator-disabled': disabled}]" ref="container" :data-theme="theme" :data-color="currentColor" @mousemove="panImage">
2+
<div :class="['annotator', {'annotator-disabled': disabled}]" ref="container" :data-theme="currentTheme" :data-color="currentColor" @mousemove="panImage">
33
<div class="annotator-background"></div>
44
<div v-if="!src" class="annotator-placeholder">
55
<div class="annotator-placeholder-ctn">
@@ -107,6 +107,9 @@ export default {
107107
currentColor() {
108108
return this.storedColor != '' ? this.storedColor : this.manualColor
109109
},
110+
currentTheme() {
111+
return this.theme ?? this.$panel.theme.current
112+
},
110113
pageValues() {
111114
return this.$panel.content.version("changes")
112115
},
@@ -132,6 +135,8 @@ export default {
132135
this.dblclick = response.dblclick
133136
if(response.image) this.src = response.image
134137
138+
console.log(this.theme)
139+
135140
this.currentTool = this.tools[0]
136141
this.manualColor = this.colors[0]
137142
})
@@ -440,14 +445,14 @@ export default {
440445
updateStructure() {
441446
if(this.storage.markers) {
442447
this.$panel.content.update({
443-
[this.storage.markers]: this.markers
448+
[this.storage.markers]: this.markers
444449
});
445450
}
446451
},
447452
updateColor() {
448453
if(this.storage.color) {
449454
this.$panel.content.update({
450-
[this.storage.color]: this.storedColor
455+
[this.storage.color]: this.storedColor
451456
});
452457
}
453458
},
Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
@mixin markers-style($color) {
2-
.marker {
3-
color: white;
4-
&-pin {
5-
background: #{$color};
6-
}
7-
&-rect {
8-
border: 2px solid #{$color};
9-
.resize-helpers {
10-
.handle {
11-
border: 2px solid #{$color};
12-
}
13-
}
14-
.count {
15-
background: #{$color};
16-
}
17-
}
18-
&-circle {
19-
border: 2px solid #{$color};
20-
.resize-helpers {
21-
background: #{$color};
22-
.handle {
23-
border: 2px solid #{$color};
24-
}
25-
}
26-
.count {
27-
background: #{$color};
28-
}
29-
}
30-
}
2+
.marker {
3+
color: white;
4+
&-pin {
5+
background: #{$color};
6+
}
7+
&-rect {
8+
border: 2px solid #{$color};
9+
.resize-helpers {
10+
.handle {
11+
border: 2px solid #{$color};
12+
}
13+
}
14+
.count {
15+
background: #{$color};
16+
}
17+
}
18+
&-circle {
19+
border: 2px solid #{$color};
20+
.resize-helpers {
21+
background: #{$color};
22+
.handle {
23+
border: 2px solid #{$color};
24+
}
25+
}
26+
.count {
27+
background: #{$color};
28+
}
29+
}
30+
}
3131
}
3232

3333
@mixin toolbar-style($color) {
34-
.annotator-toolbar {
35-
.tool.selected {
36-
svg {
37-
.vibrant, .faded {
38-
fill: #{$color};
39-
}
40-
}
41-
}
42-
}
43-
.color-selected {
44-
.circle {
45-
background: #{$color};
46-
}
47-
}
34+
.annotator-toolbar {
35+
.tool.selected {
36+
svg {
37+
.vibrant, .faded {
38+
fill: #{$color};
39+
}
40+
}
41+
}
42+
}
43+
.color-selected {
44+
.circle {
45+
background: #{$color};
46+
}
47+
}
4848
}
4949

5050
@mixin grabbable {
51-
cursor: move;
51+
cursor: move;
5252
cursor: grab;
5353
cursor: -moz-grab;
5454
cursor: -webkit-grab;
55-
&:active {
56-
cursor: default;
57-
}
58-
}
55+
&:active {
56+
cursor: default;
57+
}
58+
}

0 commit comments

Comments
 (0)