Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <div class="wrapper">
	 <div class="wrapper__content">
			<div class="cube">
				 <div class="cube__side cube__side--front"></div>
				 <div class="cube__side cube__side--back"></div>
				 <div class="cube__side cube__side--left"></div>
				 <div class="cube__side cube__side--right"></div>
				 <div class="cube__side cube__side--top"></div>
				 <div class="cube__side cube__side--bottom"></div>
			</div>

			<div class="shadow">
				 <div class="cube">
						<div class="cube__side cube__side--front"></div>
						<div class="cube__side cube__side--back"></div>
						<div class="cube__side cube__side--left"></div>
						<div class="cube__side cube__side--right"></div>
						<div class="cube__side cube__side--top"></div>
						<div class="cube__side cube__side--bottom"></div>
				 </div>
			</div>
	 </div>
</div>
              
            
!

CSS

              
                @use postcss-nested;
@use postcss-simple-vars;

body {
    margin: 0;
    padding: 0;  
}
.wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    background: #000000;

    &__content {
        height: 450px;
        width: 280px;
        position: relative;
    }
}

@keyframes rotation {
    0% {
        transform: rotateZ(0deg) rotateX(-15deg) rotateY(0deg)
    }
    100% {
        transform: rotateZ(0deg) rotateX(-15deg) rotateY(-360deg)
    }
}

@keyframes color-front {
    0%, 100%  {
       opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}
@keyframes color-back {
    0%, 100%, 25%, 75%  {
       opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

@keyframes color-right {
    0%, 50%  {
       opacity: 0.25;
    }
    50%  {
        opacity: 0;
    }
    25% {
        opacity: 1;
    }
}

@keyframes color-left {
    0%, 50%, 100%  {
       opacity: 0;
    }
    75% {
        opacity: 1;
    }
}

.cube {
    --z-angle: 100px;
    --color: #06FFFF;
    --time: 5s;
   
    width: 203px;
    height: 203px;
    position: relative;
    transform-style: preserve-3d;
    transform-origin: center center; 
    transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg);
    animation: rotation var(--time) infinite linear;

    &__side {
        position: absolute;
        width: 203px;
        height: 203px;
        opacity: 0;

        &:after{
            content: '';
            left: 0;
            top: 0; 
            width: 3px;
            height: 3px;
            background: var(--color);
            position: absolute;
            border-radius: 100%;
            box-shadow: 
                0px 40px 0px 0px var(--color), 
                0px 80px 0px 0px var(--color), 
                0px 120px 0px 0px var(--color), 
                0px 160px 0px 0px var(--color),
                0px 200px 0px 0px var(--color),

                40px 0px 0px 0px var(--color), 
                80px 0px 0px 0px var(--color), 
                120px 0px 0px 0px var(--color), 
                160px 0px 0px 0px var(--color), 
                200px 0px 0px 0px var(--color),

                40px 40px 0px 0px var(--color), 
                80px 40px 0px 0px var(--color), 
                120px 40px 0px 0px var(--color), 
                160px 40px 0px 0px var(--color), 
                200px 40px 0px 0px var(--color),

                40px 80px 0px 0px var(--color), 
                80px 80px 0px 0px var(--color), 
                120px 80px 0px 0px var(--color), 
                160px 80px 0px 0px var(--color), 
                200px 80px 0px 0px var(--color),

                40px 120px 0px 0px var(--color), 
                80px 120px 0px 0px var(--color), 
                120px 120px 0px 0px var(--color), 
                160px 120px 0px 0px var(--color), 
                200px 120px 0px 0px var(--color),

                40px 160px 0px 0px var(--color), 
                80px 160px 0px 0px var(--color), 
                120px 160px 0px 0px var(--color), 
                160px 160px 0px 0px var(--color), 
                200px 160px 0px 0px var(--color),

                40px 200px 0px 0px var(--color), 
                80px 200px 0px 0px var(--color), 
                120px 200px 0px 0px var(--color), 
                160px 200px 0px 0px var(--color), 
                200px 200px 0px 0px var(--color);
        }

        &--front {
            animation: color-front var(--time) infinite linear;
            transform: rotateY(0deg) translateZ(var(--z-angle)); 
        }
        &--right {
            transform: rotateY(90deg) translateZ(var(--z-angle)); 
            animation: color-right var(--time) infinite linear;
        }
        &--back {
            transform: rotateY(180deg)  translateZ(var(--z-angle)); 
            animation: color-back var(--time) infinite linear;
        }
        &--left {
            transform: rotateY(-90deg)  translateZ(var(--z-angle)); 
            animation: color-left var(--time) infinite linear;
        }
        &--top {
            opacity: 1;
            transform: rotateX(90deg) translateZ(var(--z-angle)); 
        }
        &--bottom {
            opacity: 0;
        }
    }
}
.shadow {
    position: absolute;
    top: 258px;
    filter: blur(1px);

    .cube {
        &__side:not(.cube__side--top) {
            mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) , rgba(0, 0, 0, 0) 80%);
            -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) , rgba(0, 0, 0, 0) 80%);
        }
    }
}
              
            
!

JS

              
                /*Chrome only demo*/
              
            
!
999px

Console