Skip to content

kaisarsnippets/js-screen-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Screen Data

[browser] Obtain screen data.

Install

npm install kc-screen-data

Data

  • Screen: Whole screen data

    • aspect: Aspect ratio (E.g: 16:9)
    • density: Pixel density (E.g: 2)
    • width: Screen width (E.g: 1366)
    • height: Screen height (E.g: 768)
    • orientation: "landscape" or "portrait"
    • resolution: width and height string (E.g: 1366x768)
  • Viewport: Browser's viewport data

    • aspect: Aspect ratio (E.g: 16:9)
    • density: Pixel density (E.g: 2)
    • width: Viewport width (E.g: 1366)
    • height: Viewport height (E.g: 768)
    • orientation: "landscape" or "portrait"
    • resolution: width and height string (E.g: 1366x768)

Use

var sc = screen-data();
console.log(sc);

About

[browser] Obtain screen data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published