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

              
                <section class="body">
 <div class="buttons-section">
  <button id="success" class="trigger" onclick="notify('You\'re a real winner!','success')">
		<i class="fa fa-check-circle"></i>
	</button>
  <button id="info" class="trigger" onclick="notify('Lets give you some info!','info')">
		<i class="fa fa-question-circle"></i>		
	</button>
  <button id="warning" class="trigger" onclick="notify('Uh oh, What did you do?','warning')">
		<i class="fa fa-exclamation-triangle"></i>
	</button>
  <button id="error" class="trigger" onclick="notify('Catostrophic meltdown is eminent... You should probably get out of here.','error')">	
		<i class="fa fa-exclamation-circle"></i>
	</button>
 </div>
</section>
              
            
!

CSS

              
                .body {
	position: absolute;
	background: url(https://images.unsplash.com/photo-1502500505273-8e5240bbe2ad?dpr=1.25&auto=format&fit=crop&w=1199&h=799&q=80&cs=tinysrgb&crop=);
	background-size: cover;
	font-family: 'Open Sans', sans-serif;
	width: 100%;
	height: 100%;
}
.buttons-section {
	position: relative;
	top: 65vh;
	width: 58vw;
	margin: 3em auto;
	.trigger {
		background: #FCFAFD;
		height: 10vw;
		width: 10vw;
		border: 0.5px outset #ddd;
		border-radius: 100px;
		box-shadow: 0 1px 5px rgba(0,0,0,0.45);
		margin-right: 1.75em;
		transition: all 450ms eas-in-out;
		cursor: pointer;
		&:last-child {
			margin-right: 0;
		}
		&:hover {
			background: #FAF8FB
			box-shadow: 0 2px 15px rgba(0,0,0,0.65);
			transition: all 450ms ease-in-out;
		}
		&:active {
			background: #fefbf8;
			box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
			transition: 500ms linear;
		}
		i {
			font-size: 2em;
		}
	}
}

#success i {
	color: #3eb470;
}
#info i {
	color: #2A7AC0;
}
#warning i {
	color: #E5A800;
}
#error i {
	color: #ea5050;
}

.alert-success, 
.alert-info, 
.alert-warning, 
.alert-danger {
	font-family: 'Open Sans', sans-serif;
  width: auto !important;
  min-width: 250px !important;
  max-width: 425px !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  margin-top: 20px !important;
  padding: 9px 40px 10px 12px !important;
  vertical-align: middle;
  span {
    display: block;
    letter-spacing: 0.035em !important;
    float: left !important;
    strong {
      font-size: 1.1em !important;
    }
    &:nth-child(2) {
      position: relative;
      top: 1px;
      font-size: 0.85em;
      height: auto !important;
      margin: auto;
    }
    &:nth-child(3) {
			position: relative;
			top: -1px;
      padding-top: 0;
      padding-left: 6px;
    }
    &:nth-child(4) {
			font-size: 0.9em;
      max-width: 75% !important;
      max-height: 75% !important;
      text-overflow: ellipsis;
      overflow: hidden;
			padding: 2px 3px 1px 6px;
    }
    &:before {
      position: relative !important;
      font-size: 1.85em !important;
      top: -0.35px !important;
      margin-right: 3px !important;
      margin-bottom: 20px !important;
    }
  }
  .close {
    top: 29% !important;
    right: 10px;
    height: auto;
    width: 19px;
    border-radius: 100px;
    outline: none !important;
    font-size: 18px !important;
    padding: 2px 1px 1px;
    opacity: 0.8;
    &:hover {
      font-size: 16px !important;
      color: rgba(#fff, 0.95) !important;
      opacity: 0.6;
      transition: background 200ms linear;
      transition: color 250ms linear;
    }
  }
}
.alert-success {
  background: rgba(#b0e3b5, 0.95);
  &:hover {
    background: #b0e3b5;
  }
  .close {
    color: rgba(#3c763d, 0.98);
    &:hover {
      background: rgba(#3c763d, 0.5);
    }
  }
}
.alert-info {
  background: rgba(#b6dafc, 0.95);
  .close {
    color: #31708f !important;
    &:hover {
      background: rgba(#31708f, 0.5) !important;
    }
  }
}
.alert-warning {
  background: rgba(#f0e0a4, 0.95);
  color: #b57317 !important;
  .close {
    color: #b57317 !important;
    &:hover {
      background: rgba(#b57317, 0.6) !important;
    }
  }
}
.alert-danger {
  background: rgba(#e59b9b, 0.95) !important;
  .close {
    color: #be2424 !important;
    &:hover {
      background: rgba(#be2424, 0.5) !important;
    }
  }
}

.fa-warning {
  position: relative;
  top: 4px;
}

* {
	outline: none !important;
}
              
            
!

JS

              
                
function notify(text, type) {
	var head, icon;
	if(type === 'success') {
		head = '<strong>Success </strong>';
		icon = 'fa fa-check-circle';
	} else if(type === 'warning') {
		head = '<strong>Warning </strong>';
    icon = 'fa fa-exclamation-triangle';
	} else if(type === 'error') {
		head = '<strong>Error </strong>';
    icon = 'fa fa-exclamation-circle';
		type = 'danger';
	} else {
		head = '<strong>Info </strong>';
		icon = 'fa fa-info-circle';
	}
	$.notify({
		title: head,
		icon: icon,
		message: text
	},{
		type: type,
		placement: {
			from: 'top',
			align: 'right'
		},
		offset: 4,
		spacing: 8,
		delay: 15000,
		animate: {
			enter: 'animated fadeInRight',
			exit: 'animated fadeOutRight'
		},
		z_index: 99999,
	});
}

module.exports = notify;

              
            
!
999px

Console