Skip to content

Instantly share code, notes, and snippets.

View dmssk's full-sized avatar

Дмитрий dmssk

  • Codevog
  • Zhytomyr
View GitHub Profile
if(navigator.userAgent.match(/iPad/i)) {
const ORIGINAL_WIDTH = 1024;
const ORIGINAL_HEIGHT = 768;
// screen.height === actual device width
// screen.width === actual device height
const w = screen.height;
const h = screen.width;
const BROWSER_TABS = h - window.innerHeight;
const WIDTH_SCALE = Math.round(w / (ORIGINAL_WIDTH / 100)) / 100;