Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                		<title>Responsive CSS Timeline with 3D Effect</title>

		<link rel="stylesheet" type="text/css" href="https://tympanus.net/Tutorials/3DTimeline/css/style.css" />
		<script src="https://tympanus.net/Tutorials/3DTimeline/js/modernizr.custom.63321.js"></script>
		<!--[if lte IE 7]><style>.support-note .note-ie{display:block;}</style><![endif]-->


		<div class="container">	

			<!-- Codrops top bar -->
			<div class="codrops-top clearfix">
				<a href="https://tympanus.net/Tutorials/LoadingAnimations/">
					<strong>&laquo; Previous Demo: </strong>Css Loading Animations
				</a>
				<span class="right">
					<a href="http://www.patternify.com/">Patterns from Patternify</a>
					<a href="https://tympanus.net/codrops/?p=12185">
						<strong>Back to the Codrops Article</strong>
					</a>
				</span>
			</div><!--/ Codrops top bar -->
			
			<header class="clearfix">
			
				<h1>Responsive CSS Timeline with 3D Effect <span>(Best viewed in WebKit browsers)</span></h1>
				<h2>Star Wars vs. Spaceballs <span>The final battle</span></h2>
				<div class="support-note">
					<span class="note-ie">Sorry, only modern browsers.</span>
				</div>
				
			</header>
			
			<section class="main">

				<ul class="timeline">

					<li class="event">
						<input type="radio" name="tl-group" checked/>
						<label></label>
						<div class="thumb user-4"><span>19 Nov</span></div>
						<div class="content-perspective">
							<div class="content">
								<div class="content-inner">
									<h3>I find your lack of faith disturbing</h3>
									<p>Don't be too proud of this technological terror you've constructed. The ability to destroy a planet is insignificant next to the power of the Force. The plans you refer to will soon be back in our hands. A tremor in the Force. The last time I felt it was in the presence of my old master. Escape is not his plan. I must face him. Alone.</p>
								</div>
							</div>
						</div>
					</li>

					<li class="event">
						<input type="radio" name="tl-group"/>
						<label></label>
						<div class="thumb user-6"><span>18 Nov</span></div>
						<div class="content-perspective">
							<div class="content">
								<div class="content-inner">
									<h3>I ain't shooting this thing, I hate guns.</h3>
									<p>Ha, didn't even stay for the wedding. Just took his million spacebucks and ran. And you will not call me 'you'. You will never address me as 'you'. You will call me 'your royal highness'. I really must go back. I shouldn't have run away. I realize now that love is one luxury a princess cannot afford. </p>
								</div>
							</div>
						</div>
					</li>

					<li class="event">
						<input type="radio" name="tl-group"/>
						<label></label>
						<div class="thumb user-3"><span>17 Nov</span></div>
						<div class="content-perspective">
							<div class="content">
								<div class="content-inner">
									<h3>My brains are going into my feet! </h3>
									<p>We're done with you. Go back to the golf course and work on your putz. Nah, he got the upside, I got the downside. See there's two sides to every Schwartz.  What's the matter with this thing, what's all that churnning and bubbling, you call that radar screen? Ah, planet Druidia. And under that air shield, ten thousand years of fresh air. We must get through that air shield! Say goodbye to your two best friends, and I don't mean your pals in the Winnebago. So, Lone Star, now you see that evil will always triumph because good is dumb. </p>
								</div>
							</div>
						</div>
					</li>

					<li class="event">
						<input type="radio" name="tl-group"/>
						<label></label>
						<div class="thumb user-5"><span>16 Nov</span></div>
						<div class="content-perspective">
							<div class="content">
								<div class="content-inner">
									<h3>Would you please stop calling me that?</h3>
									<p>You make it so difficult sometimes. You have your moments. Not many of them, but you do have them. You're not actually going IN to an asteroid field? I happen to like nice men. This bucket of bolts's never gonna get us past that blockade. We're going to get pulverized if we stay out here much longer. Evacuate remaining ground staff.</p>
								</div>
							</div>
						</div>
					</li>

					<li class="event">
						<input type="radio" name="tl-group"/>
						<label></label>
						<div class="thumb user-2"><span>15 Nov</span></div>
						<div class="content-perspective">
							<div class="content">
								<div class="content-inner">
									<h3>Funny, she doesn't look Druish</h3>
									<p>It's not that we're afraid, far from it, it's just that we've got this thing about death... It's not us! I'm a mog: half man, half dog. I'm my own best friend! The minute we move in they're gonna spot us on their radar. Whoa, hold it, time. Chief... I can't... I can't go any further. I can't go any further. </p>
								</div>
							</div>
						</div>
					</li>

					<li class="event">
						<input type="radio" name="tl-group"/>
						<label></label>
						<div class="thumb user-7"><span>14 Nov</span></div>
						<div class="content-perspective">
							<div class="content">
								<div class="content-inner">
									<h3>Ouch! Pay attention to what you're doing! </h3>
									<p>Artoo says that the chances of survival are 725 to 1. Actually Artoo has been known to make mistakes... from time to time... Oh dear...The odds of successfully surviving an attack on an Imperial Star Destroyer are approximately... Sir, it's quite possible this asteroid is not entirely stable. Oh. They've encased him in Carbonite. He should be quite well protected. If he survived the freezing process, that is. If I may say so, sir, I noticed earlier the hyperdrive motivator has been damaged. It's impossible to go to lightspeed. Stupid little short-circuit! He'll be *quite* all right. </p>
								</div>
							</div>
						</div>
					</li>

					<li class="event">
						<input type="radio" name="tl-group"/>
						<label></label>
						<div class="thumb user-1"><span>13 Nov</span></div>
						<div class="content-perspective">
							<div class="content">
								<div class="content-inner">
									<h3>Rhhhnn gggnn. Garrrrr!</h3>
									<p>Rrrrrrr rrrraaaahhh rrrrrrggghhhhnn! Arrrggghhnnn. Grrrhn. Gahr. Rrrrrrr rrrraaaahhh rrrrrrggghhhhnn! Grrf. Arrrggghhnnn. Grrrhn. Gahr. Grrrhn. Gahr. Rrrrrrr rrrraaaahhh rrrrrrggghhhhnn! Gahr. Gahr. Arrrggghhnnn. Grrrhn.</p>
								</div>
							</div>
						</div>
					</li>

					<li class="event">
						<input type="radio" name="tl-group"/>
						<label></label>
						<div class="thumb user-8"><span>12 Nov</span></div>
						<div class="content-perspective">
							<div class="content">
								<div class="content-inner">
									<h3>I hope it's for adult dating</h3>
									<p>Can we talk? OK, we all know Prince Valium is a pill. But you could have married him for your father's sake and had a headache for the next 25 years. Well, goodbye virgin alarm. Besides he got a sexy voice. He might be cute. Hey wait, you forgot to get married! And if we go over our pagecount, the network will kill us. You know, you've got a very unique voice. You should be in silent films.</p>
								</div>
							</div>
						</div>
					</li>
					
				</ul>
			</section>

		</div><!-- /container -->
		<script src="https://tympanus.net/codrops/adpacks/demoad.js"></script>
              
            
