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.


                <script type="module" src=""></script>

	Demo for <a href="" target="_top"></a>

  alt="Nike Air Max 90"

	<p>3D Model <a href="" target="_top">“Nike Air Max 90”</a> by StudioAira! – <a href="" target="_top">CC BY-NC 4.0</a>.</p>

<div class="warning">
	<p>⚠️ Your browser does not support Scroll-driven Animations. Please use Chrome 115 or newer.</p>


                @keyframes foo {
	to {
		scale: 1;

model-viewer {
	display: block;
	width: 100%;
	height: 95vh;
	position: fixed;
	animation: foo linear both;
	animation-timeline: scroll(block root);

model-viewer::part(default-progress-bar) {
	display: none;

footer {
	position: fixed;
	left: 0;
	right: 0;
	text-align: center;
	font-style: italic;
header {
	top: 1em;
footer {
	bottom: 0;

html {
	height: 400vh;

body {
	font-family: helvetica;

@layer warning {
	.warning {
		box-sizing: border-box;
		padding: 1em;
		margin: 1em 0;
		border: 1px solid #ccc;
		background: rgba(255 255 205 / 0.8);

		position: fixed;
		top: 40vh;
		font-size: 2em;
		left: 1em;
		right: 1em;
		max-width: 80ch;
		margin: 0 auto;
		z-index: 1000;

	.warning > :first-child {
		margin-top: 0;

	.warning > :last-child {
		margin-bottom: 0;

	.warning a {
		color: blue;
	.warning--info {
		border: 1px solid #123456;
		background: rgb(205 230 255 / 0.8);
	.warning--alarm {
		border: 1px solid red;
		background: #ff000010;

	@supports (animation-timeline: view()) {
		.warning:not([data-bug]) {
			display: none;

	@supports (animation-range: 0vh 90vh) {
		.warning[data-bug="1427062"] {
			display: none;



                const trackAnimationProgress = (animation, cb, precision = 5) => {
	let progress = null;
	const updateValue = () => {
		if (animation && animation.currentTime) {
			let newProgress = animation.effect.getComputedTiming().progress * 1;
			if (animation.playState === "finished") newProgress = 1;
			newProgress = Math.max(0.0, Math.min(1.0, newProgress)).toFixed(precision);

			if (newProgress != progress) {
				progress = newProgress;

const model = document.querySelector("model-viewer");
trackAnimationProgress(model.getAnimations()[0], (progress) => {
	model.orientation = `0deg 0deg ${progress * -360}deg`;