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="container psy">
	<div class="psy-head">
		<div class="psy-face">
			<div class="psy-eye-wrap">
				<div class="psy-eye psy-eye-left"></div>
			</div>
			<div class="psy-eye-wrap">
				<div class="psy-eye psy-eye-right"></div>
			</div>
			<div class="psy-blush psy-blush-left"></div>
			<div class="psy-blush psy-blush-right"></div>
		</div>
		<div class="psy-beak">
			<div class="psy-beak-nose"></div>
		</div>
		<div class="psy-hair"></div>
	</div>
	<div class="psy-body">
		<div class="psy-arm psy-arm-left">
			<div class="psy-arm-claw"></div>
		</div>
		<div class="psy-arm psy-arm-right">
			<div class="psy-arm-claw"></div>
		</div>
		<div class="psy-tube psy-tube-front"></div>
		<div class="psy-tube psy-tube-back"></div>
		<div class="psy-torso"></div>
		<div class="psy-foot psy-foot-left">
			<div class="psy-foot-web"></div>
		</div>
		<div class="psy-foot psy-foot-right">
			<div class="psy-foot-web"></div>
		</div>
		<div class="water-magic"></div>
		<div class="water-ripple water-ripple-highlight"></div>
		<div class="water-ripple water-ripple-shadow"></div>
	</div>
	<div class="psy-thoughts psy-thoughts-1">
		<span class="psy-thoughts-symbol">?</span>
	</div>
	<div class="psy-thoughts psy-thoughts-2">
		<span class="psy-thoughts-symbol">?</span>
	</div>
</div>
              
            
!

CSS

              
                @mixin border-radius($top: 0, $bottom: 0) {
	border-top-left-radius: $top;
	border-top-right-radius: $top;
	border-bottom-right-radius: $bottom;
	border-bottom-left-radius: $bottom;
}

@mixin absolute-fill($pseudo: false) {
	@if ($pseudo) {
		content: '';
	}
	
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
}

@mixin triangle($size: 1rem, $color: var(--primary-color-dark)) {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: $size $size 0 $size;
	border-color: $color transparent transparent transparent;
}

$primary-color: #ffe6a4;
$primary-color-dark: darken($primary-color, 7%);
$primary-color-tint: lighten($primary-color, 10%);
$secondary-color: #ffeebd;
$secondary-color-dark: darken($secondary-color, 30%);
$secondary-color-tint: lighten($secondary-color, 10%);

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@900&display=swap');

:root {
	--black: #555;
	--white: #fff;
	--grey: #dedede;
	--primary-color: #{$primary-color};
	--primary-color-dark: #{$primary-color-dark};
	--primary-color-tint: #{$primary-color-tint};
	--secondary-color: #{$secondary-color};
	--secondary-color-dark: #{$secondary-color-dark};
	--secondary-color-tint: #{$secondary-color-tint};
	--accent-color: #f66a6a;
	--water-color: #a4ceff;
	--blush-color: #ff8394;
}

* { box-sizing: border-box; }
body {
	display: grid;
	place-items: center;
	min-height: 100vh;
	height: 100%;
	background-color: var(--primary-color-tint);
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-image: linear-gradient(0deg, var(--water-color) 50%, var(--primary-color-tint) 50%);
	font-family: 'Lato', sans-serif;
	font-size: 16px;
	line-height: 1;
	color: var(--black);
}

