Created
October 30, 2018 17:29
-
-
Save lucianobarauna/ee387d9358020c09c8e2f5196d1c14f8 to your computer and use it in GitHub Desktop.
debug-window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://codepen.io/lucianobarauna/pen/xyMXGw?editors=0010 | |
// Um simples debug para visualizar as informações do objeto window.screen | |
(function(){ | |
const $body = document.querySelector('body') | |
const objScreen = window.screen | |
// Create info | |
let createInfo = (prop, targetObj) => { | |
const $p = document.createElement('p') | |
$p.setAttribute('class', 'infodata') | |
$p.textContent += `${prop} : ${targetObj[prop]}` | |
return $p | |
} | |
// List content | |
let listContent = (obj) => { | |
let objTarget = obj | |
let $divContent = document.createElement('div') | |
$divContent.setAttribute('id', 'getinfopane') | |
for (var prop in objTarget) { | |
if(prop !== 'orientation'){ | |
$divContent.appendChild(createInfo(prop, objTarget)) | |
} | |
} | |
return $divContent | |
} | |
$body.appendChild(listContent(objScreen)) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment