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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                - var data = [
- 	{
- 		slist: ['#b2dc33', '#9cd400'], 
- 		ptext: 'Cake muffin donut chocolate cake jelly sesame snaps wafer tart pie sweet roll muffin chupa chups. Brownie ice cream gingerbread cookie lemon drops. Liquorice marzipan macaroon sugar plum apple pie soufflé topping dessert.'
- 	}, 
- 	{
- 		slist: ['#f1ce02', '#fba502'], 
- 		ptext: 'Cake cookie lemon drops muffin sugar plum. Liquorice pudding sugar plum topping macaroon pie chocolate. Dessert gingerbread jelly cake soufflé chocolate cake. Apple pie chocolate bar topping donut powder muffin cake tart.'
- 	}, 
- 	{
- 		slist: ['#ff79ac', '#fd4c90'], 
- 		ptext: 'Cake muffin donut chocolate cake jelly sesame snaps wafer tart pie sweet roll muffin chupa chups. Brownie ice cream gingerbread cookie lemon drops. Liquorice marzipan macaroon sugar plum apple pie soufflé topping dessert.'
- 	},
- 	{
- 		slist: ['#bcb6ff', '#9d96f6'], 
- 		ptext: 'Cake cookie lemon drops muffin sugar plum. Liquorice pudding sugar plum topping macaroon pie chocolate. Dessert gingerbread jelly cake soufflé chocolate cake. Apple pie chocolate bar topping donut powder muffin cake tart.'
- 	}
- ], n = data.length;

style
	| :root { --j: 0; --p: #{.5*(n - 1)} }
	| p:nth-child(2n) { --j: 1 }
- for(var i = 0; i < n; i++)
	p(style=`--i: ${i}; --slist: ${data[i].slist}`) #{data[i].ptext}
              
            
!

CSS

              
                $shadow-w: 65%;
$shadow-h: .75em;

* {
	box-sizing: border-box;
	margin: 0;
}

body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow-x: hidden;
	min-height: 100vh;
	background: linear-gradient(90deg, #c7d2d8, #e5edf0);
	counter-reset: p
}

p {
	--wide: 0;
	--s: calc(1 - 2*var(--j));
	display: flex;
	flex-direction: var(--fdf, var(--narr, column));
	align-items: center;
	position: relative;
	z-index: calc(-1*var(--i));
	margin-left: calc(var(--wide)*(var(--p) - var(--i) - 2.5*var(--j) + 1)*6.5vw);
	padding: .75em calc(var(--wide)*3em + (1 - var(--wide))*2vw);
	width: 35em; max-width: calc(var(--wide)*75% + (1 - var(--wide))*100%);
	color: #fff;
	font: 600 1em/ 1.25 roboto, sans-serif;
	counter-increment: p;
	
	@media (min-width: 640px) { --wide: 1 }
	
	@media (min-width: 320px) { --narr: 0 }
	
	&:before {
		--m: calc(1 - var(--narr, 1));
		order: calc(var(--m)*var(--j));
		padding: 0 calc(var(--m)*(1 - var(--j))*1rem) 0 calc(var(--m)*var(--j)*1rem);
		font-size: 5em;
		content: counter(p, decimal-leading-zero)
	}
	
	&:after {
		position: absolute;
		top: 0; right: 0; bottom: -$shadow-h; left: 0;
		z-index: -1;
		padding-bottom: $shadow-h;
		transform: skewx(calc(var(--wide)*-22.5deg));
		background: linear-gradient(calc(var(--s)*-90deg), var(--slist)) content-box, 
			radial-gradient(rgba(#000, .35), transparent 70%) 
				calc(var(--j)*100%) 100%/ #{$shadow-w} #{2*$shadow-h} no-repeat;
		content: ''
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console