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.


    <script src=""></script>
    <script type="text/javascript" src="Localweatherjs.js"></script>
    <script src=""></script>

      <link rel="stylesheet" href="Localweathercss.css">
      <link href="|Bungee+Shade|Monoton|Nova+Square" rel="stylesheet">

    <link rel="stylesheet" href="" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link href="" rel="stylesheet">
  <header class="top-nav">Weather Express</header>
    <div class="container-fluid well fixed" style="margin-right:30%; margin-left:30%; margin-top: 50px;">
      <p id="location"></p>
      <p id="weather"></p>
      <p id="temperature"></p><input type="button" class="btn btn-primary" onclick="farn()" value="ºF" id="F"><input type="button" class="btn btn-primary" onclick="cels()" value="ºC" id="C">
    <div class="search-box">
      <input type="text" name="search" placeholder="Choose a location...">
      <button type="button" class="btn btn-primary" id="cityName">Search</button>
  <footer>Designed by João Cortez</footer>


                .top-nav {
  background-color: black;
  color: white;
  margin: 0;
  padding: 15px;
  text-align: left;
  font-family: 'Bungee Shade', cursive;
  font-size: 45px;

body {
  text-align: center;
  margin-top: 100px;
  background: url('') no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;

.container-fluid {
  padding-top: 250px;
  font-size: 50px;
  font-family: 'Nova Square', cursive;

input[type=text] {
    width: 150px;
    -webkit-transition: width 0.4s ease-in-out;
    transition: width 0.4s ease-in-out;
    border-radius: 10px;
    border: 2px solid grey;

input[type=text]:focus {
    width: 20%;
    outline: none;

footer {
    text-align: center;
    margin-top: 100px;  

#location {
  font-family: 'Audiowide', cursive;
  border: 2px solid black;
  border-radius: 6px;

#F {
  background-color: orange;
  border: none;

#C {
  background-color: orange;
  border: none;

#cityName {
  background-color: orange;
  border: 2px solid white;


                var base = "";
var lat = "";
var lon = "";
var APIkey = "&appid=5472513b95a7d0c54a7fa4aebcb48bf3";
var units = "&units=metric";
var api = "";
var city = "";
var weatherIcons;
var newTemperature;
var tempColor = "";

//using Geolocation part

function callGeoAPI() {
  api = base + lat + lon + APIkey + units;

//for searching Weather using a City's Name

function callCityAPI() {
  api = base + city + APIkey + units;

$(document).ready(function() {

  function getOpenWeatherData() {
    //call OpenWeather api
    $.getJSON(api, function(data) {
      //update HTML with current temp and city name
      $('#temperature').html("<b>Temperature:</b> "+Math.round(data.main.temp) + '&deg;');

      //button to convert C and F, it must have two functions
  $("#F").click(function() {
    $('#temperature').html("<b>Temperature:</b> "+(Math.round(data.main.temp)*(9/5)+32) + '&deg;');

  $("#C").click(function() {
    $('#temperature').html("<b>Temperature:</b> " + Math.round(data.main.temp) + '&deg;');


      var iconCode =[0].icon;
      var iconUrl = "" + iconCode + ".png";

      $("#weather").html("<b>Weather Status:</b> "[0].description+"<img src='" + iconUrl  + "'>");

  //Get users Location info
   //Call the FreeGeoIP API for users IP info and then make call to OpenWeather API
      var freegeoIP = '';
      $.getJSON(freegeoIP, function(data) {
         lat += "?lat=" + data.latitude;
         lon += "&lon=" + data.longitude;
         console.log(lat, lon);
         callGeoAPI(); //set API call parameters
         getOpenWeatherData(); //Get information from API and update HTML

      // Using the search button to search by City Name

    $('#cityName').click(function() {
    var cityName = $('input:text').val();
    city = "?q=" + cityName;