Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

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.

HTML

              
                <!--
Early demo examples of the Core Network living interface spacetime history tunnel by Adam Apollo, based on a famous codepen.
-->
              
            
!

CSS

              
                /* begin styling */
*, *:before, *:after {
  -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}

html { 
    background-color: #111;
    color: white;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-size: 14px;
}

#main {
    -webkit-perspective: 500px;
    perspective: 500px; 
}


h1, h2, h3 {
    font-family: 'Avenir Next W10 Medium';
    font-size: 24px;
}

p { 
    font-family: 'Avenir Next W01 Thin';
    font-size: 18px;
    line-height: 24px;
}
a { 
    font-family: 'Avenir Next W10 Medium';
}

.backfaceVisible {
    backface-visibility: visible;
    -webkit-backface-visibility: visible; 
    -moz-backface-visibility: visible; 
    -ms-backface-visibility: visible;
}

.white              { color: white; }

.bor_clear  { border: 0; }
.bor_clear:focus { outline: 0 }

.left       { float: left; }
.right      { float: right; }
.inline     { display: inline; }
.block      { display: block; } 
.clear      { clear: both; }
.absolute   { position: absolute }



.description-panel {
    background-color: rgba(77, 77, 77, 0.5);
}
.description-closing-tab {
    border: 1px solid white;
}

