<html>
<head>
<title>A-Frame Getting Started</title>
<script src="https://cdn.rawgit.com/AdaRoseEdwards/aframe/v0.3.3-ada/dist/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/donmccurdy/aframe-physics-system/v1.0.3/dist/aframe-physics-system.js"></script>
</head>
<body>
<a-scene physics fog="type: linear; color: #AAB; far: 10; near: 0">
<a-assets>
<!-- image to use on the floor -->
<img src="https://img.gs/bbdkhfbzkk/stretch/https://i.imgur.com/25P1geh.png" id="grid" crossorigin="anonymous">
</a-assets>
<!-- camera with a sphere around it to push objects -->
<a-camera universal-controls>
<a-entity static-body visible="false" geometry="primitive: sphere;"></a-entity>
</a-camera>
<!-- blue ball -->
<a-entity dynamic-body geometry="primitive: sphere;" position="0 2 -5" material="color:blue;"></a-entity>
<!-- floor -->
<a-entity position="0 0 0" rotation="-90 0 0" static-body geometry="primitive: plane; width: 100; height: 100;" material="src: #grid; repeat: 100 100; transparent: true;"></a-entity>
<!-- sky -->
<a-sky color="#AAB"></a-sky>
</a-scene>
</body>
</html>
// A-Frame Physics Playground
var scene = document.querySelector('a-scene');
if (scene.hasLoaded) {
run();
} else {
scene.addEventListener('loaded', run);
}
function run () {
// Run javascript here
}
Output
300px
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. |