.psy {
	position: relative;
	animation: floaty 5s ease-in-out infinite;
	// perspective: 500px;
	
	&-eye {
		@include border-radius(50%, 50% 40%);
		
		position: absolute;
		z-index: 2;
		top: 4rem;
		height: 1.75rem;
		width: 2.5rem;
		background-color: var(--white);
		transform-origin: center 70%;
		animation: blinky 7s infinite;
		
		&::before {
			content: '';
			position: absolute;
			top: 50%;
			left: 40%;
			height: 0.5rem;
			width: 0.5rem;
			border-radius: 100%;
			background-color: var(--black);
			transition: transform 0.5s ease-in-out;
		}
		
		&-left {
			--rotate: -7deg;
			left: -0.125rem;
			transform: rotate(var(--rotate));
		}
		
		&-right {
			--rotate: 7deg;
			right: 2.75rem;
			transform: rotate(var(--rotate));
		}
	}
	
	&-blush {
		position: absolute;
		z-index: 1;
		top: 5.25rem;
		height: 1.5rem;
		width: 2.5rem;
		border-radius: 100%;
		background-color: var(--blush-color);
		opacity: 0.25;
		
		&-left {
			left: -1.5rem;
		}
		
		&-right {
			right: 1.5rem;
		}
	}
	
	&-face {
		@include border-radius(50% 60%, 40%);
		
		position: relative;
		z-index: 2;
		height: 100%;
		width: 100%;
		background-color: var(--primary-color);
		overflow: hidden;
	}
	
	&-beak {
		@include border-radius(40% 60%, 40%);
		
		position: absolute;
		z-index: 8;
		bottom: 1rem;
		left: 0;
		height: 2.5rem;
		width: 9rem;
		background-color: var(--secondary-color);
		
		&::before,
		&::after {
			content: '';
			position: absolute;
			background-color: inherit;
		}
		
		&::before {
			@include border-radius(50% 80%, 0.5rem 0);
			
			bottom: calc(100% - 0.25rem);
			left: 30%;
			height: 1rem;
			width: 3rem;
		}
		
		&::after {
			@include border-radius(1rem 60%, 40% 40%);
			
			top: 50%;
			left: 0.25rem;
			width: 90%;
			height: 4rem;
		}
		
		&-nose {
			position: absolute;
			top: 0;
			left: 30%;
			width: 3rem;
			
			&::before,
			&::after {
				content: '';
				position: absolute;
				top: 0;
				height: 0.1875rem;
				width: 1px;
				background-color: var(--secondary-color-dark);
			}

			&::before {
				left: 0.75rem;
				transform: rotate(-20deg);
			}

			&::after {
				right: 0.75rem;
				transform: rotate(20deg);
			}
		}
	}
	
	&-hair {
		@include border-radius(0.125rem, 50% 100%);
		
		position: absolute;
		z-index: 1;
		bottom: calc(100% - 0.375rem);
		left: 60%;
		height: 2rem;
		width: 0.75rem;
		transform-origin: center bottom;
		transform: rotate(10deg);
		background-color: var(--black);
		
		&::before,
		&::after {
			content: '';
			position: absolute;
			bottom: 0;
			left: 0;
			transform-origin: center bottom;
			border-radius: inherit;
			background-color: inherit;
		}
		
		&::before {
			height: 80%;
			width: 80%;
			transform: rotate(-40deg);
		}
		
		&::after {
			height: 90%;
			width: 75%;
			transform: rotate(60deg);
		}
	}
	
	&-head {
		position: relative;
		z-index: 10;
		height: 9.5rem;
		width: 12rem;
		transition: transform 0.7s ease-in-out;
	}
	
	&-arm {
		@include border-radius(50% 30%, 0.5rem 70%);
		
		position: absolute;
		top: 0.75rem;
		height: 3.5rem;
		width: 2rem;
		transform-origin: center 1rem;
		background-color: var(--primary-color-dark);
		transition: transform 0.4s ease-in-out;
		
		&-claw {
			left: 50%;
			top: 100%;
			transform: translateX(-50%) scaleX(1.1);
			
			&,
			&::before,
			&::after {
				@include triangle(0.25rem);
				position: absolute;
			}
			
			&::before,
			&::after {
				content: '';
				top: -0.25rem;
			}
			
			&::before {
				left: 100%;
			}
			
			&::after {
				right: 100%;
			}
		}
		
		&-left {
			z-index: 5;
			left: -0.75rem;
			transform: rotate(70deg);
		}
		
		&-right {
			z-index: 11;
			right: 0.75rem;
			transform: rotate(-60deg);
		}
	}
	
	&-foot {
		@include border-radius(50% 30%, 0.325rem 70%);

		position: absolute;
		z-index: 1;
		top: calc(100% - 1rem);
		height: 2rem;
		width: 2.25rem;
		transform-origin: top center;
		background-color: var(--secondary-color);
		animation: swimKick 4s infinite ease-in-out;
		
		&-web {
			left: 50%;
			top: 100%;
			transform: translateX(-50%) scaleX(1.3);
			
			&,
			&::before,
			&::after {
				@include triangle(0.325rem, var(--secondary-color));
				position: absolute;
			}
			
			&::before,
			&::after {
				content: '';
				top: -0.325rem;
			}
			
			&::before {
				left: 100%;
			}
			
			&::after {
				right: 100%;
			}
		}
		
		&-left {
			left: 3.5rem;
			animation-delay: 1s;
		}
		
		&-right {
			right: 2rem;
		}
	}
	
	&-tube {
		position: absolute;
		bottom: 15%;
		left: 45%;
		height: var(--tube-height, 10rem);
		width: var(--tube-width, 185%);
		transform: translateX(-50%) scaleY(0.85);
		border-radius: 100%;
		border: 4.5rem solid var(--accent-color);
		
		&-front {
			z-index: 4;
			border-top-color: transparent;
			
// 			&::after {
// 				@include border-radius(50% 40%, 50% 60%);
				
// 				content: '';
// 				position: absolute;
// 				right: -3.75rem;
// 				bottom: 0;
// 				height: 100%;
// 				width: 100%;
// 				transform: scaleX(0.7) scaleY(3);
// 				border-right: 1.5rem solid var(--white);
// 				opacity: 0.6;
// 			}
			
			&::before,
			&::after {
				content: '';
				position: absolute;
				background-color: var(--white);
				opacity: 0.7;
			}
			
			&::before {
				right: -2rem;
				top: 1rem;
				height: 1.5rem;
				width: 1rem;
				transform: rotate(60deg);
				border-radius: 100%;
			}
			
			&::after {
				top: 2.25rem;
				right: 0.75rem;
				height: 1.5rem;
				width: 40%;
				transform: rotate(-5deg);
				border-radius: 100%;
			}
		}
		
		&-back {
			z-index: 1;
			border-color: transparent;
			border-top-color: var(--accent-color);
		}
	}
	
	&-torso {
		@include border-radius(40% 60%, 40% 40%);
		
		position: relative;
		z-index: 2;
		height: 100%;
		width: 100%;
		background-color: var(--primary-color);
	}
	
	&-body {
		position: absolute;
		left: 1.5rem;
		top: calc(100% - 2rem);
		height: 8.5rem;
		width: 11rem;
	}
	
	&-thoughts {
		position: absolute;
		display: grid;
		place-items: center;
		height: 4rem;
		width: 4rem;
		transition: transform 0.1s ease-in-out;
		
		&::before {
			@include triangle(0.75rem, var(--white));
			
			content: '';
			position: absolute;
			top: 100%;
			left: 30%;
		}
		
		&::after {
			@include absolute-fill(true);
			
			z-index: 1;
			background-color: var(--white);
			border-radius: 0.25rem;
		}
		
		&-symbol {
			position: relative;
			z-index: 5;
			font-size: 2.25rem;
			font-weight: 900;
		}
		
		&-1 {
			bottom: calc(100% - 0.5rem);
			left: -2.5rem;
			transform-origin: 30% bottom;
			transform: rotate(-30deg) scale(var(--thought-scale-1, 0));
			
			&::after {
				transform: perspective(0.5rem) rotateX(2deg) skew(10deg);
			}
			
			.psy-thoughts-symbol {
				top: 0.25rem;
				transform: rotate(10deg);
			}
		}
		
		&-2 {
			bottom: calc(100% + 3rem);
			left: 1.5rem;
			transform: rotate(5deg) scale(var(--thought-scale-2, 0));
			
			&::before {
				top: calc(100% - 0.5rem);
			}
			
			&::after {
				transform: perspective(0.5rem) rotateX(-3deg) skewY(5deg);
			}
			
			.psy-thoughts-symbol {
				top: -0.5rem;
				transform: rotate(-5deg);
			}
		}
	}
	
	&:hover {
		.psy {
			&-eye {
				&::before {
					transform: translateY(-0.5rem);
					transition-delay: 0.55s;	
				}
			}
			
			&-head {
				transform: rotate(12deg);
				transition-delay: 0.5s;
			}
			
			&-arm {
				&-left {
					transform: rotate(170deg) translateY(0.625rem);
				}
				
				&-right {
					transform: rotate(-160deg) translateY(0.625rem);
				}
			}
			
			&-foot {
				animation-duration: 0.5s;
				
				&-left {
					animation-delay: 0.125s;
				}
			}
			
			&-thoughts {
				--thought-scale-1: 1;
				--thought-scale-2: 1;
				
				&-1 {
					transition-delay: 1.5s;
				}
				
				&-2 {
					transition-delay: 2s;
				}
			}
		}
	}
}

