const info = {
  innerWidth: window.innerWidth,
  innerHeight: window.innerHeight,
  outerWidth: window.outerWidth,
  outerHeight: window.outerHeight,
  scrollX: window.scrollX,
  scrollY: window.scrollY,
  devicePixelRatio: window.devicePixelRatio,
};

console.log(info);

const pre = document.createElement("pre");
pre.textContent = JSON.stringify(info, null, 2);
document.body.appendChild(pre);

// Respond to resize
window.addEventListener("resize", () => {
  console.log("Resized to:", window.innerWidth, "x", window.innerHeight);
});