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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                %ul{:ontouchstart => true}
	%li
		.flash.success
			.bg
				.bg-icon
				.bg-btns
			.inside
				%figure.icon
					%svg{:viewBox => "0 0 84 84"}
						%g{:fill => "none"}
							%circle{:fill => "#BDE3CA", :cx => "42", :cy => "42", :r => "42"}
							%path{:d => "M30,62 C33.0710678,65.0710678 37.3137085,66.9705627 42,66.9705627 C46.6862915,66.9705627 50.9289322,65.0710678 54,62", :stroke => "#5FB67D", :"stroke-width" => "5"}
							%circle{:fill => "#5FB67D", :cx => "30", :cy => "42", :r => "3"}
							%circle{:fill => "#5FB67D", :cx => "54", :cy => "42", :r => "3"}
				%div
					%h2 Success!
					%p You’re all set. Want to share it with the world?
				.btns
					%button
						%svg{:viewBox => "0 0 56 56"}
							%polyline{:points => "16 29.4852814 24.4852814 37.9705627 41.4852814 21", :fill => "none", :"stroke-width" => "4", :stroke => "#5FB67D"}
						%span Share
					%button
						%svg{:viewBox => "0 0 56 56"}
							%g{:fill => "none", :stroke => "#ADBBB2", :"stroke-width" => "4"}
								%polyline{:points => "31.5147186 19.5147186 40 28 31.5147186 36.4852814"}
								%line{:x1 => "40", :x2 => "16", :y1 => "28", :y2 => "28"}
						%span Skip
	%li
		.flash.working
			.bg
				.bg-icon
				.bg-btns
			.inside
				%figure.icon
					%svg{:viewBox => "0 0 84 84"}
						%g{:fill => "none"}
							%circle{:fill => "#EEE5C6", :cx => "42", :cy => "42", :r => "42"}
							%circle{:stroke => "#E1C55E", :"stroke-width" => "5", :cx => "42", :cy => "63", :r => "7"}
							%circle{:fill => "#E1C55E", :cx => "30", :cy => "42", :r => "3"}
							%circle{:fill => "#E1C55E", :cx => "54", :cy => "42", :r => "3"}
				%div
					%h2 Working on it!
					%p It’s taking a little longer than normal this time.
				.btns
					%button
						%svg{:viewBox => "0 0 56 56"}
							%g{:fill => "#E1C55E"}
								%circle{:cx => "16", :cy => "28", :r => "3"}
								%circle{:cx => "28", :cy => "28", :r => "3"}
								%circle{:cx => "40", :cy => "28", :r => "3"}
	%li
		.flash.error
			.bg
				.bg-icon
				.bg-btns
			.inside
				%figure.icon
					%svg{:viewBox => "0 0 84 84"}
						%g{:fill => "none"}
							%circle{:fill => "#F4B6BA", :cx => "42", :cy => "42", :r => "42"}
							%path{:d => "M30,65 C33.0710678,61.9107443 37.3137085,60 42,60 C46.6862915,60 50.9289322,61.9107443 54,65", :stroke => "#C46465", :"stroke-width" => "5"}
							%circle{:fill => "#C46465", :cx => "30", :cy => "45", :r => "3"}
							%circle{:fill => "#C46465", :cx => "54", :cy => "45", :r => "3"}
				%div
					%h2 Whoops!
					%p We were unable to complete your request.
				.btns
					%button
						%svg{:viewBox => "0 0 56 56"}
							%g{:fill => "none", :"stroke-width" => "4", :stroke => "#C46465"}
								%path{:d => "M28,15 C20.8202983,15 15,20.8202983 15,28 C15,35.1797017 20.8202983,41 28,41 C35.1797017,41 41,35.1797017 41,28 C41,26.2373929 40.649213,24.5567164 40.0136429,23.0239745"}
								%polyline{:points => "19.8973389 11.0570105 27.9864853 15.0023508 24.041145 23.0914972"}
						%span Try again
              
            
!

CSS

              
                $f: "brandon-grotesque", "Brandon Grotesque", sans-serif;
@mixin sdo($s, $t, $d) {
	stroke-dasharray: $s;
	stroke-dashoffset: $s;
	will-change: stroke-dashoffset;
	animation: sdo $t ease-out $d both;
}

*, *:before, *:after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: rgba(0,0,0,0); }
*:focus { outline: none!important; }
::selection { background: none; }
a { cursor: pointer; }
body, html { height: 100%; }

body {
	display: flex;
	align-content: center;
	justify-content: center;
	background: #1E3647;
	color: white;
	font-family: $f;
}

ul {
	display: flex;
	align-content: center;
	justify-content: center;
	width: 100%;
	list-style: none;
}

.flash {
	position: relative;
	width: 100%;
	max-width: 288px;
	svg {
		stroke-linecap: round;
		stroke-linejoin: round;
	}
	.bg {
		> div {
			position: absolute;
			z-index: -1;
		}
		.bg-icon {
			top: -52px;
			left: calc(50% - 52px);
			width: 104px;
			height: 104px;
			background: #4B5E6B;
			border-radius: 100%;
		}
		.bg-btns {
			display: flex;
			align-items: center;
			align-content: center;
			justify-content: space-between;
			position: absolute;
			bottom: -38px;
			left: calc(50% - 88px);
			width: 176px;
			&:before, &:after {
				content: "";
				display: block;
				width: 76px;
				height: 76px;
				background: #4B5E6B;
				border-radius: 100%;
			}
		}
	}
	.inside {
		border: 4px solid #4B5E6B;
		border-radius: 6px;
		height: 230px;
		padding: 48px 25px 0;
	}
	h2 {
		font-size: 36px;
		font-weight: 800;
		line-height: 52px;
		text-align: center;
	}
	p {
		font-size: 20px;
		font-weight: 500;
		line-height: 29px;
	}
	.btns {
		display: flex;
		align-items: center;
		align-content: center;
		justify-content: space-between;
		position: absolute;
		bottom: -34px;
		left: calc(50% - 84px);
		width: 168px;
	}
	button {
		position: relative;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		appearance: none;
		width: 68px;
		height: 68px;
		border: 0;
		border-radius: 100%;
		padding: 0;
		font-family: $f;
		svg {
			will-change: transform;
			transition: all 300ms ease-out;
			transform-origin: center center;
			width: 56px;
			height: 56px;
			border-radius: 100%;
			background: white;
		}
		span {
			display: block;
			position: absolute;
			bottom: -26px;
			color: rgba(white, .5);
			font-size: 12px;
			text-transform: uppercase;
		}
		&:hover, &:focus {
			svg {
				transition: all 400ms cubic-bezier(.6,0,.1,2);
				transform: scale(1.2);
			}
		}
		&:active {
			svg {
				transition: all 150ms ease-in;
				transform: scale(0.9);
			}
		}
	}
	.icon {
		position: absolute;
		top: -48px;
		left: calc(50% - 48px);
		width: 96px;
		height: 96px;
		border-radius: 100%;
		padding: 6px;
		svg {
			width: 84px;
			height: 84px;
		}
	}
	// individual
	&.success {
		.inside, .icon, button {
			background-color: #5FB67D;
		}
	}
	&.working {
		.inside, .icon, button {
			background-color: #E1C55E;
		}
		.bg .bg-btns, .btns {
			justify-content: center;
			&:after {
				display: none;
			}
		}
		button {
			pointer-events: none;
			svg {
				background: rgba(white, .5);
			}
		}
	}
	&.error {
		.inside, .icon, button {
			background-color: #C46465;
		}
		.bg .bg-btns, .btns {
			justify-content: center;
			&:after {
				display: none;
			}
		}
	}
	// animation
	.icon {
		circle {
			&:not(:first-child) {
				transform: scale(0);
				animation: tsfm 100ms ease-out both;
			}
			&:nth-child(3) {
				transform-origin: 30px 42px;
			}
			&:nth-child(4) {
				transform-origin: 54px 42px;
			}
		}
	}
	&.success, &.working {
		opacity: 0;
		visibility: hidden;
		transform-origin: left top;
		transform: rotateX(30deg) rotateY(30deg) translateY(300px) translateZ(0);
		will-change: opacity, transform, visibility;
		animation: tsfm-op 750ms cubic-bezier(0,.6,.3,1) both;
	}
	&.success {
		animation-delay: 250ms;
		.icon {
			path {
				@include sdo(26.661, 250ms, 700ms);
			}
			circle {
				// transform-origin: 50% 50%;
				&:nth-child(3) {
					animation-delay: 500ms;
				}
				&:nth-child(4) {
					animation-delay: 600ms;
				}
			}
		}
		button {
			span {
				opacity: 0;
				visibility: hidden;
				transform: translateY(100%);
				animation: tsfm-op 500ms cubic-bezier(0,.75,.25,1) both;
			}
			&:nth-child(1) {
				polyline {
					@include sdo(36.1, 350ms, 900ms);
				}
				span {
					animation-delay: 1400ms;
				}
			}
			&:nth-child(2) {
				polyline {
					@include sdo(24.1, 250ms, 1000ms);
				}
				line {
					@include sdo(24, 250ms, 1100ms);
				}
				span {
					animation-delay: 1500ms;
				}
			}
		}
	}
	&.working {
		animation-delay: 500ms;
		.icon {
			circle {
				&:nth-child(2) {
					@include sdo(43.982, 400ms, 950ms);
					transform: scale(1);
				}
				&:nth-child(3) {
					animation-delay: 750ms;
				}
				&:nth-child(4) {
					animation-delay: 850ms;
				}
			}
		}
		button {
			circle {
				opacity: 0;
				will-change: opacity;
				&:nth-child(1) {
					animation: ellipsis-1 900ms ease-out infinite forwards;
				}
				&:nth-child(2) {
					animation: ellipsis-2 900ms ease-out infinite forwards;
				}
				&:nth-child(3) {
					animation: ellipsis-3 900ms ease-out infinite forwards;
				}
			}
		}
	}
	&.error {
		opacity: 0;
		animation: jitter 225ms ease-in-out 2 both 750ms;
		.icon {
			path {
				@include sdo(26.661, 250ms, 1200ms);
			}
			circle {
				// transform-origin: 50% 50%;
				&:nth-child(3) {
					animation-delay: 1000ms;
				}
				&:nth-child(4) {
					animation-delay: 1100ms;
				}
			}
		}
		button {
			transform-origin: center center;
			transform: rotate(90deg);
			will-change: transform;
			animation: tsfm 570ms ease-out 1000ms both;
			polyline {
				@include sdo(18.1, 200ms, 1300ms);
			}
			path {
				@include sdo(66.376, 650ms, 1400ms);
			}
			span {
				opacity: 0;
				visibility: hidden;
				transform: translateY(100%);
				animation: tsfm-op 500ms cubic-bezier(0,.75,.25,1) 1700ms both;
			}
		}
	}
}