.water {
	&-magic {
		position: absolute;
		z-index: 3;
		background-color: var(--water-color);
		top: 3.25rem;
		left: -50%;
		height: 100%;
		width: 200%;
		opacity: 0.7;
	}
	
	// &-ring {
	// 	top: 2.5rem;
	// 	left: -45%; 
	// 	height: 4.5rem;
	// 	width: 160%;
	// 	transform-origin: bottom center;
	// 	border-radius: 50%;
	// 	border-top-left-radius: 50% 20%;
	// 	border-bottom-left-radius: 50% 80%;
	// 	opacity: 0.6;
	// 	mix-blend-mode: multiply;
	// 	animation: floatyInverse 5s ease-in-out infinite;
	// }
	
	&-ripple {
		@include border-radius(50% 20%, 50% 80%);
		
		position: absolute;
		z-index: 3;
		top: 2.625rem;
		left: -45%; 
		height: 4.5rem;
		width: 180%;
		
		&-shadow {
			transform-origin: bottom center;
			background-color: var(--water-color);
			opacity: 0.6;
			mix-blend-mode: multiply;
			animation: floatyInverse 5s ease-in-out infinite;
		}
		
		&-highlight {
			transform-origin: top center;
			background-color: var(--white);
			opacity: 0.3;
			animation: floatyRipple 5s ease-in-out infinite;
		}
	}
}

@keyframes blinky {
	0%, 9%, 11%, 19%, 21%, 69%, 71%, 100% { transform: scaleY(1) rotate(var(--rotate)) }
	10%, 20%, 70% { transform: scaleY(0) rotate(var(--rotate)) }
}

@keyframes floaty {
	0%, 100% { transform: translateY(0) }
	50% { transform: translateY(0.5rem) }
}

@keyframes floatyInverse {
	0%, 100% { transform: translateY(0) scaleY(1) scaleX(1) }
	50% { transform: translateY(-0.3rem) scaleY(0.9) scaleX(1.02) }
}

@keyframes floatyRipple {
	0%, 10% { 
		transform: scale(0.6);
		opacity: 0.3;
	}
	100% {
		transform: scale(1.5);
		opacity: 0;
	}
}

@keyframes swimKick {
	0%, 100% { transform: rotateX(0deg) }
	25% { transform: rotateX(40deg) }
	75% { transform: rotateX(-40deg) }
}
              
            
!

JS

              
                // 🦆
              
            
!
999px

Console