Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

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


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.


                <script id="shader" type="shader">
  precision mediump float;
  varying vec2 vTextureCoord;//The coordinates of the current pixel
  uniform sampler2D uSampler;//The image data

  void main(void) {
    gl_FragColor = texture2D(uSampler, vTextureCoord);
    gl_FragColor.r = 0.0;


                body {
  margin: 0;
  overflow: hidden;


                var width = window.innerWidth;//Get the screen width and height
var height = window.innerHeight;
var renderer = new PIXI.autoDetectRenderer(width, height);//Chooses either WebGL if supported or falls back to Canvas rendering
document.body.appendChild(renderer.view);//Add the render view object into the page

var stage = new PIXI.Container();//The stage is the root container that will hold everything in our scene

//Load an image and create an object
var logo = PIXI.Sprite.fromImage("");
logo.x = width / 2;//Set it at the center of the screen
logo.y = height / 2;
logo.anchor.set(0.5);//Make sure the center point of the image is at its center, instead of the default top left
stage.addChild(logo)//Add it to the screen

//Create a uniforms object to send to the shader
var uniforms = {}
uniforms.mouse = {
  value: {x:0,y:0}
uniforms.time = {
uniforms.resolution = {

function animate() {
    // start the timer for the next animation loop
    // this is the main render call that makes pixi draw your container and its children.
   uniforms.time.value += 0.1

//Get shader code as a string
var shaderCode = document.getElementById("shader").innerHTML
//Create our Pixi filter using our custom shader code
var simpleShader = new PIXI.AbstractFilter('',shaderCode,uniforms);
//Apply it to our object
logo.filters = [simpleShader]

document.onmousemove = function(evt){
  //Get the mouse position
  mousePos = {x:evt.clientX,y:evt.clientY}
  //Assigning a new value lets Pixi know to update the uniform in the shader
  // But doing something like uniforms.mouse.x = 0, won't update in this current version of Pixi
  uniforms.mouse.value = mousePos;