Last active
December 24, 2015 00:40
-
-
Save geoffyuen/6718659 to your computer and use it in GitHub Desktop.
Quick and dirty way to view your site at 320, 480, 768. Append ?<your site url without http://>. Eg. look.html?bing.com
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>320 | 480 | 768</title> | |
<style> | |
html, body { | |
background: #444; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
text-align: center; | |
overflow-y: hidden; | |
} | |
#w320 { | |
width: 320px; | |
} | |
#w480 { | |
width: 480px; | |
position: relative; | |
} | |
#w768 { | |
width: 768px; | |
} | |
#w320, #w768 { | |
box-shadow: 0 0 20px #000; | |
} | |
iframe { | |
border-width: 0; | |
background: #fff; | |
height: 100%; | |
display: inline-block; | |
margin: 0 1px; | |
} | |
</style> | |
</head> | |
<body> | |
<iframe id="w320"></iframe><iframe id="w480"></iframe><iframe id="w768"></iframe> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script> | |
$(function() { | |
var earl = ($(location).attr('search')).split('?')[1]; | |
$('iframe').attr('src', 'http://' + earl); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment