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

              
                .outer
	.inner Life woven through passionate endeavors and meaningful connections. Life bursting with purpose and authentic satisfaction. Life expanding outward. Growing physically and spiritually. Celebrating seasons. Feeling a profound sense of fullness. Life when change blooms and affirms the essence of being. Embracing the depth of authentic discovery. Delighting in the quest. Gratefully cherishing the companions encountered while exploring one’s own path. Life. Remarkably common. Mouthwatering and nectarous. Life lived with deliberate presence and deep attention. A resonant harmony.
	.inner Life scheduled between work and conventional social activities. Life devoid of any deep emotion or true satisfaction. Life spiralling inward. Advancing socially and professionally. Measuring benchmarks of success. Feeling a profound sense of emptiness. Life when illness takes hold and strips away the illusions of existence. Confronting the reality of superficial pursuits. Grappling with the terror of mortality. Realizing diligent adherence to societal norms prevented true personal fulfillment. Life. Unremarkably common. Tragically hollow. Life lived without genuine purpose or connection. A silent scream.

              
            
!

CSS

              
                body {
	display: grid;
	height: 100dvh;
	margin: 0;
	font: bold 14px 'Nimbus Mono PS', 'Courier New', monospace;
	background: #f8f8f8;
}

.outer {
	width: 100dvw;
	height: 100dvh;
	max-width: 1600px;
	max-height: 1600px;
	margin: auto;
	position: relative;
	visibility: hidden;
	overflow: hidden;
}

.inner {
	position: absolute;
	top: 50%;
	left: 50%;
	animation: spin 540s infinite linear;
	color: #0275ff;
	mix-blend-mode: multiply;
}

.inner + .inner {
	animation-direction: reverse;
	animation-delay: -270s;
	color: #ff0202;
}

span {
	position: absolute;
}

@keyframes spin {
	from {
		transform: translate(-50%, -50%) rotate(0deg);
	}
	to {
		transform: translate(-50%, -50%) rotate(-360deg);
	}
}

              
            
!

JS

              
                const outerContainer = document.querySelector(".outer");
const innerContainers = document.querySelectorAll(".inner");
const outerRect = outerContainer.getBoundingClientRect();

const HEIGHT = outerRect.height;
const WIDTH = outerRect.width;
const SKIP_FIRST_N = 8;
const LINE_SPACING = 9;
const CHARACTER_SPACING = 3;
const ROTATION_JITTER = 0.4;
const N_CHARS_MAX = 100000;

const maxHypot = Math.hypot(WIDTH / 2, HEIGHT / 2);

Array.from(innerContainers).forEach(innerContainer => {
	innerContainer.style.height = `${HEIGHT}px`;
	innerContainer.style.width = `${WIDTH}px`;
	
	const characters = innerContainer.textContent.trim() + ' ';
	const nCharacters = characters.length;
	const spans = [];
	for (let n = 0; n < N_CHARS_MAX; ++n) {
		const char = characters[n % nCharacters];
		if (char === ' ') continue;

		const i = n + SKIP_FIRST_N; // Leave space in the very center.
		const amplitude = Math.pow(i, 0.5) * LINE_SPACING;
		const theta = Math.pow(i * CHARACTER_SPACING, 0.5);
		const x = amplitude * Math.cos(theta);
		const y = amplitude * Math.sin(theta);
		const hypot = Math.hypot(x, y);
		if (hypot > maxHypot) break;

		const span = document.createElement("span");
		span.textContent = char;
		span.style.transform = `translate(${WIDTH / 2 + x}px, ${HEIGHT / 2 + y}px) translate(-50%, -50%) rotate(${
			theta + (Math.random() - 0.5) * ROTATION_JITTER + Math.PI / 2
		}rad)`;
		spans.push(span);
	}

	innerContainer.replaceChildren(...spans);
});
outerContainer.style.visibility = "visible";

              
            
!
999px

Console