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. 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.

+ 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 class="section">


	<div class="demo-contain _header">
		<div class="alert-container _enter" id="js-alert">
			Message has been sent!
			<i class="fa fa-times icon"></i>
		</div>
	</div>

	<div class="demo-contain">
		<div class="layerContainer layerContainer--stationary"></div>
		<div class="layerContainer layerContainer--top _layerUp" id="js-layer"></div>
	</div>

</div>
              
            
!

CSS

              
                $motion-ease--in: cubic-bezier(.4, 0, .7, .2);
$motion-ease--out: cubic-bezier(0, 0, .2, 1);


$fade-duration--fast: all .15s;
$fade-duration--slow: all .6s;

$combo--fast-short: transform .15s, background .15s;
$combo--fast-medium: transform .3s, background .15s;
$combo--slow-long: transform .6s, background .6s;

@font-face {
  font-family: system;
  font-style: normal;
  font-weight: 300;
  src: local(".SFNSText-Light"), local(".HelveticaNeueDeskInterface-Light"), local(".LucidaGrandeUI"), local("Ubuntu Light"), local("Segoe UI Light"), local("Roboto-Light"), local("DroidSans"), local("Tahoma");
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
	box-sizing: border-box;
}
body {
	font-family: "Proxima Nova";
	margin: 0;
}

p {
	font-weight: 400;
	line-height: 27px;
	font-size: 18px;
	width: 100%;
	max-width: 550px;
}

.lead {
	margin: 0px 0px 32px 0px;
}

.section {
	font-weight: 800;
	padding: 0;
}

h1 {
	font-size: 43px;
	margin-bottom: 24px;
}

.demo-contain {
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 0px 0px 32px 0px;
	overflow: hidden;
	height: 500px;
	
	&._header {
		background: #f3f4f4;
		height: 250px;
	}
	
	+ .demo-contain {
		margin-top: 100px;
	}
	
}

.alert-container {
	border-radius: 8px;
	border: 1px solid  #dee1e1;
	background: #fff;
	box-shadow: 0px 2px 4px 0px rgba(39,51,51,.24);
	padding: 16px;
	font-weight: 400;
	font-family: system;
	display: flex;
	justify-content: space-between;
	transform: translateY(-40px);
	opacity: 0;
	
	&._enter {
		animation: alertEnter .15s 1 $motion-ease--out forwards;
	}
	&._exit {
		animation: alertExit .15s 1 $motion-ease--in forwards;
	}
}

@keyframes alertEnter {
	from { opacity: 0; }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes alertExit {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(-40px);}
}

.fa-times {
	color: #929a9b;
	margin-left: 24px;
	cursor: pointer;
}

.layerContainer {
	border-radius: 8px;
	width: 95%;
	border-top: 8px solid;
	height: 500px;
	background: #fff;
	box-shadow: 0px 8px 16px 0px rgba(39,51,51,.24);
	position: absolute;
}

.layerContainer--top {
	border-top-color: #1da1f2;
	transform: translateY(320px);
	opacity: 1;
	z-index: 2;
	
	&._layerUp {
		animation: layerUp 600ms 1 forwards $motion-ease--out;
	}
	&._layerDown {
		animation: layerDown 600ms 1 forwards $motion-ease--in;
	}
}

.layerContainer--stationary {
	background: #fff;
	border-top-color: #929a9b;
	z-index: 1;
}

@keyframes layerUp {
	from { opacity: 0; transform: translateY(320px);}
	to { opacity: 1; transform: translateY(0); }

}

@keyframes layerDown {
	from { opacity: 1;transform: translateY(0); }
	to { opacity: 0; transform: translateY(320px); }

}

              
            
!

JS

              
                var alertWindow = document.getElementById('js-alert');
var layer = document.getElementById('js-layer');
var icon = document.getElementsByClassName('icon')[0];

// Start Animations
window.setInterval(() => {
	if (alertWindow.classList.contains('_enter')) {
		alertWindow.classList.remove('_enter');
		alertWindow.classList.add('_exit');
	} else {
		alertWindow.classList.add('_enter');
		alertWindow.classList.remove('_exit');
	}
	
	// End Animations
	if (layer.classList.contains('_layerUp')) {
		layer.classList.remove('_layerUp');
		layer.classList.add('_layerDown');	
	} else {
		layer.classList.add('_layerUp');
		layer.classList.remove('_layerDown');			
	}
}, 1500);

//Hide Alert on Click
function hideAlert() {
	alertWindow.classList.remove('_enter');	
	alertWindow.classList.add('_exit');	
}

// Add click event
icon.addEventListener('click', hideAlert);
              
            
!
999px

Console