Interface IViewport

Hierarchy

  • IViewport

Properties

Viewport callbacks

Example

vevet.viewport.callbacks.add('width', () => console.log('width changed'));

vevet.viewport.callbacks.add('height', () => console.log('height changed'));

vevet.viewport.callbacks.add('both', () => console.log('both width and height changed'));

vevet.viewport.callbacks.add('widthOnly', () => console.log('only width changed'));

vevet.viewport.callbacks.add('heightOnly', () => console.log('only height changed'));

vevet.viewport.callbacks.add('any', () => console.log('any change'));
dpr: number

Device pixel ratio

height: number

Current viewport height

isDesktop: boolean

Is viewport in desktop mode

isLandscape: boolean

Is viewport in landscape mode

isPhone: boolean

Is viewport in phone mode

isPortrait: boolean

Is viewport in portrait mode

isTablet: boolean

Is viewport in tablet mode

lowerDpr: number

Lower device pixel ratio (1 for desktop and maximum 2 for mobile devices)

sHeight: number

Current viewport small height

svh: number

Current viewport small height divided by 100 (svh)

vh: number

Current viewport height divided by 100

vw: number

Current viewport width divided by 100

width: number

Current viewport width