@@ -178,11 +178,16 @@ var fuse = new Fuse(mocks, {
178178 } ]
179179} ) ;
180180
181- var searchBar = document . getElementById ( 'mocks-search' ) ;
181+ var transformInput = document . getElementById ( 'css-transform' ) ;
182+ var mockInput = document . getElementById ( 'mocks-search' ) ;
182183var mocksList = document . getElementById ( 'mocks-list' ) ;
183184var plotArea = document . getElementById ( 'plots' ) ;
184185
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+ } ) ;
186191
187192function debounce ( func , wait , immediate ) {
188193 var timeout ;
@@ -230,7 +235,16 @@ function searchMocks(e) {
230235
231236 var listWidth = mocksList . getBoundingClientRect ( ) . width ;
232237 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 ( ' ' ) ) ;
234248 } ) ;
235249}
236250
0 commit comments