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 id="container" class="holder red">
	<div id="view-one" class="view active">
		<h1>Title</h1>
		<img src="http://hfchristiansen.com/wp-content/uploads/2014/05/Johnny-Loco-2-400x200.jpg" alt="" />
		<p>Chirp at birds. Pooping rainbow while flying in a toasted bread costume in space claws in your leg but sleep on dog bed, force dog to sleep on floor or chew iPad power cord, and roll on the floor purring your whiskers off run in circles. Hate dog get video posted to internet for chasing red dot but spread kitty litter all over house. Where is my slave? I'm getting hungry hide head under blanket so no one can see. Under the bed meow for food, then when human fills food dish, take a few bites of food and continue meowing so pooping rainbow while flying in a toasted bread costume in space or pee in human's bed until he cleans the litter box missing until dinner time. Has closed eyes but still sees you toy mouse squeak roll over drink water out of the faucet.</p>
	</div>
	<div id="view-two" class="view">
		<img src="http://orig08.deviantart.net/0fb2/f/2011/004/5/2/joker_signature_by_applay-d36ehw1.jpg" alt="" />
		<h1>the joker</h1>
		<hr />
		<p>Rub face on everything climb leg, yet i am the best paw at your fat belly. Sleep on keyboard run outside as soon as door open, but lay on arms while you're using the keyboard toy mouse squeak roll over for eat a plant, kill a hand sleep on keyboard. Spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce. Kitty power! poop in the plant pot for stare at wall turn and meow stare at wall some more meow again continue staring . See owner, run in terror attack the dog then pretend like nothing happened. </p>
	</div>
	<div id="view-three" class="view">
		<h1>deadpool</h1>
		<h2>Merc with the mouth</h2>
		<p>Meet all of Spideys deadly enemies, from the Green Goblin and Doctor Octopus to Venom and Carnage, plus see Peter Parker fall in love, face tragedy and triumph, and learn that with great power comes great responsibility. Realizing that rules were needed to prevent people from behaving badly, young Matt decided to study law however, when he saved a man from an oncoming truck, it spilled a radioactive cargo that rendered Matt blind while enhancing his remaining senses.  Join Spider-Man and some of his Amazing friends as they tackle threats that only a mighty Marvel team-up can handle. Plus: Jessica travels to upstate New York to investigate the disappearance of a teenage girl rumored to be a mutant in a prejudiced small town, goes on a date with the Astonishing Ant-Man, teams up with Jessica Drew, the original Spider-Woman and confronts the demons of her past.</p>
		<img src="https://2.bp.blogspot.com/-s-SfyfQsVe0/VsQIFfDKwLI/AAAAAAAAL90/dzEUhgltyE4/s400/Wolverine-vs-Deadpool-Video-Game-Concept-Art.jpg" alt="" />
	</div>
	<div class="btnHolder">
		<div id="one" class="nav"></div>
		<div id="two" class="nav"></div>
		<div id="three" class="nav"></div>
	</div>
</div>
              
            
!

CSS

              
                body, html{
	margin:0;
	padding:0;
}

.holder{
	position:relative;
	width:100%;
	height:100vh;
}

