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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <figure id="venn"></figure>

<aside class="legend">
  <ul>
    <li><span class="icon icon-it"></span> Servers</li>
    <li><span class="icon icon-it"></span> Databases</li>
    <li><span class="icon icon-it"></span> LAMP</li>
  </ul>
  <ul>
    <li><span class="icon icon-development"></span> API</li>
    <li><span class="icon icon-development"></span> MySQL Queries</li>
    <li><span class="icon icon-development"></span> Command Line</li>
  </ul>
  <ul>
    <li><span class="icon icon-design"></span> Photoshop</li>
    <li><span class="icon icon-design"></span> Wireframe</li>
    <li><span class="icon icon-design"></span> Style Guide</li>
    <li><span class="icon icon-design"></span> Typography</li>

  </ul>
  <ul>
    <li><span class="icon icon-devigner"></span> HTML</li>
    <li><span class="icon icon-devigner"></span> CSS/Sass</li>
    <li><span class="icon icon-devigner"></span> jQuery</li>
    <li><span class="icon icon-devigner"></span> Grunt / Gulp</li>
    <li><span class="icon icon-devigner"></span> Responsive Design</li>
    <li><span class="icon icon-devigner"></span> SVG</li>
    <li><span class="icon icon-devigner"></span> WordPress Theming</li>
    <li><span class="icon icon-devigner"></span> CSS Frameworks</li>
    <li><span class="icon icon-devigner"></span> Atomic Design</li>
    <li><span class="icon icon-devigner"></span> Browser Consistency</li>
    <li><span class="icon icon-devigner"></span> SEO</li>
  </ul>
  <ul>
    <li><span class="icon icon-backend"></span> Javascript</li>
    <li><span class="icon icon-backend"></span> React</li>
    <li><span class="icon icon-backend"></span> Angular</li>
    <li><span class="icon icon-backend"></span> PHP</li>
    <li><span class="icon icon-backend"></span> Rails</li>
    <li><span class="icon icon-backend"></span> Python</li>
    <li><span class="icon icon-backend"></span> WordPress Plugins</li>
  </ul>
  <ul>
    <li><span class="icon icon-unicorn"></span> Performance</li>
    <li><span class="icon icon-unicorn"></span> Accessibility</li>
  </ul>
</aside>
              
            
!

CSS

              
                body {
  background: #eaeaea;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  text-align: center;
}

figure {
  max-width: 100%;
}

.tooltip {
  position: absolute;
  text-align: center;
  width: 128px;
  height: 16px;
  background: #333;
  color: #ddd;
  font-size: 14px;
  padding: 5px;
  border: 0px;
  border-radius: 10px;
  opacity: 0;
}

.legend {
  columns: 3 200px;
}

ul {
  list-style: none;
  text-align: left;
}

li {
  line-height: 2em;
  
  span {
    margin-right: 5px;
  }
}

.icon {
  display: inline-block;
  position: relative;
  width: 15px;
  height: 15px;
  top: 3px;
  
  &-design {
    background: #b7cddd;
  }
  
  &-development {
    background: #efcfb3;
  }
  
  &-it {
    background: #bbd8bb;
  }
  &-devigner {
    background: #c9baaa;
  }
  &-freelancer {
    background: #95c3b2;
  }
  &-backend {
    background: #bfc492;
  }
  &-unicorn {
    background: #a3b48b;
  }
}
              
            
!

JS

              
                // D3 Venn Diagram work courtesy of Ben Frederickson: https://github.com/benfred/venn.js

var sets = [
  {sets: ['Design'], size: 15, job: 'Designer'},
  {sets: ['Development'], size: 15, job: 'Developer'},
  {sets: ['IT'], size: 15, job: 'Webmaster'},
  {sets: ['Design','Development'], size: 2, job: 'Front End'},
  {sets: ['Design', 'IT'], size: 2, job: 'Unicorn'},
  {sets: ['Development', 'IT'], size: 2, job: 'Back End'},
  {sets: ['Design','Development', 'IT'], size: 2, job: 'Full Stack!'}
];

var chart = venn.VennDiagram()
  .width(500)
  .height(500);
  var div = d3.select("#venn")
  div.datum(sets).call(chart);
  var tooltip = d3.select("body").append("div")
  .attr("class", "tooltip");
  div.selectAll("path")
    .style("stroke-opacity", 0)
    .style("stroke", "#fff")
    .style("stroke-width", 0)
  div.selectAll("g")
    .on("mouseover", function(d, i) {
    // sort all the areas relative to the current item
    venn.sortAreas(div, d);
    // Display a tooltip with the current size
    tooltip.transition().duration(400).style("opacity", .9);
    tooltip.text(d.job);
    // highlight the current path
    var selection = d3.select(this).transition("tooltip").duration(400);
    selection.select("path")
      .style("stroke-width", 3)
      .style("fill-opacity", d.sets.length == 1 ? .4 : .1)
      .style("stroke-opacity", 1);
  })
    .on("mousemove", function() {
    tooltip.style("left", (d3.event.pageX) + "px")
      .style("top", (d3.event.pageY - 28) + "px");
  })
    .on("mouseout", function(d, i) {
    tooltip.transition().duration(400).style("opacity", 0);
    var selection = d3.select(this).transition("tooltip").duration(400);
    selection.select("path")
      .style("stroke-width", 0)
      .style("fill-opacity", d.sets.length == 1 ? .25 : .0)
      .style("stroke-opacity", 0);
 });
              
            
!
999px

Console