Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=320;user-scalable=no">
  <title>JS Bin</title>
</head>
<body>
<p id="resolution"></p>
<h2>Hello there dear reader. Remember me? 😃 It’s been almost 2 years since the last blog post and I can imagine it has felt like JS Bin has been the same for a little while now.
</body>
</html>
 
body {
  width: 320px;
  margin: 0;
  transform-origin: 0 0;
}
 
const resolution = document.getElementById('resolution');
const resize = () => {
  resolution.innerHTML = `${window.innerWidth} x ${window.innerHeight} @${window.devicePixelRatio}x`;  
  document.body.style.transform = `scale(${window.innerWidth / 320})`
}
window.addEventListener('resize', resize)
resolution.addEventListener('click', resize)
resize()
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
hzpeng57pro
0viewers