@@ -178,11 +178,16 @@ var fuse = new Fuse(mocks, {
178
178
} ]
179
179
} ) ;
180
180
181
- var searchBar = document . getElementById ( 'mocks-search' ) ;
181
+ var transformInput = document . getElementById ( 'css-transform' ) ;
182
+ var mockInput = document . getElementById ( 'mocks-search' ) ;
182
183
var mocksList = document . getElementById ( 'mocks-list' ) ;
183
184
var plotArea = document . getElementById ( 'plots' ) ;
184
185
185
- searchBar . addEventListener ( 'keyup' , debounce ( searchMocks , 250 ) ) ;
186
+ mockInput . addEventListener ( 'keyup' , debounce ( searchMocks , 250 ) ) ;
187
+
188
+ transformInput . addEventListener ( 'keyup' , function ( e ) {
189
+ plotArea . style . transform = e . target . value ;
190
+ } ) ;
186
191
187
192
function debounce ( func , wait , immediate ) {
188
193
var timeout ;
@@ -230,7 +235,16 @@ function searchMocks(e) {
230
235
231
236
var listWidth = mocksList . getBoundingClientRect ( ) . width ;
232
237
var plotAreaWidth = Math . floor ( window . innerWidth - listWidth ) ;
233
- plotArea . setAttribute ( 'style' , 'width: ' + plotAreaWidth + 'px;' ) ;
238
+
239
+ var allStyles = [
240
+ 'width: ' + plotAreaWidth + 'px;'
241
+ ] ;
242
+
243
+ if ( transformInput . value !== '' ) {
244
+ allStyles . push ( 'transform: ' + transformInput . value + ';' ) ;
245
+ }
246
+
247
+ plotArea . setAttribute ( 'style' , allStyles . join ( ' ' ) ) ;
234
248
} ) ;
235
249
}
236
250
0 commit comments