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="notiflix">
  <h1>Notiflix | Notify</h1>
  <p>Click <a href="https://www.notiflix.com/#Notify" target="_blank">Here</a> to see more.</p>
</div>

<h2 class="demo-title">Demo</h2>
<p class="demo-desc">You can type your own parameters for the live demonstration.</p>

<div class="demo-area">

  <div class="notify success">
    <label>Your text</label>
    <input class="input-success" type="text" value="Success message" />
    <button class="button-success" data-type="success">Send</button>
  </div>

  <div class="notify failure">
    <label>Your text</label>
    <input class="input-failure" type="text" value="Failure message" />
    <button class="button-failure" data-type="failure">Send</button>
  </div>

  <div class="notify warning">
    <label>Your text</label>
    <input class="input-warning" type="text" value="Warning message" />
    <button class="button-warning" data-type="warning">Send</button>
  </div>

  <div class="notify info">
    <label>Your text</label>
    <input class="input-info" type="text" value="Info message" />
    <button class="button-info" data-type="info">Send</button>
  </div>

</div>
              
            
!

CSS

              
                * {outline:none;box-sizing:border-box;}

body {
  padding:10px;
  margin:0;
  font-family:"Quicksand",sans-serif;
  background:#f8f8f8;
}

div.notiflix {
 float:left;
  width:100%;
  margin:0 0 20px;
  padding: 0 0 20px;
  border-bottom:1px solid #cecece;
}

div.notiflix h1 {
  font-weight:500;
  float:left;
  width:100%;
  font-size:24px;
  line-hegiht:26px;
  text-align:center;
  margin: 5px 0 10px;
}

div.notiflix p {
  float:left;
  width:100%;
  font-size:14px;
  line-hegiht:16px;
  text-align:center;
  margin: 5px 0 10px;
}

div.notiflix p a {
  transition: all .2s ease-in-out;
  font-weight:500;
  color:#00b462;
}
div.notiflix p a:hover {
  color:#1e1e1e;
}

h2.demo-title {
  font-weight:500;
  float:left;
  width:100%;
  font-size:20px;
  line-hegiht:20px;
  text-align:center;
  margin: 0 0 10px;
  padding:0;
}
p.demo-desc {
  font-weight:400;
  float:left;
  width:100%;
  font-size:14px;
  line-hegiht:16px;
  text-align:center;
  margin: 0;
  padding:0;
}

div.demo-area {
  float:left;
  width:100%;
}
div.notify {
  background:#fff;
  box-shadow:0 0 20px -10px #000;
  padding:20px;
  border-radius:20px;
  display:block;
  width:98%;
  max-width:360px;
  margin:30px auto 40px;
}

label {
  font-weight:500;
  color:#999;
  float:left;
  font-size:12px;
  line-height:12px;
  margin: 0 0 6px 6px;
}

input {
  transition:all .15s ease-in-out;
  float:left;
  width:100%;
  font-size:15px;
  line-height:40px;
  padding:0 14px;
  margin: 0 0 20px;
  border-radius:20px;
  border:1px solid #ccc;
}
input.input-success:hover {
  border-color:#00b462;
}
input.input-failure:hover {
  border-color:#f44336;
}
input.input-warning:hover {
  border-color:#f2bd1d;
}
input.input-info:hover {
  border-color:#00bcd4;
}

button {
  display:block;
  margin:15px auto 0;
  transition:all .15s ease-in-out;
  cursor:pointer;
  color:#fff;
  background: #00b462;
  border:none;
  font-size:18px;
  padding:8px 24px;
  border-radius:20px;
  box-shadow: 0 6px 20px -8px #000;
}
button:hover {  
  box-shadow: 0 3px 10px -5px #000;
}

button.button-failure {
  background:#f44336;
}
button.button-warning {
  background:#f2bd1d;
}
button.button-info {
  background:#00bcd4;
}
              
            
!

JS

              
                // Init the Notify Module
Notiflix.Notify.Init({});


// Demos
var mainDiv = document.querySelectorAll('.notify');
for (var i = 0; i < mainDiv.length; i++) {
  var self = mainDiv[i];   
  var divClass = self.classList[1];
  var button = document.getElementsByClassName('button-'+divClass)[0];
  
  button.addEventListener('click', function () {  
    
  var thisType = this.getAttribute('data-type');
  var input = document.getElementsByClassName('input-'+thisType)[0];
    
  if (thisType == 'success')
  {
    Notiflix.Notify.Success(input.value); 
  } else if (thisType == 'failure') {
    Notiflix.Notify.Failure(input.value);
  } else if (thisType == 'warning') {
    Notiflix.Notify.Warning(input.value);
  } else if (thisType == 'info') {
    Notiflix.Notify.Info(input.value);
  }

  }, false);

}





              
            
!
999px

Console