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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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-fluid">
  <div class="row">
    <div class="col text-center">
      <h1>Local Weather App</h1>
  <div class="col text-center">
    <div class="weather-box">
      <div id="icon"></div>
      <p>Location: <span id="location"></span></p>
        <p>Temperature: <span class="temp" id="temp"></span></p>
        <p>Humidity: <span id="hum"></span></p>
        <p>Weather: <span id="over"></span></p>
        <p>Description: <span id="script"></span></p>
        <p>Wind Speed: <span id="wind"></span></p>

<div class="container-fluid footer">
  <div class="row">
    <div class="col-xs-auto">
      <a href="" target="_blank"><image class="footer-icons" src=""></image></a>
<a href="" target="_blank"><image class="footer-icons" src=""></image></a>
<a href="" target="_blank"><image class="footer-icons" src=""></image></a><b><i> Jamiemufu</b></i>



                body {
  background-color: black;
  font-family: verdana;
  color: white;
h1 {
  font-size: 45px;
  text-align: center;
  color: limegreen;
  font-family: "Audiowide", cursive;
  margin-top: 2%;

.weather-box {
  margin: 10px auto auto auto;
  text-align: center;
  width: 40%;
  font-size: 18px;
  margin-bottom: 5em;
span {
  color: limegreen;
  font-size: 20px;
  font-style: italic;

.temp:hover {
  cursor: pointer;
#script {
  text-transform: capitalize;

h3 {

.footer-icons {
  height: 50px;
  width: 50px;
  background-color: limegreen;
  padding: 10px;
  margin-left: -3px;
.footer {
  bottom: 0;
  width: 100%;
  color: limegreen;
  font-family: verdana;
  font-size: 12px;


                //decalre some global variables
var api = "";
var lat;
var long;
var currentTemp;
var far;

$(document).ready(function() { //on document load
  if (navigator.geolocation) { //if geolocation allowed
    navigator.geolocation.getCurrentPosition(function(position) { 
      var lat = position.coords.latitude; //store lat position
      var long = position.coords.longitude; //store long position
      getInfo(lat, long); //call getInfo function
  } else {
    console.log("geolocation not supported"); //if not supported

//function to get all the data and use it on the screen
function getInfo(lat, long) { //pass lat and long thrugh function
  var urlstring = api + lat + "&&lon=" + long; //decalre url variable to get location
    url: urlstring, //use this url
    success: function(data) { //successfull
      var icon = '"' +[0].icon + '"'; //this is the built in icons on API
      var overView =[0].main; //overview from object
      var desc =[0].description; //decirption
      //needed to use 2 variables. One for rounded and one for working out far conversion. Kept getting NAN when trying to use currentTemp rounded with Far
      var currentTemp = data.main.temp;
      var currentTempRounded = Math.round(currentTemp) + String.fromCharCode(176) + "C";
      var far = currentTemp * (9 / 5) + 32;
      var farRounded = Math.round(far) + String.fromCharCode(176) + "F";
      var name =;
      var country =;
      var windSpeed = data.wind.speed;
      var humidity = data.main.humidity;
      //Put data in span locations....
      $("#icon").append("<image src=" + icon + "</image>");
      $("#location").text(name + ", " + country);
      $("#wind").text(windSpeed + "mph");
      //call the function to change the temp on click
      changeTemps(currentTempRounded, farRounded);
//Function to adjust the temperatures onclick
function changeTemps(currentTempRounded, farRounded) {
$("#temp").click(function() {
  if ($("#temp").text() == currentTempRounded){