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.


                <div class="container">
	<h2 data-splitting>I am animating on a path</h2>


                @import url("");

* {
	box-sizing: border-box;

body {
	min-height: 100vh;
	background-color: black;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	color: coral;
	padding: 2rem;
	overflow-x: hidden;

.container {
	max-width: 100%;
	width: 80rem;

h2 {
	position: relative;
	font-family: Inconsolata, monospace;
	font-size: 1.8rem;
	text-transform: uppercase;
	// Dimensions of original path
	width: 515px;
	height: 168px;
	transform: scale(var(--x, 1));
	transform-origin: var(--o, center);
	margin: 0 auto;

.char {
	--i: calc(50% / var(--char-total));
	offset-path: path('M.4 84.1s127.4 188 267.7 0 247.3 0 247.3 0');
	offset-distance: calc(var(--char-index) * 1.2rem);
	position: absolute;
	animation: move 1500ms infinite alternate forwards var(--delay, 0ms);

@keyframes move {
	100% {
		--i: 2rem;
		offset-distance: calc((var(--char-index) * 1.2rem) + 12rem);


                const container = document.querySelector('.container')

const split = Splitting({
	whitespace: true

const update = () => {
	const { el } = split[0]
	const originalPathWidth = el.clientWidth
	const originalPathHeight = el.clientHeight
	const m = container.clientWidth / originalPathWidth
	const containerLeft = container.getBoundingClientRect().left
	const elLeft = el.getBoundingClientRect().left
	// If same width, do nothing
	if (m === 1) return
	// Scale'--x', m)
	// Set transform origin
	if (container.clientWidth < originalPathWidth) {'--o', 'left')
	} else {'--o', 'center')

const observer = new ResizeObserver(update)