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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <div class="antialiased bg-gradient-to-b from-black to-gray-900 flex font-sans items-center justify-center min-h-screen px-12">
	<div class="flex h-72 items-stretch max-w-2xl min-w-md overflow-hidden w-full">
		<div class="active bg-center bg-cover bg-red-500 bg-red-img bg-no-repeat card cursor-pointer flex-grow m-2 min-w-14 overflow-hidden relative rounded-3xl transition-base">
			<div class="absolute bg-gradient-to-b bottom-0 from-transparent h-1/2 inset-x-0 opacity-0 shadow to-black transform transition-base translate-y-1/2 z-10"></div>
			<div class="absolute bottom-0 flex label left-0 mb-3 ml-2 transition-base z-20">
				<div class="bg-gray-900 flex h-10 icon items-center justify-center mr-3 rounded-full text-red-500 w-10">
					<i class="fas fa-walking"></i>
				</div>
				<div class="content flex flex-col justify-center leading-tight text-white whitespace-pre">
					<div class="font-bold opacity-0 relative transform transition-base translate-x-8">Lights</div>
					<div class="delay-100 opacity-0 relative transform transition-base translate-x-8">Chase your dreams</div>
				</div>
			</div>
		</div>
		<div class="bg-center bg-cover bg-yellow-500 bg-yellow-img bg-no-repeat card cursor-pointer flex-grow m-2 min-w-14 overflow-hidden relative rounded-3xl transition-base">
			<div class="absolute bg-gradient-to-b bottom-0 from-transparent h-1/2 inset-x-0 opacity-0 shadow to-black transform transition-base translate-y-1/2 z-10"></div>
			<div class="absolute bottom-0 flex label left-0 mb-3 ml-2 transition-base z-20">
				<div class="bg-gray-900 flex h-10 icon items-center justify-center rounded-full text-yellow-500 w-10">
					<i class="fas fa-apple-alt"></i>
				</div>
				<div class="content flex flex-col justify-center leading-tight ml-3 text-white whitespace-pre">
					<div class="font-bold opacity-0 relative transform transition-base translate-x-8">Construction</div>
					<div class="delay-100 opacity-0 relative transform transition-base translate-x-8">Build the extraordinary</div>
				</div>
			</div>
		</div>
		<div class="bg-center bg-cover bg-green-500 bg-green-img bg-no-repeat card cursor-pointer flex-grow m-2 min-w-14 overflow-hidden relative rounded-3xl transition-base">
			<div class="absolute bg-gradient-to-b bottom-0 from-transparent h-1/2 inset-x-0 opacity-0 shadow to-black transform transition-base translate-y-1/2 z-10"></div>
			<div class="absolute bottom-0 flex label left-0 mb-3 ml-2 transition-base z-20">
				<div class="bg-gray-900 flex h-10 icon items-center justify-center rounded-full text-green-500 w-10">
					<i class="fas fa-tree"></i>
				</div>
				<div class="content flex flex-col justify-center leading-tight ml-3 text-white whitespace-pre">
					<div class="font-bold opacity-0 relative transform transition-base translate-x-8">Landscape</div>
					<div class="delay-100 opacity-0 relative transform transition-base translate-x-8">Explore the surroundings</div>
				</div>
			</div>
		</div>
		<div class="bg-blue bg-cover-500 bg-blue-img bg-center bg-no-repeat card cursor-pointer flex-grow m-2 min-w-14 overflow-hidden relative rounded-3xl transition-base">
			<div class="absolute bg-gradient-to-b bottom-0 from-transparent h-1/2 inset-x-0 opacity-0 shadow to-black transform transition-base translate-y-1/2 z-10"></div>
			<div class="absolute bottom-0 flex label left-0 mb-3 ml-2 transition-base z-20">
				<div class="bg-gray-900 flex h-10 icon items-center justify-center rounded-full text-blue-500 w-10">
					<i class="fas fa-tint"></i>
				</div>
				<div class="content flex flex-col justify-center leading-tight ml-3 text-white whitespace-pre">
					<div class="font-bold opacity-0 relative transform transition-base translate-x-8">Pools</div>
					<div class="delay-100 opacity-0 relative transform transition-base translate-x-8">Soak in tranquility</div>
				</div>
			</div>
		</div>
		<div class="bg-center bg-cover bg-purple-500 bg-purple-img bg-no-repeat card cursor-pointer flex-grow m-2 min-w-14 overflow-hidden relative rounded-3xl transition-base">
			<div class="absolute bg-gradient-to-b bottom-0 from-transparent h-1/2 inset-x-0 opacity-0 shadow to-black transform transition-base translate-y-1/2 z-10"></div>
			<div class="absolute bottom-0 flex label left-0 mb-3 ml-2 transition-base z-20">
				<div class="bg-gray-900 flex h-10 icon items-center justify-center rounded-full text-purple-500 w-10">
					<i class="fas fa-palette"></i>
				</div>
				<div class="content flex flex-col justify-center leading-tight ml-3 text-white whitespace-pre">
					<div class="font-bold opacity-0 relative transform transition-base translate-x-8">Reflect</div>
					<div class="delay-100 opacity-0 relative transform transition-base translate-x-8">Harness your potential</div>
				</div>
			</div>
		</div>
	</div>
</div>
              
            
!

CSS

              
                .card.active {
	flex-grow: 10;
	max-width: 100%;

	.label {
		transform: translateX(0.5rem);

		.content > * {
			opacity: 1;
			transform: translateX(0);
		}
	}

	.shadow {
		opacity: 0.75;
		transform: translateY(0);
	}
}

.transition-base {
	transition-duration: 700ms;
	transition-property: all;
	transition-timing-function: cubic-bezier(0.2, 1, 0.25, 1);
}
              
            
!

JS

              
                const cards = document.querySelectorAll('.card');
let activeCard = cards[0];

cards.forEach((card) => {
	card.addEventListener('click', () => {
		activeCard.classList.remove('active');
		activeCard = card;
		activeCard.classList.add('active');
	});
});

tailwind.config = {
	theme: {
		extend: {
			backgroundImage: {
				'red-img': 'url("https://images.unsplash.com/photo-1519181245277-cffeb31da2e3?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=512&h=341&q=80")',
				'yellow-img': 'url("https://images.unsplash.com/photo-1485550409059-9afb054cada4?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=512&h=341&q=80")',
				'green-img': 'url("https://images.unsplash.com/photo-1488330890490-c291ecf62571?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=512&h=341&q=80")',
				'blue-img': 'url("https://images.unsplash.com/photo-1523633589114-88eaf4b4f1a8?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=512&h=341&q=80")',
				'purple-img': 'url("https://images.unsplash.com/photo-1511800453077-8c0afa94175f?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=512&h=341&q=80")'
			},
			colors: {
				gray: {
					'900': '#0f1011'
				}
			},
			minWidth: {
				'14': '3.5rem'
			}
		}
	}
};
              
            
!
999px

Console