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

              
                <!--Metereological information by Open Weather App. Geographical information by IP API. WIFI is advised for better results.-->
<head>
  <link href="https://fonts.googleapis.com/css?family=Palanquin+Dark:400,600,700" rel="stylesheet">

</head>

<body>
  <div class="container-fluid">

    <h1 class="text-center">Weather app</h1>

    <!-- TV Antenna Filled icon by Icons8 -->
    <img src="https://maxcdn.icons8.com/iOS7/PNG/75/Computer_Hardware/tv_antenna_filled-75.png" title="TV Antenna Filled" width="75">    
    <div class="tv">
      <div class="screen">
        <p class="city" id="location"></p>

        <p id="weather" class="degrees"></p>

        <div class="icon" id="iconPlace" ></div>

        <p id="description" class="weatherDetails"></p>

      </div>

      <div class="buttons text-center">
        <button type="button" class="temp-f">F</button>       

        <button type="button" class="temp-c">C</button>      

        <hr>
        <hr>
        <hr>
        <hr>
        <hr>
        <hr>
        <hr>
        <hr>

    </div>
      
      
      <!--  <form class="formWeather" action="">
          <input type="search" id="cityInput" placeholder="Enter city to improve accuracy"/>
          <button type="submit"><i class="fa fa-search" id="submitBtn"></i></button>
        </form> -->

    </div>
<footer class="bottom">
        2017 &copy; Coded by Javi SP </br>
      <a href="https://icons8.com">Icon pack by Icons8</a>
      </footer>
    
  </div>
</body>

              
            
!

CSS

              
                  body {
    background: url(https://res.cloudinary.com/dovbrtmkv/image/upload/v1491646783/ep_naturalwhite_j1b3vb.png);
  }

  img {
    display: block;
    margin: 10px auto;
  }

  .tv {
    width: 100%;
    max-width: 580px;
    height: 316px;
    border: solid 10px #262626;
    border-radius: 10px;
    margin: auto;
  }

  @media screen and (max-width: 870px) and (min-width: 300px) {
    .tv {
      height: 300px;
    }
    
    .weatherDetails {
      margin-top: -5%;
    }
  }

  .screen {
    height: 100%;
    width: 72%;
    background-color: #d0e1e1;
    float: left;
    border-right: 6px solid #262626;
  }

  .city {
    text-align: center;
    font-size: 2em;
    color: #000000;
    font-family: 'Palanquin Dark';
  }

  .degrees {
    font-size: 4em;
    font-family:'Palanquin Dark';
    text-align: center;
  }

  .weatherDetails {
    font-size: 2em;
    font-family:'Palanquin Dark';
    text-align: center;
  }

  .buttons {
    height: 100%;
    width: 28%;
    float: right;
    background-color: #737373;
    padding-top: 3%;
  }

button {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 3px;
  background-color: #cccccc;
  border: none;
}

button:focus {
  outline: none;
}

 hr {
    width: 60%;
    background-color: #000000;
  }

.bottom {
  text-align: center;
  font-size: 15px;
  color: #000000;
}
  
  input {
    width: 70%;
    border-radius: 30px;
}

a {
  color: #000000;
}
              
            
!

JS

              
                $(document).ready(function() {
  var locationScreen = "";

  $.getJSON("https://api.weatherapi.com/v1/current.json?key=bc9d3c43019d4060865150317200301&q=Brighton", 
    function(data) {
      $("#location").text(data.location.name);
      var celsius = Math.round(data.current.temp_c);
      var fahrenheit = Math.round(data.current.temp_f);
      var details = data.current.condition.text;
      var wetterIcon = data.current.condition.icon;
      $("#description").text(details);
      $("#iconPlace").html("<img src='" + wetterIcon + "'alt=Weather Icon" + "/>");
      $("#weather").text(celsius + "ºc");
      
      //switch between Celsius and Fahrenheit
      $('.temp-f').click(function () {
        $('#weather').html(fahrenheit      + 'ºf');
      });
      $('.temp-c').click(function () {
        $('#weather').html(celsius +        'ºc');
      });
      var weatherDescription = $("#description").text();
      if (weatherDescription.length > 35) {
        document.getElementById("description").style.fontSize = "1em";
      }
  });
}); 

              
            
!
999px

Console