<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="wrapper">
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
</div>
</body>
</html>
.item {
position: relative;
display: inline-block;
width: 48%;
margin: 0.5%;
background-color: gold;
outline: 1px solid red;
}
.item:before {
content: '';
display: block;
padding-top: 100%;
}
@media (min-width: 480px) {
.item {
width: 31.25%;
}
}
@media (min-width: 720px) {
.item {
width: 23.25%;
}
}
// var result = [
// {
// oid: '20111111111',
// description: '質感超棒超喜歡',
// created: 1468692345,
// detected_locale: 'zh_TW',
// who: 'trans',
// owner_nick: 'elloitto chan',
// score: 5,
// owner_avatar: 'http://fakeimg.pl/50x50/?text=1',
// },
// {
// oid: '20111111111',
// description: 'XDDD',
// created: 1468692345,
// detected_locale: 'zh_TW',
// who: 'trans',
// owner_nick: 'user 2',
// score: 5,
// owner_avatar: 'http://fakeimg.pl/50x50/?text=2',
// }
// ];
// var comments = document.querySelector('.comments');
// for (var i = 0, max = result.length; i < max; i++) {
// var comment = document.createElement('div');
// comment.className = 'comment';
// var author = document.createElement('span');
// author.className = 'author';
// author.innerText = result[i].owner_nick;
// comment.appendChild(author);
// var content =
// comments.appendChild(comment);
// }
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |