Last active
September 26, 2017 10:25
-
-
Save walaura/543bffd8892df704195a2c2fe42f11e2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(function(){ | |
var target = 960; | |
var $body = document.querySelector('#container'); | |
$body.style.width = target+'px'; | |
$body.style.height = $body.offsetHeight+'px'; | |
$body.style.transformOrigin = '0 0'; | |
window.addEventListener('resize',function(ev) { | |
window.scaleMultiplier = window.innerWidth/target; | |
$body.style.transform = 'scale('+window.scaleMultiplier+')'; | |
}); | |
window.dispatchEvent(new Event('resize')); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hey i made this into a real library! https://github.com/walaura/desktop-viewport