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.


                //- you can add or remove panel objects
//- k is the relative width 
//- (k values don't need to add up to anything, algorithm handles it)
//- dx (optional) is the relative* offset along the x axis (to right is positive)
//- dz (optional) is the relative* offset along the z axis (forward is positive)
//- *relative to the sum of the widths of all the panels
- let panels = [
-		{ k: 1, dx: 0, dz: -.2 }, 
- 	{ k: 2, dx: -.1 }, 
- 	{ k: 1, dx: .1 }
- ];
- let np = panels.length;
- let sum = panels.reduce((a, c) => a + c.k, 0);
- let prv_k = 0;

- panels.forEach((c, i, a) => {
- 	c.p = prv_k;
- 	prv_k += +(c.k /= sum).toFixed(3);
- 	c.dx += i ? a[i - 1].dx : 0;
- });

.assembly(style=`--dx: ${panels[np - 1].dx}`)
	- for(let i = 0; i < np; i++)
		- let c = panels[i];
		.panel(style=`--i: ${i}; --k: ${c.k}; --p: ${+c.p.toFixed(3)}; --dx: ${c.dx}; --dz: ${ || 0}`)


                // change $url value below to any image of any aspect ratio
$url: '';
$w: 85vmin;
$h: 65vmin;
$f: .25;

html { overflow: hidden; background: #333 }

body {
	margin: 0;
	height: 100vh;
	perspective: 125vmin;
	// Firefox fucks this up
	-webkit-filter: drop-shadow(-1vmin 1vmin 1vmin #000)

div {
	position: absolute; 
	transform-style: preserve-3d

.assembly {
	top: 50%; left: calc(50% - .5*var(--dx)*#{$w});
	transform: rotatey(35deg)

.panel {
	--mid: calc((var(--p) + var(--k)*#{$f})*#{$w});
	transform: translate3d(calc(var(--dx)*#{$w}), 0, calc(var(--dz)*#{$w}));
	&:before, &:after {
		position: absolute;
		margin: -.5*$h (-.5*$w);
		width: $w; height: $h;
		background: url($url) 50%/ cover;
		content: ''
	&:before {
		transform-origin: var(--mid);
		transform: rotatey(-90deg);
		clip-path: inset(0 calc(100% - var(--mid)) 0 calc(var(--p)*100%));
		filter: brightness(.4)
	&:after {
		clip-path: inset(0 calc(100% - (var(--p) + var(--k))*#{$w}) 0 var(--mid))