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


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


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.


                <div class="container">
  <div class="card">
    <h1 class="text-center logo"><i class="wi wi-day-cloudy"></i> Local Weather App! <i class="wi wi-night-alt-sleet"></i> </h1>
    <hr class="content_divider">
    <div class="row">
      <p><span id="city-name" class="name"></span><span id="city-state" class="state"></span></p>
    <div class="row" id="temp-bg">
      <p><i class="fa-3x wi wi-thermometer"></i> <span id="temp-value"></span><i class="fa-4x wi wi-degrees"></i></p>
      <p><span id="temp"></span></p>
    <div id="switch">
      <div class="row">
        <i class="fa-3x wi wi-celsius"></i>
        <button id="switch_c_to_f">
          <span id="unit-toggle"></span>
        <i class="fa-3x wi wi-fahrenheit"></i>
    <div class="row">
      <ul class="col-xs-12 info-box">
        <li class="col-xs-4">Wind</li>
        <li class="col-xs-4">Humidity</li>
        <li class="col-xs-4">blablabla</li>
    <hr class="content_divider">
    <div class="footer">
      <i class="fa fa-copyright"></i> 2016 Spectre Studio / Marco Mazzeo.


                @import url(;
@import url(',400i,700,700i&subset=latin-ext');

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  background: #FF2319;

.card {
  height: 45em;
  width: 36em;
  border-radius: 15px;
  background: #00B242;
  border: 2px solid #B20800;
  box-shadow: 10px 10px rgba(0,0,0,0.28);
  margin: 65px auto;
  text-align: center;

.logo {
  font-size: 2.7em;
  font-family: Lobster, sans-serif;
  font-weight: 100;
  color: #E2FFEC;

.content_divider {
  width: 90%;
  height: 3px;
  border-color: #CCC
.state {
  font-family: Arimo, sans-serif;
  font-size: 3.2em;
  font-weight: 300;
  color: #FFF;
  margin: auto;

#temp-value {
  font-family: Arimo, sans-serif;
  font-size: 4.2em;
  font-weight: 400;
  color: #fff;
  margin: auto;

.wi-celsius, .wi-fahrenheit {
  line-height: .8;
  vertical-align: bottom;

#switch_c_to_f {
  background: #6bbf6b;
	border: none;
	border-radius: 30px;
	outline: none;
	width: 45px;
	height: 20px;
	margin: 0 5px 8px;
	cursor: pointer;
  position: relative;

#unit-toggle {
  position: absolute;
  display: inline-block;
  left: 3px;
  top: 2px;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;

.toggle {
  left: 27px;

div#switch {
  padding: 32px;
  margin: 10px;

.info-box {
  display: inline;
  list-style-type: none;
  color: #fff;
  font-family: sans-serif;
  margin: auto;


                $(document).ready(function() {
// geolocation API
  var geo_api = "";

  $.getJSON(geo_api, function(json){
    var lat =;
    var lon = json.lon;
    // weather API
    var apikey = "69ae4e5cd9c17ed671c3b26166ebe131";
    var weather_api = "" + lat + "&lon=" + lon + "&units=metric&APPID=" + apikey;

    $.getJSON(weather_api, function(data) {
      var location = + ", ";
      var state =;
      var temp = Math.round(data.main.temp);
      var fahrenheit = Math.round((temp*9/5)+32);
      var icon =[0].id;
}); // end of document.ready function