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

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.

            
              <h1>Daily CSS Images: Day 04</h2>
<h2>Christian Valentin</h2>
<h3>Tiger!!</h3>
<h4><a href="//dribbble.com/shots/1369454-Tiger" target="_blank">Design by Richard Perez</a></h4>
	
<!-- .head>(.ear-block>.ear*2)+(.stripes-block-1>.stripes*2)+(.eyes-block>.eye*2)+(.nose)+(.cheek_block>.cheek_$*2)+(.mouth-block>.skin+.mouth>.hole+.teeth) -->

<div class="tiger">
	<div class="ear-block">
		<div class="ear"></div>
		<div class="ear"></div>
	</div>
	<div class="stripes-block">
		<div class="stripes"></div>
		<div class="stripes"></div>
	</div>
	<div class="eyes-block">
		<div class="eye"></div>
		<div class="eye"></div>
	</div>
	<div class="nose"></div>
	<div class="cheek-block">
		<div class="cheek_1"></div>
		<div class="cheek_2"></div>
	</div>
	<div class="mouth-block">
		<div class="skin"></div>
		<div class="mouth">
			<div class="hole"></div>
			<div class="teeth"></div>
		</div>
	</div>
</div>
            
          
!
            
              @mixin css3-prefix($property, $value) {
	-webkit-#{$property}: #{$value};
	-khtml-#{$property}: #{$value};
	-moz-#{$property}: #{$value};
	-ms-#{$property}: #{$value};
	-o-#{$property}: #{$value};
	#{$property}: #{$value};
}
@mixin border-radius($radius: 5px) {
	@include css3-prefix('border-radius', $radius);
}
@mixin animation($params) {
	@include css3-prefix('animation', $params);
}
@mixin transform($params) {
	@include css3-prefix('transform', $params);
}
@mixin keyframe ($animation_name) {
	@-webkit-keyframes #{$animation_name} {
		@content;
	}
	@-moz-keyframes #{$animation_name} {
		@content;
	}
	@-o-keyframes #{$animation_name} {
		@content;
	}
	@keyframes #{$animation_name} {
		@content;
	}
}
@mixin pseudo() {
	&:before,
	&:after {
		content: "";
		display: block;
		position: absolute;
		@content;
	}
}

$bg: #febd15;
body {
	background: $bg;
	padding: 30px;
	text-align: center;
	font-family: 'Amatic SC', cursive;
	font-size: 4.5em;
	color: #ecf0f1;
	a {
		color: inherit;
		text-decoration: none;
	}
	div {
		position: relative;
		box-sizing: border-box;
	}
	> div {
		display: inline-block;
	}
	h2 {
		font-size: 0.7em;
	}
	h3 {
		font-size: 0.5em;
	}
	h4 {
		font-size: 0.3em;
		margin-bottom: 70px;
	}
}

