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.


                <canvas id="ameba"></canvas>


                #ameba {
	box-shadow: 0 0 50px rgba(0,0,0,.7);
	margin: 0 auto 60px;
	display: block;
	width: 50%;
	height: 50%;


                // V 1.0.1
// released under MIT license by
// documentation found at

function InkBlobEffect(dObj, rect, autoUpdate, quality) { = dObj;

    var blurFilter = new createjs.BlurFilter(20, 20, quality || 1);
    var colorFilter = new createjs.ColorFilter(1, 1, 1, 30, 0, 0, 0, -2500); = [blurFilter, colorFilter];[0], rect[1], rect[2], rect[3]);

    // call this manually to update, or just allow it to autoUpdate
    this.update = function () {;

    // toggle the ticker on and off via autoRender
    // NOTE: it is preferred that you set autoUpdate to false and
    // update the instance via  it's instance.update() function
    // in the same ticker as you update the stage, that way it
    // always updates BEFORE the stage does
    var _autoRender = false;
    var _renderListener = null;
    Object.defineProperty(this, 'autoRender', {
        get: function () {
            return _autoRender;
        set: function (val) {
            if (val == _autoRender) return;
            _autoRender = val;
            if (val == true)
                _renderListener = createjs.Ticker.on('tick', this.update, this);
            else if (_renderListener)
      'tick', _renderListener);

    if (autoUpdate !== false) {
        this.autoRender = true;

var stage = new createjs.Stage('ameba');
		var cont = new createjs.Container();
		cont.x = 300; cont.y = 150;
		makeShape(30, -20, -15);
		makeShape(10, 5, 5);
		makeShape(12, 8, 20);
		makeShape(17, -40, 10);
		makeShape(15, 40, -10);
		makeShape(15, 30, -20);
		makeShape(20, -60, 5);
		makeShape(20, 60, 10);
		function makeShape(size, x, y)
			var c = new createjs.Shape();'#f90').drawCircle(0,0,size);
			c.x = x; c.y = y;
			Math.random()>.5 ? tweenLeft(c) : tweenRight(c);
		function tweenLeft(c) {
			createjs.Tween.get(c).to({x:-Math.random()*90}, Math.random()*1500+1000, createjs.Ease.quadInOut).call(tweenRight, [c]);
		function tweenRight(c) {
			createjs.Tween.get(c).to({x:Math.random()*90}, Math.random()*1500+1000, createjs.Ease.quadInOut).call(tweenLeft, [c]);
		var inkEffect = new InkBlobEffect(cont, [-150,-200,500,400], false, 2);
		createjs.Ticker.addEventListener('tick', onTick);
		function onTick()