.no-user-select { 
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.textinput
{        
    height:40px; 
    width:100%; 
    padding-left: 6px;     
    padding-top: 0px;     
    color: rgba(255, 255, 255, .750);
    font-size: 24px; 
    font-family: 'Avenir Next W10 Thin';
    background-color:rgba(0, 0, 0, 0.0); 
    border: 1px solid rgba(255, 255, 255, .750);   
    outline-width: 0px;
}

.textinput:focus
{
    color: rgba(255, 255, 255, 1.0);
    border: 1px solid rgba(255, 255, 255, 1.0);   
    outline-width: 0px;    
}

.submit
{
    padding-top: 9px;
    padding-left: 4px;
    line-height: 24px;
    font-size: 24px; 
    font-family: 'Avenir Next W10 Thin';   
}
.famous-signup-backing { 
  display: none;
}
.group {
  display: none;
}
              
            
!

JS

              
                //  CodePen Evaluation License
//  
//  Copyright (c) 2013 Famous Industries, Inc.
//  
//  Non-sublicensable permission is hereby granted, free of charge, to any person obtaining a 
//  copy of this software and associated documentation files directly from codepen.io (the 
//  "Software"), solely to internally make and internally use copies of the Software to test, 
//  explore, and evaluate the Software solely in such person’s non-commercial, non-
//  production environments, provided that the above copyright notice and this permission 
//  notice shall be included in all copies or substantial portions of the Software. 
//  
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
//  MERCHANTABILITY, FITNESS FOR A ARTICULAR PURPOSE AND 
//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
//  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 
//  IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
//  SOFTWARE.
//

Famous(function(require, exports, module)
{      
    var Engine = require('famous/Engine');        
 	 var FamousSurface = require('famous/Surface'); 
    var Modifier = require('famous/Modifier');
    var FM = require('famous/Matrix');
    var RenderNode = require('famous/RenderNode');
    var Interface = require('core/Interface');
    var Scene = require('famous-scene/Scene');	
    var Camera = require('famous-gl/Camera'); 
    var Animation = require('famous-animation/Animation'); 
    var AnimationEngine = require('famous-animation/AnimationEngine');     
    var Easing = require('famous-animation/Easing');     
    var ColorPalettes = require('famous-color/ColorPalettes');     
    var ColorPalette = require('famous-color/ColorPalette');     
    var Color = require('famous-color/Color');     
    var Utils = require('famous-utils/Utils');                  
    var RegisterEasing = require('famous-animation/RegisterEasing');      
  	
 
    
    function ArtScene() 
    {
        Scene.apply(this);
        
        this.palettes = ColorPalettes;   
        this.paletteIndex = 77; 
        this.palette = this.palettes.getPalette(this.paletteIndex);                    
        
        this.cam = new Camera(); 
        this.cam.setDistance(100); 
        //PARAMS
        this.opacity = 0.10; 
        this.rotation = .025; 
        this.spacing = 30.0 
        this.speed = .44; 
        this.value = 0; 
        this.theta = 0; 
        this.borderRadius = 60.0; 
        this.borderWidth = 40.0; 
        this.surfaces = [];    
        this.modifiers = [];                
        this.scene = new RenderNode(); 
        var numOfSquares = 50; 
        var dimensions = [256,256];        
        for(var i = 0; i < numOfSquares; i++) 
        {                   
            var color = this.palette.getColor(i); 
            var surface = new FamousSurface({size:dimensions});
            var modifier = new Modifier({
                origin: [0.5, 0.5]
            }); 
            surface.setProperties(Utils.backfaceVisible(true));                                 
            surface.setProperties(Utils.borderStyle('solid'));                                 
            surface.setProperties(Utils.borderColor(color.r, color.g, color.b, color.a));                     
            surface.setProperties(Utils.borderWidth(this.borderWidth));    
            surface.setProperties(Utils.borderRadius(this.borderRadius));    
            this.scene.add(modifier).link(surface); 
            this.surfaces.push(surface); 
            this.modifiers.push(modifier); 
        }                
        this.initUI();
        this.parentUI = new Interface();
        this.parentUI.setCurrentObject( this );        
        Engine.pipe( this.parentUI );
        var ui = this.parentUI.getUI(); 
        var autoUI = ui.getUI(); 
        this.uiElementsMap = autoUI.getUIElementsMap();      
        this.playAnimation = true; 
        this.initAnimation(); 
    }
    ArtScene.prototype = Object.create(Scene.prototype);
    ArtScene.prototype.constructor = ArtScene;        
    ArtScene.DEFAULT_OPTIONS = {};     
    
    ArtScene.prototype.initUI = function()
    {
        this.autoUI = [
            {
                type: 'label',
                uiOptions: { 
                    content: 'AA DIMENSIONAL TUNNEL'
                }
            }, 
            {
                type: 'toggle',                 
                callback: this.toggleAnimation.bind(this), 
                uiOptions: {
                    defaultValue: this.playAnimation,                     
                    name: 'ANIMATE'
                } 
            },
            {
                type: 'slider',
                option: 'value',                    
                callback: this.setBorderWidth.bind(this), 
                uiOptions: {
                    defaultValue: this.borderWidth, 
                    range: [1.0, 50.0],
                    name: 'LINE WIDTH'
                }
            },
            {
                type: 'slider',
                option: 'value',                    
                callback: this.setBorderRadius.bind(this), 
                uiOptions: {
                    defaultValue: this.borderRadius, 
                    range: [1.0, 200.0],
                    name: 'BORDER RADIUS'
                }
            },
            {
                type: 'slider',
                option: 'value',                    
                callback: (function(arg){ this.speed = arg; }).bind(this), 
                uiOptions: {
                    defaultValue: this.speed, 
                    range: [0.0, 0.10],
                    name: 'ROTATION SPEED'
                }
            },
            {
                type: 'slider',
                option: 'value',                    
                callback: (function(arg){ this.opacity = arg; }).bind(this), 
                uiOptions: {
                    defaultValue: this.opacity, 
                    range: [0.0, 1.0],
                    name: 'OPACITY'
                }
            },
            {   
                type: 'slider',
                option: 'value',                    
                callback: this.setColorPalette.bind(this), 
                uiOptions: {
                    defaultValue: this.paletteIndex, 
                    range: [0.0, this.palettes.getCount()-1],
                    name: 'COLOR PALETTE'
                }
            },
            {   
                type: 'slider',
                option: 'value',                    
                callback: (function(arg){ this.spacing = arg; }).bind(this),
                uiOptions: {
                    defaultValue: this.spacing, 
                    range: [100.0, 200.0],
                    name: 'SLICE SPACING'
                }
            },
            {   
                type: 'slider',
                option: 'value',                    
                callback: (function(arg){ this.rotation = arg; }).bind(this),
                uiOptions: {
                    defaultValue: this.rotation, 
                    range: [-Math.PI*.25, Math.PI*.25],
                    name: 'SLICE ROTATION'
                }
            }
        ]; 
    }; 
    ArtScene.prototype.initAnimation = function()
    {
        var rSlider = this.uiElementsMap['SLICE ROTATION']; 
        var sSlider = this.uiElementsMap['SLICE SPACING']; 
        
        var engine = new AnimationEngine();         
        var animation = new Animation({                    
            engine: engine,                                        
            duration: 3000.0,             
            loop: true, 
            reverseUponLoop: true
        }); 
        animation.update = function() {                    
            rSlider.set(Easing.inOutCubic(this.getTime(), -.05, .1, 1.0));                     
            sSlider.set(Easing.inOutQuad(this.getTime(), 5, 15, 1.0)); 
        };         
        engine.addAnimation(animation); 
        animation.start(); 
        this.animation = animation; 
    }; 
    ArtScene.prototype.update = function() 
    {    
        if(this.playAnimation)
        {
            this.theta -= this.speed; 
            this.value = Math.cos(this.theta); 
        }
        var total =  this.surfaces.length; 
        for (var i = 0; i < total; i++) 
        {
            this.modifiers[i].setTransform(FM.multiply(FM.rotate(0.0, 0.0, this.theta+i*this.rotation), FM.translate(0.0, 0.0, (-total*.5+i)*this.spacing)));                        
        }    
    }; 
    ArtScene.prototype.render = function()
    {
        return [{
            origin: this.cam.origin, 
            transform: this.cam.getMatrix(), 
            opacity: this.opacity, 
            target: this.scene.render() 
        }, this.node.render()]; 
    }; 
       
    ArtScene.prototype.setColorPalette = function(value)
    {
        this.paletteIndex = value; 
        this.palette = this.palettes.getPalette(this.paletteIndex);                            
        var total =  this.surfaces.length; 
        for(var i = 0; i < total; i++) 
        {                   
            var color = this.palette.getColor(i); 
            var surface = this.surfaces[i];         
            surface.setProperties(Utils.borderColor(color.r, color.g, color.b, color.a));                     
        }   
    }; 
    
    ArtScene.prototype.setBorderWidth = function(value)
    {
        this.borderWidth = value; 
        var total =  this.surfaces.length; 
        for(var i = 0; i < total; i++) 
        {                   
            var surface = this.surfaces[i];         
            surface.setProperties(Utils.borderWidth(value)); 
        }; 
    }; 
    ArtScene.prototype.setBorderRadius = function(value)
    {
        this.borderRadius = value; 
        var total =  this.surfaces.length; 
        for(var i = 0; i < total; i++) 
        {                   
            var surface = this.surfaces[i];         
            surface.setProperties(Utils.borderRadius(value)); 
        };    
    }; 
    ArtScene.prototype.toggleAnimation = function(arg) 
    {
        this.playAnimation = arg; 
        if(arg)
        {
            this.animation.continueAnimation(); 
        }
        else
        {
            this.animation.halt();             
        }
    };
    
    var artscene = new ArtScene(); 
    var mainCtx = Engine.createContext(); 
    mainCtx.setPerspective(700);
    Engine.pipe(artscene); 
    mainCtx.add(artscene); 
});
              
            
!
999px

Console