$orange-0: #f4bc13; // Pure light side of the force
$orange-1: #f47c23; // Lighter
$orange-2: #ed6821; // Darker
$black-1: #001837; // Or blue?
$black-2: #0c160f; // Darker
$white-1: #fffbfd; // Light
$white-2: #e6e4e6; // Still light, but darker
.tiger {
	// $tiger-size-basis: 450px;
	$tiger-size-basis: 450px;
	@include border-radius(35% 35% 0 0);
	background: $orange-1;
	width: ($tiger-size-basis * (350px / $tiger-size-basis));
	height: ($tiger-size-basis * (400px / $tiger-size-basis));
	.ear-block {
		position: absolute;
		width: 100%;
		height: ($tiger-size-basis * (100px / $tiger-size-basis));
		top: -($tiger-size-basis * (70px / $tiger-size-basis));
		left: 0;
		right: 0;
		.ear {
			@include border-radius(100%);
			position: absolute;
			height: ($tiger-size-basis * (100px / $tiger-size-basis));
			width: ($tiger-size-basis * (100px / $tiger-size-basis));
			background: $orange-1;
			&:first-child {
				@include animation(twink-L 2s ease infinite);
				left: 0;
			}
			&:last-child {
				@include animation(twink-R 2s ease infinite);
				right: 0;
			}
		}
	}
	.stripes-block {
		@include border-radius(35%);
		position: absolute;
		overflow: hidden;
		width: 100%;
		height: 100%;
		z-index: 0;
		.stripes {
			$stripe-height: ($tiger-size-basis * (60px / $tiger-size-basis));
			$stripe-width: ($tiger-size-basis * (45px / $tiger-size-basis));
			position: absolute;
			z-index: 0;
			@include pseudo() {
				width: 0;
				height: 0;
				border-top: $stripe-height solid $black-2;
				border-left: $stripe-width solid transparent;
			}
			&:after {
				left: $stripe-width;
				border-top-width: ($stripe-height * (3/4));
				border-left-width: ($stripe-width * (3/4));
			}
			&:first-child {
				left: 25%;
			}
			&:last-child {
				@include transform(scaleX(-1));
				right: 25%;
			}
		}
	}
	
	$eye-size: ($tiger-size-basis * (90px / $tiger-size-basis));
	.eyes-block {
		margin: auto;
		width: 47%;
		height: ($eye-size * 1);
		background: $orange-2;
		top: ($tiger-size-basis * (60px / $tiger-size-basis));
		@include pseudo() {
			@include border-radius(100%);
			height: ($eye-size * 1);
			width: ($eye-size * 1);
			background: $orange-2;
		}
		&:before {
			left: -($eye-size * 0.5);
		}
		&:after {
			right: -($eye-size * 0.5);
		}
		.eye {
			@include border-radius(100%);
			@include animation(blink 3s ease 1s infinite);
			top: ($eye-size * 0.25);
			position: absolute;
			width: ($eye-size * 0.5);
			height: ($eye-size * 0.5);
			background: $black-1;
			z-index: 1;
			&:first-child {
				left: -($eye-size * 0.25);
			}
			&:last-child {
				right: -($eye-size * 0.25);
			}
		}
	}
	.nose {
		$nose-width: ($tiger-size-basis * (100px / $tiger-size-basis));
		position: absolute;
		top: ($tiger-size-basis * (60px / $tiger-size-basis));
		left: 35.5%;
		z-index: 1;
		@include pseudo();
		&:before {
			height: 0;
			width: ($nose-width * 0.4);
			border-bottom: $eye-size solid $orange-0;
			border-left: ($nose-width * 0.3) solid transparent;
			border-right: ($nose-width * 0.3) solid transparent;
		}
		&:after {
			top: $eye-size;
			width: 0;
			height: 0;
			border-left: ($nose-width * 0.5) solid transparent;
			border-right: ($nose-width * 0.5) solid transparent;
			border-top: ($eye-size * 0.5) solid $orange-2;
		}
	}
	.cheek-block {
		@include border-radius(35%);
		position: absolute;
		top: 0;
		overflow: hidden;
		width: 100%;
		height: 100%;
		z-index: 0;
		.cheek {
			&_1,
			&_2 {
				top: ($tiger-size-basis * (130px / $tiger-size-basis));
				@include pseudo() {
					width: 0;
					height: 0;
					border-bottom: ($tiger-size-basis * (50px / $tiger-size-basis)) solid $black-1;
				}
				&:after {
					top: ($tiger-size-basis * (50px / $tiger-size-basis));
					border-bottom-width: ($tiger-size-basis * (40px / $tiger-size-basis));
				}
			}
			&_1 {
				@include pseudo() {
					border-right: ($tiger-size-basis * (70px / $tiger-size-basis)) solid transparent;
				}
				&:after {
					border-right-width: ($tiger-size-basis * (50px / $tiger-size-basis));
				}
			}
			&_2 {
				@include pseudo() {
					right: 0;
					border-left: ($tiger-size-basis * (70px / $tiger-size-basis)) solid transparent;
				}
				&:after {
					border-left-width: ($tiger-size-basis * (50px / $tiger-size-basis));
				}
			}
		}
	}
	.mouth-block {
		width: 55%;
		height: 100%;
		top: ($tiger-size-basis * (60px / $tiger-size-basis));
		margin: auto;
		overflow: hidden;
		.skin {
			@include pseudo() {
				position: relative;
				@include border-radius(100%);
				@include transform(rotate(-45deg));
				border: ($tiger-size-basis * (90px / $tiger-size-basis)) solid;
				margin: auto;
				border-color: transparent transparent $white-1 $white-1;
				top: -($tiger-size-basis * (95px / $tiger-size-basis));
			}
			&:after {
				border-width: ($tiger-size-basis * (95px / $tiger-size-basis));
				top: -($tiger-size-basis * (210px / $tiger-size-basis));
			}
		}
		.mouth {
			position: absolute;
			width: 100%;
			top: 0;
			.hole {
				@include border-radius(100%);
				@include transform(rotate(-45deg));
				width: 0;
				height: 0;
				border: ($tiger-size-basis * (50px / $tiger-size-basis)) solid;
				margin: auto;
				border-color: transparent transparent $black-1 $black-1;
				top: ($tiger-size-basis * (10px / $tiger-size-basis));
			}
			.teeth {
				margin: auto;
				width: 30%;
				top: -($tiger-size-basis * (40px / $tiger-size-basis));
				@include pseudo() {
					width: 0;
					height: 0;
					border-left: ($tiger-size-basis * (12px / $tiger-size-basis)) solid transparent;
					border-right: ($tiger-size-basis * (12px / $tiger-size-basis)) solid transparent;
					border-top: ($tiger-size-basis * (20px / $tiger-size-basis)) solid $white-2;
				}
				&:before {
					left: 0;
				}
				&:after {
					right: 0;
				}
			}
		}
	}
}

@include keyframe(blink) {
	0% {
		@include transform(scaleY(1));
	}
	2.5% {
		@include transform(scaleY(0));
	}
	5% {
		@include transform(scaleY(1));
	}
	7.5% {
		@include transform(scaleY(0));
	}
	10% {
		@include transform(scaleY(1));
	}
}
@include keyframe(twink-L) {
	0% {
		@include transform(rotate(0deg));
		@include css3-prefix('transform-origin', 100% 100%);
	}
	5% {
		@include transform(rotate(-10deg));
	}
	10% {
		@include transform(rotate(0deg));
	}
	15% {
		@include transform(rotate(-10deg));
	}
	20% {
		@include transform(rotate(0deg));
	}
}
@include keyframe(twink-R) {
	0% {
		@include transform(rotate(0deg));
		@include css3-prefix('transform-origin', 0 100%);
	}
	5% {
		@include transform(rotate(10deg));
	}
	10% {
		@include transform(rotate(0deg));
	}
	15% {
		@include transform(rotate(10deg));
	}
	20% {
		@include transform(rotate(0deg));
	}
}
            
          
!
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