!

CSS

              
                /* General Demo Style */
@charset "UTF-8";
@import url(https://fonts.googleapis.com/css?family=Lato:300,400,700|Gorditas:400,700);

*,
*:after,
*:before {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
	padding: 0;
	margin: 0;
}

/* Clearfix hack by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */
.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}

.clearfix:after {
    clear: both;
}

.clearfix {
    *zoom: 1;
}

body {
    font-family: 'Lato', Calibri, Arial, sans-serif;
    background: #c2edf4;
    font-weight: 300;
    font-size: 14px; 
    color: #333;
    overflow-y: scroll;
    overflow-x: hidden;
}

a {
	color: #555;
	text-decoration: none;
}

.container {
	width: 100%;
	position: relative;
}

.container > header,
.main {
	width: 100%;
	max-width: 1060px;
	margin: 0 auto;
	padding: 0 30px;
}

.container > header {
	padding: 30px 30px 0px 30px;
	font-family: 'Gorditas', Arial, sans-serif;
}

.container > header h1 {
	margin: 0;
	font-weight: 400;
	color: #41838e;
	font-size: 16px; 
	text-shadow: 0 1px 1px rgba(255,255,255,0.4);
}

.container > header h1 span {
	color: #F26328;
}

.container > header h2 {
	padding: 10px 0;
	margin: 0;
	font-size: 62px;
	line-height: 58px;
	color: #fff;
	font-weight: 400;
	position: relative;
	background: transparent url(data:https://tympanus.net/Tutorials/3DTimeline/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAI0lEQVQIW2P8DwSMQMCABBhBgiA+sgRYBboEXBuyBIpZMAkAW1YUAh9deX8AAAAASUVORK5CYII=) repeat-x bottom left;
	text-shadow: 4px 4px 0px #41838e;
}

.container > header h2 span {
	display: block;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 10px;
	font-size: 18px;
	color: #F26328;
	text-shadow: none;
}

/* Header Style */
.codrops-top {
	font-size: 11px; 
	line-height: 24px; 
	background: #fff;
	background: rgba(255, 255, 255, 0.8);
	text-transform: uppercase;
	z-index: 9999;
	position: relative;
	box-shadow: 1px 0px 2px rgba(0,0,0,0.2);
}

.codrops-top a {
	padding: 0px 10px;
	letter-spacing: 1px;
	color: #333;
	text-shadow: 0 -1px 0 #fff;
	display: inline-block;
}

.codrops-top a:hover {
	background: rgba(255,255,255,0.8);
	color: #000;
}

.codrops-top span.right {
	float: right;
}

.codrops-top span.right a {
	float: left;
	display: block;
}

.support-note {
	clear: both;
}

.support-note span{
	color: #ac375d;
	font-size: 16px;
	display: none;
	font-weight: bold;
	text-align: center;
	padding: 5px 0;
}


@import url('https://tympanus.net/Tutorials/3DTimeline/css/demo.css');

@font-face {
	font-family: 'fontawesome-selected';
	src: url("font/fontawesome-selected.eot");
	src: 
	url("https://tympanus.net/Tutorials/CircleHoverEffects/font/fontawesome-selected.eot?#iefix") format('embedded-opentype'), 
	url("https://tympanus.net/Tutorials/3DTimeline/font/fontawesome-selected.woff") format('woff'), 
	url("https://tympanus.net/Tutorials/3DTimeline/font/fontawesome-selected.ttf") format('truetype'), 
	url("https://tympanus.net/Tutorials/3DTimeline/font/fontawesome-selected.svg#fontawesome-selected") format('svg');
	font-weight: normal;
	font-style: normal;
}

.timeline {
	position: relative;
	list-style-type: none;
	padding: 30px 0 50px 0;
	font-family: 'Gorditas', Arial, sans-serif;
}

.timeline:before {
	content: '';
	position: absolute;
	width: 5px;
	height: 100%;
	top: 0;
	left: 165px;
	background: url(data:https://tympanus.net/Tutorials/3DTimeline/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAJUlEQVQIW2NkQAP/gYARWQwkAOLDBeECjEAAkkEWAKtEFwAJAgAZEBP+oM1IkwAAAABJRU5ErkJggg==);
}

.event {
	position: relative;
	margin-bottom: 80px;
	padding-right: 40px;
}

.thumb {
	position: absolute;
	width: 100px;
	height: 100px;
	box-shadow: 
		0 0 0 8px rgba(65,131,142,1), 
		0 1px 1px rgba(255,255,255,0.5);
	background-repeat: no-repeat;
	border-radius: 50%;
	-webkit-transform: scale(0.8) translateX(24px);
	-moz-transform: scale(0.8) translateX(24px);
	-o-transform: scale(0.8) translateX(24px);
	-ms-transform: scale(0.8) translateX(24px);
	transform: scale(0.8) translateX(24px);
}

.thumb:before {
	content: '';
	position: absolute;
	height: 8px;
	z-index: -1;
	background: transparent url(data:https://tympanus.net/Tutorials/3DTimeline/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPElEQVQYV2NkQAP/gYARCNDFUQRgirAphitEl0TngxXisg5ZnBGXIpgbYfIYjkb3BNxGbBLYxIgyEaQRAA8KKAWYsZtjAAAAAElFTkSuQmCC);
	width: 51px;
	top: 42px;
	left: 100%;
	margin-left: 8px;
}

.thumb span {
	color: #41838e; 
	width: 100%;
	text-align: center;
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	position: absolute;
	bottom: -30px;
}

.user-1 {
	background-image: url(https://tympanus.net/Tutorials/3DTimeline/images/chewbacca.jpg);
}

.user-2 {
	background-image: url(https://tympanus.net/Tutorials/3DTimeline/images/barf.jpg);
}

.user-3 {
	background-image: url(https://tympanus.net/Tutorials/3DTimeline/images/darkhelmet.jpg);
}

.user-4 {
	background-image: url(https://tympanus.net/Tutorials/3DTimeline/images/darthvader.jpg);
}

.user-5 {
	background-image: url(https://tympanus.net/Tutorials/3DTimeline/images/leia.jpg);
}

.user-6 {
	background-image: url(https://tympanus.net/Tutorials/3DTimeline/images/vespa.jpg);
}

.user-7 {
	background-image: url(https://tympanus.net/Tutorials/3DTimeline/images/c3po.jpg);
}

.user-8 {
	background-image: url(https://tympanus.net/Tutorials/3DTimeline/images/dotmatrix.jpg);
}

/* Transparent Checkbox/radio hack: leave the checkbox on top, hide it with opacity 0 */

.event label,
.event input[type="radio"] {
	width: 24px;
	height: 24px;
	left: 158px;
	top: 36px;
	position: absolute;
	display: block;
}

.event input[type="radio"] {
	opacity: 0;
	z-index: 10;
	cursor: pointer;
}

.event label:after {
	font-family: 'fontawesome-selected';
	content: '\e702';
	background: #fff;
	border-radius: 50%;
	color: #41838E;
	font-size: 26px;
	height: 100%;
	width: 100%;
	left: -2px;
	top: -3px;
	line-height: 24px;
	position: absolute;
	text-align: center;
}

.content-perspective {
	margin-left: 230px;
	position: relative;

	-webkit-perspective: 600px;
	-moz-perspective: 600px;
	-o-perspective: 600px;
	-ms-perspective: 600px;
	perspective: 600px;
}

.content-perspective:before {
	content: '';
	width: 37px;
	left: -51px;
	top: 45px;
	position: absolute;
	height: 1px;
	z-index: -1;
	background: #fff;
}

.content {
	-webkit-transform: rotateY(10deg);
	-moz-transform: rotateY(10deg);
	-o-transform: rotateY(10deg);
	-ms-transform: rotateY(10deg);
	transform: rotateY(10deg);

	-webkit-transform-origin: 0 0;
	-moz-transform-origin: 0 0;
	-o-transform-origin: 0 0;
	-ms-transform-origin: 0 0;
	transform-origin: 0 0;

	-webkit-transform-style: preserve-3d;
	-moz-transform-style: preserve-3d;
	-ms-transform-style: preserve-3d;
	-o-transform-style: preserve-3d;
	transform-style: preserve-3d;
}

.content-inner {
	position: relative;
	padding: 20px;
	color: #333;
	border: none;
	border-left: 5px solid #41838e;
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	background: #fff;
}

.content-inner h3 {
	font-size: 26px;
	padding: 5px 0 5px 0;
	color: #41838e;
}

.content-inner p {
	font-size: 18px;
	max-height: 0px;
	overflow: hidden;
	color: transparent;
	color: rgba(0,0,0,0);
	text-align: left;
}

.content-inner:before {
	font-family: 'fontawesome-selected';
	content: '\25c2';
	font-weight: normal;
	font-size: 54px;
	line-height: 54px;
	position: absolute;
	width: 30px;
	height: 30px;
	color: #41838e;
	left: -22px;
	top: 19px;
	z-index: -1;
}

/* Transitions */

.thumb,
.thumb span,
.content-inner h3 {
	-webkit-transition: all 0.6s ease-in-out 0.2s;
	-moz-transition: all 0.6s ease-in-out 0.2s;
	-o-transition: all 0.6s ease-in-out 0.2s;
	-ms-transition: all 0.6s ease-in-out 0.2s;
	transition: all 0.6s ease-in-out 0.2s;
}

.content-inner {
	-webkit-transition: box-shadow 0.8s linear 0.2s;
	-moz-transition: box-shadow 0.8s linear 0.2s;
	-o-transition: box-shadow 0.8s linear  0.2s;
	-ms-transition: box-shadow 0.8s linear 0.2s;
	transition: box-shadow 0.8s linear 0.2s;
}

.content {
	-webkit-transition: -webkit-transform 0.8s cubic-bezier(.59,1.45,.69,.98) 0.2s;
	-moz-transition: -moz-transform 0.8s cubic-bezier(.59,1.45,.69,.98) 0.2s;
	-o-transition: -o-transform 0.8s cubic-bezier(.59,1.45,.69,.98) 0.2s;
	-ms-transition: -ms-transform 0.8s cubic-bezier(.59,1.45,.69,.98) 0.2s;
	transition: transform 0.8s cubic-bezier(.59,1.45,.69,.98) 0.2s;
}

.content-inner p {
	-webkit-transition: max-height 0.5s linear, color 0.3s linear;
	-moz-transition: max-height 0.5s linear, color 0.3s linear;
	-o-transition: max-height 0.5s linear, color 0.3s linear;
	-ms-transition: max-height 0.5s linear, color 0.3s linear;
	transition: max-height 0.5s linear, color 0.3s linear;
}

/* Checked */

.event input[type="radio"]:checked + label:after {
	content: '\2714';
	color: #F26328;
	box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.8);
}

.event input[type="radio"]:checked ~ .content-perspective:before {
	background: #F26328;
}

.event input[type="radio"]:checked ~ .content-perspective .content-inner h3 {
	color: #F26328;
}

.event input[type="radio"]:checked ~ .content-perspective .content {
	-webkit-transform: rotateY(-5deg);
	-moz-transform: rotateY(-5deg);
	-o-transform: rotateY(-5deg);
	-ms-transform: rotateY(-5deg);
	transform: rotateY(-5deg);
}

.event input[type="radio"]:checked ~ .content-perspective .content-inner {
	border-color: #F26328;
	box-shadow: 10px 0px 10px -6px rgba(0, 0, 0, 0.1);
}

.event input[type="radio"]:checked ~ .content-perspective .content-inner p {
	max-height: 260px; /* Add media queries */
	color: rgba(0,0,0,0.6);
	-webkit-transition-delay: 0s, 0.6s;
	-moz-transition-delay: 0s, 0.6s;
	-o-transition-delay: 0s, 0.6s;
	-ms-transition-delay: 0s, 0.6s;
	transition-delay: 0s, 0.6s;
}

.event input[type="radio"]:checked ~ .content-perspective .content-inner:before {
	color: #F26328;
}

.event input[type="radio"]:checked ~ .thumb {
	-webkit-transform: scale(1);
	-moz-transform: scale(1);
	-o-transform: scale(1);
	-ms-transform: scale(1);
	transform: scale(1);
	box-shadow: 
		0 0 0 8px rgba(242,99,40,1), 
		0 1px 1px rgba(255,255,255,0.5);
}

.event input[type="radio"]:checked ~ .thumb span {
	color: #F26328;
}

.event input[type="radio"]:checked ~ .thumb:before {
	background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPUlEQVQYV2NkQAOfUjX+882+wYgujiIAU4RNMVwhuiQ6H6wQl3XI4oy4FMHcCJPHcDS6J2A2EqUQpJhohQBbNyaHFmzEqgAAAABJRU5ErkJggg==);
}

.content-inner p,
.thumb span,
.event label {
	-webkit-backface-visibility: hidden;
}

@media screen and (max-width: 850px) { 
	.content-inner h3 {
		font-size: 20px;
	}

	.content-inner p {
		font-size: 14px;
		text-align: justify;
	}

	.event input[type="radio"]:checked ~ .content-perspective .content-inner p {
		max-height: 500px; 
	}
}

@media screen and (max-width: 540px) {
	.timeline::before {
		left: 50px;
	}

	.event { 
		padding-right: 0px;
		margin-bottom: 100px;
	}


	.thumb {
		-webkit-transform: scale(0.8);
		-moz-transform: scale(0.8);
		-o-transform: scale(0.8);
		-ms-transform: scale(0.8);
		transform: scale(0.8);
	}

	.event input[type="radio"] {
		width: 100px;
		height: 100px;
		left: 0px;
		top: 0px;
	}

	.thumb:before,
	.event input[type="radio"]:checked ~ .thumb:before {
		background: none;
		width: 0;
	}

	.event label {
		display: none;
	}

	.content-perspective {
		margin-left: 0px; 
		top: 80px;
	}

	.content-perspective:before {
		height: 0px; 
	}

	.content {
		-webkit-transform: rotateX(-10deg);
		-moz-transform: rotateX(-10deg);
		-o-transform: rotateX(-10deg);
		-ms-transform: rotateX(-10deg);
		transform: rotateX(-10deg);
	}

	.event input[type="radio"]:checked ~ .content-perspective .content {
		-webkit-transform: rotateX(10deg);
		-moz-transform: rotateX(10deg);
		-o-transform: rotateX(10deg);
		-ms-transform: rotateX(10deg);
		transform: rotateX(10deg);
	}

	.content-inner {
		border-left: none;
		border-top: 5px solid #41838e;
	}

	.event input[type="radio"]:checked ~ .content-perspective .content-inner {
		border-color: #F26328;
		box-shadow: 0 10px 10px -6px rgba(0, 0, 0, 0.1);
	}

	.content-inner:before {
		content: '\25b4';
		left: 33px;
		top: -32px;
	}

	.event input[type="radio"]:checked ~ .content-perspective .content-inner p {
		max-height: 300px; 
	}
}





              
            
!

JS

              
                /* 

 Responsive CSS Timeline with 3D Effect
A tutorial about how to create an experimental CSS-only timeline with a 3D effect. The idea is to expand a content area when the associated radio input is selected.
<p>SOURCE: <a href="https://tympanus.net/Tutorials/3DTimeline/" target="_blank"><i><b>Timeline with 3D Effect</b></i></a></p>

https://tympanus.net/codrops/2012/11/19/responsive-css-timeline-with-3d-effect/

by https://tympanus.net

 */
              
            
!
999px

Console