cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

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.

            
              <div class="wrapper">
	<div class="cta">
		<p>Hover Me :P</p>
	</div>
	<div class="pin">
		<div class="pin-inner"></div>
	</div>
	<div class="square">
		<div class="icon">
			<div class="grass"></div>
			<div class="road"></div>
			<div class="water"></div>
		</div>
		<div class="road-alt"></div>
	</div>
</div>

<section>
	<h1>Google Maps Icon In CSS</h1>
	<p>
		<a href="https://www.uplabs.com/posts/google-maps-animated" target="_blank">
			Inspired by Kirsh Gounder's animation
		</a>
	</p>
	<p>
		<a href="http://timblin.co/record/animate-map/" target="_blank">
			Related Article Of Mine
		</a>
	</p>
</section>
            
          
!
            
              $grey: #fefefe;
$green: #30B551;
$yellow: #FFDF42;
$blue: #4992F6;
$white: #fff;
$red: #D74D3C;

body {
	background: $white;
	perspective: 1000px;
}

.wrapper {
	background: #FFAB40;
	padding:0 0 50px 0;
}

.cta {
	position:absolute;
	width:100%;
	top:50%;
	text-align:center;
	font-family:monospace;
	color:$white;
	opacity:.7;
}

.square {
	position:relative;
	margin:0px auto;
	width:200px; height:200px;
	overflow: hidden;
	
	background: $grey;
	box-shadow: 0 4px 15px 0px rgba(0, 0, 0, 0.3);
	border-radius:20px;
	border-bottom:5px solid darken($white, 20%);
	transform:rotateX(40deg) scale(0);
	transition: transform 300ms ease-in-out 900ms;
}

.wrapper:hover .square {
	transform:rotateX(40deg) scale(1);
	transition-delay: 0s;
}

.icon {
	position:relative;
	width:400px; height:400px;
	right:50%; bottom:50%; //Center the map on the icon
	background:#fff;
	transform: rotate(40deg);
	transform-origin: 50% 50%;
	
	display:flex;
	.grass {
		width:50%; height:100%;
		background: $green;
		transform: translateX(-140px);
		transition: transform 300ms ease-in-out 300ms;
	}
	.road {
		width:10%; height:100%;
		background: $yellow;
		transform: translateX(-180px);
		transition: transform 300ms ease-in-out 500ms;
	}
	.water {
		width:40%; height:100%;
		background: $blue;
		transform: translateX(100px);
		transition: transform 300ms ease-in-out 100ms;
	}
}

.wrapper:hover .grass {
	transform: translateX(0px);
}
.wrapper:hover .road {
	transform: translateX(0px);
}
.wrapper:hover .water {
	transform: translateX(0px);
	transition-delay: 900ms;
}

.road-alt {
	position:relative;
	width:105px; height:110px;
	bottom:180%;
	transform: perspective(300px) rotateX(-65deg) translateX(-110px); // Adds a slant onto the end of the road
	transform-origin: 0% 50%;
	background: $white;
	transition: transform 300ms ease-in-out 0ms;
}

.wrapper:hover .road-alt {
	transform: perspective(300px) rotateX(-67deg) translateX(0px);
	transition-delay: 900ms;
}


// ###
// PIN
// ###
$pin-size: 80px;

.pin {
	position:relative;
	margin:0 auto;
	width:$pin-size; height:$pin-size;
	background: $red;
	border-radius:50% 50% 50% 5px;
	&-inner {
		position:absolute;
		width:$pin-size / 2; height:$pin-size / 2;
		top:$pin-size / 4; right:$pin-size / 4;
		border-radius:50%;
		background: darken($red, 20%);
	}
	transform: translateY($pin-size + $pin-size / 2) rotate(-45deg) scale(0);
	z-index:100;
	transition: transform 300ms ease-in-out 50ms;
}

.wrapper:hover .pin {
	transform: translateY($pin-size - 10px) rotate(-45deg) scale(1);
	transition-delay: 1s;
	transition-timing-function: cubic-bezier(0.49, 0.17, 0.08, 1.61)
}

section {
	position:absolute;
	padding:50px 0;
	width:100%;
	text-align: center;
	font-family:'roboto', sans-serif;
	h1 {
		font-weight:700;
		font-size:3em;
		line-height:1.5em;
		color: darken($white, 20%);
	}
	a {
		line-height:3em;
		color:#F57C00;
		text-decoration:none;
		padding:5px 15px;
		border-radius:3px;
		background:darken($white, 5%);
	}
}
            
          
!
999px
Loading ..................

Console