cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              .superman
	.superman--bodyAndLegs
		.superman--symbol.superman--symbol__red
		.superman--symbol.superman--symbol__yellow
	.superman--arm.superman--arm__left
	.superman--arm.superman--arm__right
	.superman--neck
		.superman--head
			.superman--mouth
			.superman--eye.superman--eye__left
			.superman--eye.superman--eye__right
	.superman--cap
	
.clouds.clouds__back
	div
	div
	div
	div
	div
.clouds.clouds__front
	div
	div
	div
            
          
!
            
              /// Slightly lighten a color
/// @access public
/// @param {Color} $color - color to tint
/// @param {Number} $percentage - percentage of `$color` in returned color
/// @return {Color}
@function tint($color, $percentage) {
	@return mix(white, $color, $percentage);
}

/// Slightly darken a color
/// @access public
/// @param {Color} $color - color to shade
/// @param {Number} $percentage - percentage of `$color` in returned color
/// @return {Color}
@function shade($color, $percentage) {
	@return mix(black, $color, $percentage);
}

*, *:before, *:after {
	box-sizing: border-box;
}

html {
	font-family: caveat brush, arial, sans-serif;
	font-size: 7px;
	background-color: #6BB9F0;
	@media screen and (min-width: 640px) {
		font-size: 10px;
	}
}

body {
	&::after {
		content: 'Daily CSS Images #21 : Superman';
		position: absolute;
		top: 5rem;
		left: 0;
		right: 0;
		font-size: 2.8rem;
		text-align: center;
		color: white;
	}
}

$blue: #044f86;
$skin: #f1a66c;
$red: #F22613;

.superman {
	position: fixed;
	z-index: 1;
	top: calc(50% - 6rem);
	left: calc(50% - 4rem);
	perspective: 100rem;
	animation: move 2s linear infinite;
	&--bodyAndLegs {
		position: relative;
		width: 8rem;
		height: 12rem;
		background-color: $blue;
		border-bottom: 1.5rem solid #ffd71f;
		box-shadow: 0 2.5rem 0 0 $red;
		&::before, &::after {
			content: '';
			position: absolute;
			width: 3.4rem;
			border-bottom-right-radius: 2rem;
			border-bottom-left-radius: 2rem;
			background-image: linear-gradient(to bottom, $blue 0, $blue, 75%, $red 75%, $red 100%);
		}
		&::before { // Leg
			left: 0;
			top: calc(100% + 2.4rem);
			height: 14rem;
			border-top-right-radius: 5rem 3rem;
		}
		&::after { // Leg
			right: 0;
			top: calc(100% + 2rem);
			height: 10rem;
			border-top-left-radius: 5rem 3rem;
			box-shadow: inset 0 3rem 0 shade($blue, 15);
		}
	}
	&--arm {
		position: absolute;
		width: 3rem;
		height: 13rem;
		border-top-left-radius: 3rem;
		border-bottom-right-radius: 3rem;
		border-bottom-left-radius: 3rem;
		&__left {
			top: 5rem;
			right: -2rem;
			transform: rotate(190deg);
			transform-origin: top center;
			background-image: linear-gradient(to bottom, $blue 0, $blue, 85%, $skin 85%, $skin 100%);
		}
		&__right {
			top: 0;
			right: 100%;
			background-image: 
				linear-gradient(-45deg, transparent 0, transparent 75%, $red 75%, $red 100%),
				linear-gradient(to bottom, $blue 0, $blue, 85%, $skin 85%, $skin 100%);
			background-repeat: no-repeat;
		}
	}
	&--neck {
		position: absolute;
		top: 0;
		left: 0;
		width: calc(100% - .8rem);
		height: 1rem;
		background-color: $skin;
		border-radius: .2rem;
		&::before {
			content: '';
			position: absolute;
			top: 0;
			left: 100%;
			width: 0;
			height: 0;
			border-style: solid;
			border-width: .8rem .8rem 0 0;
			border-color: $red transparent transparent transparent;
		}
	}
	&--cap {
		position: absolute;
		top: -12rem;
		left: -4rem;
		z-index: -1;
		width: 15rem;
		height: 46rem;
		transform: rotateX(60deg);
		background-color: shade($red, 40); 
		border-radius: 1rem;
		animation: cap 2s infinite linear;
	}
	&--head {
		position: absolute;
		bottom: .8rem;
		left: 50%;
		height: 6rem;
		width: 5rem;
		transform: translateX(-50%);
		background-color: $skin;
		border-radius: .8rem;
		box-shadow: 0 -1.2rem 0 .1rem black;
		&::before {
			content: '';
			position: absolute;
			top: -.6rem;
			left: 2rem;
			border-right: .5rem solid black;
			width: 2rem;
			height: 1.5rem;
			border-radius: 50%;
		}
	}
	&--mouth {
		position: absolute;
		bottom: 1.5rem;
		left: 50%;
		width: 2rem;
		height: 1rem;
		transform: translateX(-50%);
		border-bottom: .4rem solid white;
		border-radius: 50%;
	}
	&--eye {
		position: absolute;
		top: 1.5rem;
		width: .8rem;
		height: .8rem;
		border-radius: 50%;
		background-color: white;
		&::before {
			content: '';
			position: absolute;
			top: -.5rem;
			width: 1rem;
			height: .2rem;
			background-color: black;
		}
		&__left {
			right: 20%;
			box-shadow: inset -.1rem -.1rem 0 .2rem #22313F;
			&::before {
				right: 0;
				transform: rotate(-15deg);
			}
		}
		&__right {
			left: 20%;
			box-shadow: inset .1rem -.1rem 0 .2rem #22313F;
			&::before {
				left: 0;
				transform: rotate(5deg);
			}
		}
	}
	&--symbol {
		position: absolute;
		border-style: solid;
		height: 0;
		top: 2rem;
		left: .2rem;
		border-width: 0 2rem 1rem 2rem;
		width: 7rem;
		&::before {
			content: '';
			position: absolute;
			left: -2rem;
			width: 0;
			height: 0;
			border-style: solid;
			border-width: 5rem 3.55rem 0 3.55rem;
		}
		&__red {
			z-index: 0;
			border-color: transparent transparent $red transparent;
			&::before {
				top: .9rem;
				border-color: $red transparent transparent transparent;
			}
		}
		&__yellow {
			top: 2.3rem;
			z-index: 1;
			transform: scale(.8);
			border-color: transparent transparent #ffd71f transparent;
			&::before {
				top: .9rem;
				border-color: #ffd71f transparent transparent transparent;
			}
			&::after {
				content: 'S';
				position: absolute;
				left: -1rem;
				top: -.8rem;
				z-index: 1;
				font-size: 5.6rem;
				color: $red;
				font-family: "goblin one";
			}
		}
	}
}

