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 n = 50;

.canvas
	.iso
		while n--
			//- relative initial x axis position
			- var rx0 = +Math.random().toFixed(2);
			//- relative scale
			- var rs = +(1 + Math.random()).toFixed(2);
			//- float up duration
			- var ty = +(5 + 8*Math.random()).toFixed(2);
			//- float up delay
			- var dty = +(Math.random()*-ty).toFixed(2);
			//- float lateral duration
			- var tx = +(3 + 4*Math.random()).toFixed(2);
			//- max horizontal scale
			- var sx = +(1 + .5*Math.random()).toFixed(2);
			//- horizontal scale duration
			- var tsx = +(1 + Math.random()).toFixed(2);
			//- horizontal scale delay
			- var dtsx = +(Math.random()*-tsx).toFixed(2);
			//- max vertical scale
			- var sy = +(1 + .35*Math.random()).toFixed(2);
			//- vertical scale duration
			- var tsy = +(1 + Math.random()).toFixed(2);
			//- vertical scale delay
			- var dtsy = +(Math.random()*-tsy).toFixed(2);
			//- rotation duration
			- var ta = +(4 + 5*Math.random()).toFixed(2);
			//- vertical scale delay
			- var dta = +(Math.random()*-ta).toFixed(2);
			.bubble(style=`--rx0: ${rx0}; --rs: ${rs}; --tx: ${tx}s; --ty: ${ty}s; --dty: ${dty}s; --fx: ${sx}; --tsx: ${tsx}s; --dtsx: ${dtsx}s; --fy: ${sy}; --tsy: ${tsy}s; --dtsy: ${dtsy}s; --ta: ${ta}s; --dta: ${dta}s`)
p In a Chromium browser and can't see this animation? Go to 
	code chrome://flags/#enable-experimental-web-platform-features
	|  (click this warning to copy to clipboard) and enable the 
	strong Experimental Web Platform features
	|  flag.
              
            
!

CSS

              
                $r: 2em;
$sa: 5deg;
$rw: radial-gradient(#fff, rgba(#fff, 0) 25%);

@function stop-list($precision: 12) {
	$list: ();
	$unit: 360/$precision;
	
	@for $i from 0 through $precision {
		$list: $list, hsl($i*$unit, 100%, 71%);
	}
	
	@return $list;
}

*, :before, :after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	overflow: hidden;
}

body {
	&:before {
		position: absolute;
		top: 0; right: 0; bottom: 0; left: 0;
		background: $rw, 
			conic-gradient(stop-list());
		animation: a 5s linear infinite;
		content: '';
		
		@supports (r: 2px) {
			background: $rw, 
				conic-gradient(from var(--a, 0deg), stop-list());
			
			@at-root {
				p {
					display: none;
					position: absolute;
					bottom: 0;
					padding: .5em;
					background: lemonchiffon;
					color: #000;
					font: 600 1.125em segoe script, comic sans ms, cursive;
					
					code {
						color: mediumvioletred;
						font-family: consolas, monaco, monospace
					}
					
					strong {
						color: purple;
						font-weight: 900;
						text-shadow: 1px 0 currentcolor
					}
				}
			}
		}
	}
}

@keyframes a { to { --a: 1turn } }

.canvas {
	position: relative;
	height: 100vh;
	background: #000;
	mix-blend-mode: multiply;
	filter: contrast(10)
}

.iso { isolation: isolate }

.bubble {
	--r: calc(var(--rs)*#{$r});
	--x0: calc(var(--rx0)*(100vw - 2*var(--r)));
	position: absolute;
	top: calc(-2.5*var(--r)); left: var(--x0);
	padding: var(--r);
	border-radius: 50%;
	transform: 
		translate(var(--x, 0px), var(--y, calc((var(--fx) - 1)*200vh)))
		rotate(var(--a, 0deg))
		scale(var(--sx, 1), var(--sy, 1));
	box-shadow: inset 0 0 0 .75em #fff;
	filter: blur(9px);
	background: #000;
	mix-blend-mode: multiply;
	animation: 
		x var(--tx) ease-in-out alternate infinite, 
		y var(--ty) ease-out var(--dty) infinite, 
		sx var(--tsx) ease-in-out var(--dtsx) infinite alternate,  
		sy var(--tsy) ease-in-out var(--dtsy) infinite alternate, 
		a var(--ta) linear var(--dta) infinite
}

@keyframes x {
	0% { --x: calc(-1*var(--r)) }
	100% { --x: calc(var(--r)) }
}

@keyframes y {
	0% { --y: calc(100vh + 3*var(--r)) }
	100% { --y: 0px }
}

@keyframes sx { to { --sx: var(--fx) } }

@keyframes sy { to { --sy: var(--fy) } }
              
            
!

JS

              
                const _P = document.querySelector('p');

if(CSS.registerProperty) {	
	CSS.registerProperty({
		name: '--a', 
		syntax: '<angle>', 
		initialValue: '0deg', 
		inherits: false
	});

	CSS.registerProperty({
		name: '--x', 
		syntax: '<length>', 
		initialValue: '0px', 
		inherits: false
	});

	CSS.registerProperty({
		name: '--y', 
		syntax: '<length>', 
		initialValue: '0px', 
		inherits: false
	});

	CSS.registerProperty({
		name: '--sx', 
		syntax: '<number>', 
		initialValue: 1, 
		inherits: false
	});

	CSS.registerProperty({
		name: '--sy', 
		syntax: '<number>', 
		initialValue: 1, 
		inherits: false
	});
}
else {
	_P.style.display = 'block';
	
	_P.addEventListener('click', e => {	navigator.clipboard.writeText(e.target.querySelector('code').textContent)
}, false)
}
              
            
!
999px

Console