Adaptive solution for screen page.
npm install screen-flexible
import 'screen-flexible/dist/auto'
import { bindResize } from 'screen-flexible'
bindResize({ width: 1600, height: 1000 }) // this will call `bodyResize`
OR
import { bodyResize } from 'screen-flexible'
let timer
window.addEventListener('resize', () => {
clearTimeout(timer)
timer = setTimeout(() => { bodyResize(1600, 1000) }, 300)
})
bodyResize(1600, 1000)
import { bodyResize } from 'screen-flexible'
/**
* Types of resize method
* 'padding': default, use the minimum axis scale and maximum axis will be padding with blank
* 'width': use the x-axis scale
* 'height': use the y-axis scale
* 'full': use both x-axis and y-axios scale to fullfill the screen
*/
let timer
window.addEventListener('resize', () => {
clearTimeout(timer)
timer = setTimeout(() => { bodyResize(1920, 1080, 'full') }, 300)
})
bodyResize(1920, 1080, 'full')