@keyframes move {
	0% {
		transform: translate3d(0,0,0) rotate(25deg);
	}
	10% {
		transform: translate3d(.2rem,.2rem,0) rotate(25deg);
	}
	20% {
		transform: translate3d(.2rem,0,0) rotate(25deg);
	}
	30% {
		transform: translate3d(.4rem,.4rem,0) rotate(25deg);
	}
	40% {
		transform: translate3d(0,.3rem,0) rotate(25deg);
	}
	50% {
		transform: translate3d(-.2rem,0,0) rotate(25deg);
	}
	60% {
		transform: translate3d(.4rem,-.4rem,0) rotate(25deg);
	}
	70% {
		transform: translate3d(-.1rem,-.3rem,0) rotate(25deg);
	}
	80% {
		transform: translate3d(.3rem,-.4rem,0) rotate(25deg);
	}
	90% {
		transform: translate3d(-.2rem,.1rem,0) rotate(25deg);
	}
	100% {
		transform: translate3d(0,0,0) rotate(25deg);
	}
}

@keyframes cap {
	0% {
		transform: rotateX(60deg);
	}
	10% {
		transform: rotateX(65deg);
	}
	20% {
		transform: rotateX(62deg);
	}
	30% {
		transform: rotateX(65deg);
	}
	40% {
		transform: rotateX(62deg);
	}
	50% {
		transform: rotateX(70deg);
	}
	60% {
		transform: rotateX(65deg);
	}
	70% {
		transform: rotateX(63deg);
	}
	80% {
		transform: rotateX(62deg);
	}
	90% {
		transform: rotateX(65deg);
	}
	100% {
		transform: rotateX(60deg);
	}
}

.clouds {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	&__back {
		z-index: 0;
		animation: cloudsBack 4s infinite linear;
		div {
			&:nth-child(1) {
				top: 20%;
				left: 20%;
			}
			&:nth-child(2) {
				bottom: 10%;
				right: 20%;
			}
			&:nth-child(3) {
				bottom: -50%;
				left: -50%;
			}
			&:nth-child(4) {
				top: -50%;
				left: 50%;
			}
			&:nth-child(5) {
				top: 50%;
				left: 50%;
			}
		}
	}
	&__front {
		z-index: 2;
		opacity: .8;
		animation: cloudsFront 4s infinite linear;
		div {
			transform: scale(2);
			&:nth-child(1) {
				top: 70%;
				left: 70%;
			}
			&:nth-child(2) {
				bottom: 20%;
				left: 0;
			}
			&:nth-child(3) {
				top: -20%;
				left: 60%;
			}
		}
	}
	div {
		position: absolute;
		border-radius: 5rem;
		height: 5rem;
		width: 16rem;
		background-color: #fff;
		&::before, &::after {
			content: '';
			position: absolute;
			border-radius: 50%;
		}
		&::before {
			height: 9rem;
			left: 2rem;
			top: -4rem;
			width: 9rem; 
			background-color: white;
		}
		&::after {
			height: 7rem;
			right: 2rem;
			top: -3rem;
			width: 7rem;
			background-color: white;
		}
	}
}

@keyframes cloudsBack {
	from {
		transform: translate3d(200%, -240%, 0);
	}
	to {
		transform: translate3d(-200%, 240%, 0);
	}
}

@keyframes cloudsFront {
	from {
		transform: translate3d(300%, -300%, 0);
	}
	to {
		transform: translate3d(-150%, 150%, 0);
	}
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console