// responsive
body {
	align-items: flex-start;
} 
ul {
	flex-flow: row wrap;
	padding: 12px 12px 78px;
	li {
		padding: 98px 12px 12px;
		&:nth-child(1) {
			padding-top: 74px;
		}
	}
}

@media only screen and (min-width: 648px) {
	ul {
		li {
			// padding: 12px;
			&:nth-child(2) {
				padding-top: 74px;
			}
		}
	}
}

@media only screen and (min-width: 960px) {
	body {
		align-items: center;
	}
	ul {
		align-items: center;
		padding: 12px;
		li {
			padding: 12px;
			&:nth-child(1), &:nth-child(2) {
				padding-top: 12px;
			}
		}
	}
}

// animations
@keyframes tsfm {
	to { transform: none; }
}

@keyframes op {
	to { opacity: 1; }
}

@keyframes sdo {
	to { stroke-dashoffset: 0; }
}

@keyframes ellipsis-1 {
	0% { opacity: 0; }
	20%, 95% { opacity: 1; }
	100% { opacity: 0; }
}

@keyframes ellipsis-2 {
	0%, 20% { opacity: 0; }
	40%, 95% { opacity: 1; }
	100% { opacity: 0; }
}

@keyframes ellipsis-3 {
	0%, 40% { opacity: 0; }
	60%, 95% { opacity: 1; }
	100% { opacity: 0; }
}

@keyframes tsfm-op {
	10% {
		opacity: 1;
		visibility: visible;
	}
	100% {
		opacity: 1;
		visibility: visible;
		transform: none;
	}
}

@keyframes jitter {
	0% {
		transform: translateX(0px) translateY(0px);
		opacity: 0;
	}
	10% {
		transform: translateX(4px) translateY(4px);
		opacity: 0.8;
	}
	20% {
		transform: translateX(0px) translateY(0px);
		opacity: 0.47;
	}
	30% {
		transform: translateX(0px) translateY(4px);
		opacity: 0.3;
	}
	70% {
		transform: translateX(-2px) translateY(2px);
		opacity: 0.96;
	}
	80% {
		transform: translateX(0px) translateY(-4px);
		opacity: 0.9;
	}
	90% {
		transform: translateX(2px) translateY(-4px);
		opacity: 0.81;
	}
	100% {
		transform: translateX(0) translateY(0);
		opacity: 1;
	}
}
              
            
!

JS

              
                // ⟁ \\
              
            
!
999px

Console