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

              
                header scroll down
section.h-scroll
	.stick
		h2 Keep scrolling...
		.wrap
			img(src='https://images.unsplash.com/photo-1488326682254-514166637787?w=800')
			img(src='https://images.unsplash.com/photo-1495746269687-d1ca02626ee8?w=800')
			img(src='https://images.unsplash.com/photo-1525470310764-cf1ef9e728dc?w=800')
			img(src='https://images.unsplash.com/photo-1493662404096-9ecc84ebba6b?w=800')
			img(src='https://images.unsplash.com/photo-1508138119323-5452bd81d53d?w=800')
			img(src='https://images.unsplash.com/photo-1481876453656-5f9968fda498?w=800')
			img(src='https://images.unsplash.com/photo-1540968221243-29f5d70540bf?w=800')
			img(src='https://images.unsplash.com/photo-1523947204020-b03d6498b702?w=800')
footer Fin.

// just support info
aside
	p.box-info-scrollani Sorry, your browser does no appear to support scroll-driven animation. As of August 2024, this is supported in Firefox if the 
		kbd layout.css.scroll-driven-animations.enabled
		|  flag is set to true in 
		kbd about:config
		|  and in Chromium browsers. Safari support is coming, but it hasn't arrived yet.
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@700&family=Great+Vibes&display=swap');

@property --k {
	syntax: '<number>';
	initial-value: 0;
	inherits: true;
}

html {
	overflow-x: hidden;
	scrollbar-color: gold #121212
}

body { margin: 0 }

header, footer {
	display: grid;
	place-content: center;
	min-height: 100vh;
	background: silver;
	font-size: 2em;
	font: 700 4em oxanium, sans-serif;
	text-align: center;
	text-shadow: 1px 1px 3px
}

footer { font-family: Great Vibes, cursive }

section {
	height: 500vh;
	background: #212121;
	
	@supports (animation-timeline: view()) {
		background: 
			linear-gradient(90deg, 
					rgba(gold, calc(1 - round(down, var(--k)))) calc(var(--k)*100%), 
					#0000 0) 
				0 0/ 100% .5rem no-repeat fixed #212121;
		animation: k 1s both;
		animation-timeline: view();
		animation-range: contain
	}
}

@keyframes k { to { --k: 1 } }

h2 {
	color: #ededed;
	font: 900 2em/ 2 sans-serif
}

img {
	width: min(30vmax, 70vmin);
	aspect-ratio: 1;
	object-fit: cover;
	box-shadow: 2px 2px 5px
}

.stick {
	box-sizing: border-box;
	display: grid;
	align-content: center;
	container-type: inline-size;
	position: sticky;
	top: 0;
	padding: 2em;
	height: 100vh
}

.wrap {
	display: grid;
	grid-auto-flow: column;
	grid-gap: 2em;
	translate: calc(var(--k)*(50cqw - 100%))
}

/* just support info */
aside {
	position: fixed;
	bottom: 0;
	padding: 1em;
}

.box-info-scrollani {
	margin: 1em;
	border-left: solid 5px #dc3055;
	padding: 1em;
	box-shadow: 2px 2px 5px hsla(0, 0%, 0%, .35);
	background: #851d40;
	color: #fff;
	font: 1.25em/ 1.25 ubuntu, trebuchet ms, arial, sans-serif;
	
	@supports (animation-timeline: view()) { display: none }
}

kbd {
	padding: 2px;
	background: hsla(0, 0%, 0%, .35);
	font: 1.1em/ 1.2 ubuntu mono, consolas, monaco, monospace
}

a { color: gold }
a:is(:focus, :hover) { color: lightskyblue }
              
            
!

JS

              
                
              
            
!
999px

Console