Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <!-- Permission to use FFC logo was assumed, I'm sorry -->
<img id="fcc-logo" src="" />
<h1>Campsites Across the Globe</h1>

<!-- Map Visualization -->
<div id="campsite-map">
  <svg width="960" height="611"></svg>

<!-- Because I keep accidentally deleting these URLs from JS file -->
<!-- -->
<!-- -->
              body {
  background: #006400;
  text-align: center;
  font-family: "Lato", sans-serif;
  color: #FFFFFF;
#fcc-logo, h1 {
  margin: 0px;
  filter: drop-shadow(2px 2px 5px #333333);
  max-height: 60px;
#campsite-map {
  background: #FFFFFF;
  margin: 15px auto;
  max-width: 960px;
  max-height: 480px;
  padding: 25px;
  -webkit-box-shadow: 5px 5px 10px #333333;
     -mox-box-shadow: 5px 5px 10px #333333;
          box-shadow: 5px 5px 10px #333333;
#campsite-map svg {
  width:100% ;
  border: 2px solid #006400;
  border-radius: 10px;

  max-width: 960px;
  max-height: 480px;
.land {
  fill: #BBBBBB;

.boundary {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 0.5px;
.campsites {
  fill: #006400;
  opacity: .3;
  z-index: 100;
.campsite-info {
  position: absolute;
  text-align: center;
  font-size: 12px;
  color: #EEEEEE;
  background: #006400;
  border: 1px solid #EEEEEE;
  border-radius: 2.5px;
  padding: 3px;
  opacity: 0.95;
  z-index: 1000;
  -webkit-box-shadow: 2px 2px 5px #333333;
     -mox-box-shadow: 2px 2px 5px #333333;
          box-shadow: 2px 2px 5px #333333;
              var svg     ="svg"),
    width   = +svg.attr("width"),
    height  = +svg.attr("height");

var projection = d3.geoCylindricalStereographic()
                   .translate([width/2, height/2])

var path = d3.geoPath()

// Define the div for the tooltip
var tip ="#campsite-map")
            .attr("class", "campsite-info")
            .style("display", "none");

// Zoom and pan functionality
var zoom = d3.zoom()
             .scaleExtent([1, 10])
             .translateExtent([[0,0],[width, height]])
             .on("zoom", zoomed);

function zoomed(){
  rt.attr("transform", d3.event.transform)

var rt = svg.append("g")

  .attr("width", width)
  .attr("height", height)
  .style("fill", "none")
  .style("pointer-events", "all");

// Create the world
d3.json("", function(err, world) {
  if (err) { console.log(err); }

     .attr("class", " countries land")
     .attr("d", path);

     .datum(topojson.mesh(world, world.objects.countries, function(a, b) { return a !== b; }))
     .attr("class", " countries boundary")
     .attr("d", path);

  // Multiply and replenish the earth
  d3.json("", function(err, campsites) {
    if (err) { console.log(err); }


        // Facebook group links
        .attr("xlink:href", function(d) { return d.facebook; })
        .attr("target", "_blank")

        // Campsite markers
        .attr("cx", function(d) {
          d = d.coords;
          if (d !== undefined) { return projection([d.lng,])[0]; }
        .attr("cy", function(d) {
          d = d.coords;
          if (d !== undefined) { return projection([d.lng,])[1]; }
        .attr("r", 2)
        .attr("class", "campsites")

        // Tooltip event handlers
        .on("mouseover", function(d) {
             .style("display", "block")
          tip.html(", "+(d.region?d.region+", ":"")
             .style("left", (d3.event.pageX+5)+"px")
             .style("top", (d3.event.pageY-20)+"px");
        .on("mouseout", function() {
             .style("display", "none")


🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.