File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -622,6 +622,9 @@ button.bar-button.dragging.removing {
622
622
cursor : url (img/cursor-select-remove.png), pointer;
623
623
}
624
624
625
+ button .save {
626
+ background-image : linear-gradient (0 , var (--accent-color ), var (--accent-color ));
627
+ }
625
628
button .save .count {
626
629
display : inline-block;
627
630
min-width : 32px ;
@@ -1254,6 +1257,14 @@ a.hide-toggle {
1254
1257
font-style : italic;
1255
1258
}
1256
1259
1260
+ button .preset-reset .label .flash-bg {
1261
+ animation : flash-bg 750ms ;
1262
+ }
1263
+ @keyframes flash-bg {
1264
+ 0% { background-color : # fff ; }
1265
+ 100% { background-color : # f6f6f6 ; }
1266
+ }
1267
+
1257
1268
.preset-list-button .label-inner {
1258
1269
width : 100% ;
1259
1270
line-height : 1.35em ;
Original file line number Diff line number Diff line change 1
1
import { dispatch as d3_dispatch } from 'd3-dispatch' ;
2
+ import { select as d3_select } from 'd3-selection' ;
2
3
import deepEqual from 'fast-deep-equal' ;
3
4
4
5
import { presetManager } from '../presets' ;
@@ -142,10 +143,10 @@ export function uiEntityEditor(context) {
142
143
if ( priorActivePreset && _activePresets . length === 1 && priorActivePreset !== _activePresets [ 0 ] ) {
143
144
// flash the button to indicate the preset changed
144
145
context . container ( ) . selectAll ( '.entity-editor button.preset-reset .label' )
145
- . style ( 'background-color ', '#fff' )
146
- . transition ( )
147
- . duration ( 750 )
148
- . style ( 'background-color' , null ) ;
146
+ . classed ( 'flash-bg ', true )
147
+ . on ( 'animationend' , function ( ) {
148
+ d3_select ( this ) . classed ( 'flash-bg' , false ) ;
149
+ } ) ;
149
150
}
150
151
}
151
152
}
Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ export function uiToolSave(context) {
42
42
return null ;
43
43
} else if ( numChanges <= 50 ) {
44
44
step = numChanges / 50 ;
45
- return d3_interpolateRgb ( '#fff ' , '#ff8 ' ) ( step ) ; // white -> yellow
45
+ return d3_interpolateRgb ( '#fff0 ' , '#ff08 ' ) ( step ) ; // transparent -> yellow
46
46
} else {
47
47
step = Math . min ( ( numChanges - 50 ) / 50 , 1.0 ) ;
48
- return d3_interpolateRgb ( '#ff8 ' , '#f88 ' ) ( step ) ; // yellow -> red
48
+ return d3_interpolateRgb ( '#ff08 ' , '#f008 ' ) ( step ) ; // yellow -> red
49
49
}
50
50
}
51
51
@@ -64,7 +64,7 @@ export function uiToolSave(context) {
64
64
if ( button ) {
65
65
button
66
66
. classed ( 'disabled' , isDisabled ( ) )
67
- . style ( 'background ' , bgColor ( _numChanges ) ) ;
67
+ . style ( '--accent-color ' , bgColor ( _numChanges ) ) ;
68
68
69
69
button . select ( 'span.count' )
70
70
. text ( _numChanges ) ;
You can’t perform that action at this time.
0 commit comments