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

              
                <h1 class="not-connected">You are not connected to Featureflow</h1>
<p class="not-connected">
  Featureflow helps you manage your project's features across several environments.
  <br/>
  You will need to grab your environment key from your Featureflow account and pass it as the first argument of init.
  
  <a target="_blank" href="https://app.beta.featureflow.io">Create an account</a>
</p>
<pre class="well not-connected">var featureflow = Featureflow.init('env-&lt;env_key_code_here&gt;')</pre>

<h1 class="connected">You are connected to Featureflow</h1>

<p class="connected">
  You should have an "example-feature" set up for you. Turn on the feature and click the button to see the result.
</p>

<button class="btn btn-primary btn-lg connected example-feature-button pointer">
  Is my "example-feature" working?
</button>
<br/>
<br/>
<p id="example-feature-output"></p>
<br/>
<p id="my-new-feature-area" style="display: none"></p>
              
            
!

CSS

              
                body{
  padding: 20px;
  display: none;
}

.pointer{
  cursor: 'pointer';
}

#my-new-feature-area{
  font-size: 18px;
  font-weight: bold;
  animation:rainbow 1s infinite;
  background: #555;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #333;
}

@keyframes rainbow {
0% {color: #ff6666;}
10% {color: #ffcc66;}
20% {color: #ffff66;}
30% {color: #ccff66;}
40% {color: #66ff66;}
50% {color: #66ffcc;}
60% {color: #66ffff;}
70% {color: #66ccff;}
80% {color: #6666ff;}
90% {color: #cc66ff;}
100% {color: #ff66cc;}
}
              
            
!

JS

              
                const JS_API_KEY = '';

$(function(){
  $(".connected").hide();
  $('#example-feature-output').hide();
  $("body").show();
  
  var featureflow = Featureflow.init(JS_API_KEY);
  
  featureflow.on(Featureflow.events.LOADED, init);
  featureflow.on(Featureflow.events.UPDATED_CONTROL, render);

  function init(){
    $(".connected").fadeIn();
    $(".not-connected").hide();
    $("#my-new-feature-area").hide();
    render();
  }
  
  function render(){
    if (featureflow.evaluate('my-new-feature').isOn()){
      $("#my-new-feature-area").text("Congratulations, you have created your first feature and turned it on!").fadeIn();
    }
  }
  
  
  $(".example-feature-button").click(function(){
    if (featureflow.evaluate('example-feature').isOn()){
      $('#example-feature-output').hide().html('Yes, "example-feature" is now turned on. Good job! <br/> <br/> Now create a basic feature with the key "my-new-feature".').fadeIn();
    }
    else{
      $('#example-feature-output').hide().html('No, "example-feature" is not turned on. Go to your environment dashboard and turn it on. You don\'t need to refresh this page.').fadeIn();
    }
  })
})

              
            
!
999px

Console