Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.


              <canvas id="glcanvas"></canvas>


              body {
  margin: 0;
  padding: 0;
  overflow: hidden; 



* Example: Mixing a Gampad with four video sources
* If all went well, you should be able to fade four videos together with your
* left handle. If you do nothing all videos will be shown, move around each video
* is 'in the corner', so to speak.

var renderer = new GlRenderer();

var video1 = new VideoSource( renderer, { src: ''} )
var video2 = new VideoSource( renderer, { src: ''} )
var video3 = new VideoSource( renderer, { src: ''} )
var video4 = new VideoSource( renderer, { src: ''} )

var mixer1 = new Mixer( renderer, { source1: video1, source2: video2 });
var mixer2 = new Mixer( renderer, { source1: video3, source2: video4 });
var mixer3 = new Mixer( renderer, { source1: mixer1, source2: mixer2 });

var gamepad1 = new GamePadController( renderer )

var output = new Output( renderer, mixer3 )


// ------------------------------------------------------------

// change this to select gamepad, if multiple devices can identify as gamepad
// 0, 1, 2 etc.
// look for the index in the console log; like this:
// Gamepad connected at index 2: Xbox 360 Controller (XInput STANDARD GAMEPAD). 17 buttons, 4 axes.
// VM743 console_runner-1df7d3399bdc1f40995a35209755dcfd8c7547da127f6469fd81e5fba982f6af.js:1 init GamePadController
// the gamepad_index is then 2
gamepad1.gamepad_index = 0

var left_x = function( arr ) {
  mixer1.pod( ( arr[1] + 1 ) / 2 )
  mixer2.pod( ( arr[1] + 1 ) / 2 )  

var left_y = function( arr ) {
  mixer3.pod( ( arr[1] + 1 ) / 2 )  

gamepad1.addEventListener( 100, left_x )
gamepad1.addEventListener( 101, left_y )