.red{
	background: rgba(222,126,109,1);
background: -moz-radial-gradient(center, ellipse cover, rgba(222,126,109,1) 0%, rgba(237,54,33,1) 86%, rgba(184,21,6,1) 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(222,126,109,1)), color-stop(86%, rgba(237,54,33,1)), color-stop(100%, rgba(184,21,6,1)));
background: -webkit-radial-gradient(center, ellipse cover, rgba(222,126,109,1) 0%, rgba(237,54,33,1) 86%, rgba(184,21,6,1) 100%);
background: -o-radial-gradient(center, ellipse cover, rgba(222,126,109,1) 0%, rgba(237,54,33,1) 86%, rgba(184,21,6,1) 100%);
background: -ms-radial-gradient(center, ellipse cover, rgba(222,126,109,1) 0%, rgba(237,54,33,1) 86%, rgba(184,21,6,1) 100%);
background: radial-gradient(ellipse at center, rgba(222,126,109,1) 0%, rgba(237,54,33,1) 86%, rgba(184,21,6,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#de7e6d', endColorstr='#b81506', GradientType=1 );
}

.blue{
	background: rgba(139,156,227,1);
background: -moz-radial-gradient(center, ellipse cover, rgba(139,156,227,1) 0%, rgba(44,98,191,1) 85%, rgba(12,66,148,1) 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(139,156,227,1)), color-stop(85%, rgba(44,98,191,1)), color-stop(100%, rgba(12,66,148,1)));
background: -webkit-radial-gradient(center, ellipse cover, rgba(139,156,227,1) 0%, rgba(44,98,191,1) 85%, rgba(12,66,148,1) 100%);
background: -o-radial-gradient(center, ellipse cover, rgba(139,156,227,1) 0%, rgba(44,98,191,1) 85%, rgba(12,66,148,1) 100%);
background: -ms-radial-gradient(center, ellipse cover, rgba(139,156,227,1) 0%, rgba(44,98,191,1) 85%, rgba(12,66,148,1) 100%);
background: radial-gradient(ellipse at center, rgba(139,156,227,1) 0%, rgba(44,98,191,1) 85%, rgba(12,66,148,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8b9ce3', endColorstr='#0c4294', GradientType=1 );
}

.green{
	background: rgba(141,227,171,1);
background: -moz-radial-gradient(center, ellipse cover, rgba(141,227,171,1) 0%, rgba(45,189,91,1) 85%, rgba(13,148,29,1) 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(141,227,171,1)), color-stop(85%, rgba(45,189,91,1)), color-stop(100%, rgba(13,148,29,1)));
background: -webkit-radial-gradient(center, ellipse cover, rgba(141,227,171,1) 0%, rgba(45,189,91,1) 85%, rgba(13,148,29,1) 100%);
background: -o-radial-gradient(center, ellipse cover, rgba(141,227,171,1) 0%, rgba(45,189,91,1) 85%, rgba(13,148,29,1) 100%);
background: -ms-radial-gradient(center, ellipse cover, rgba(141,227,171,1) 0%, rgba(45,189,91,1) 85%, rgba(13,148,29,1) 100%);
background: radial-gradient(ellipse at center, rgba(141,227,171,1) 0%, rgba(45,189,91,1) 85%, rgba(13,148,29,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8de3ab', endColorstr='#0d941d', GradientType=1 );
}
.nav{
	position:relative;
	z-index:10;
	top:90%;
	width:40px;
	height:40px;
	background-color:black;
	border-radius:50%;
	display:inline-block;
	margin-right:10px;
	cursor: pointer;
}

.view{
	position:absolute;
	width:40%;
	right: 80px;
}

              
            
!

JS

              
                var views={
	'one':{
		id:'one',
		bg:'red'
	},
	'two':{
		id:'two',
		bg:'blue'
	},
	'three':{
		id:'three',
		bg:'green'
	}
};
var $holder = $('.holder'),
		$container = $('#container'),
		$viewOne = $('#view-one'),
		$viewTwo = $('#view-two'),
		$viewThree = $('#view-three'),
		$one = $("#one"),
		$two = $('#two'),
		$three = $('#three'),
		$view = $('.view'),
		$active = $('.active'),
		fx = TweenMax,
		tl = new TimelineMax();
		time=500;
function change(style){
	$container.attr('class', 'holder ' + views[style].bg);
	
}

function goToTile(sildeIn, slideOut){
	tl
		tl
			.set(slideIn, {x:'200%', autoAlpha:1, className:'+=active'})
			.set(slideOut, {className: '-=active'})
			.to(slideOut, 0.5, {x:'200%', ease:Power3.easeInOut}, 0)
			.to(slideIn, 0.75, {x:'-=200%', ease:Power3.easeInOut}, 0);
}

$('.btnHolder .nav').click(function(){
	change($(this).attr('id'))
	var slideOut = $('.view.active'),
			index = $(this).index();
			slideIn = slideOut.parent().children('.view').eq(index);
	goToTile(slideIn, slideOut);
});


function init(){
		fx.set($view.not($active),{autoAlpha:0});
}

init();



              
            
!
999px

Console