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.

              <body id="bod">

  <div id="tstuff">
  <li class="a" id="cityName"> </li>
  <li class="a" id="cel"> </li>
  <li class="a" id="weatherType"> </li>
  <li class="a" id="windInfo"></li>
  <button id="but" class="btn btn-default"> Click here to change to Metric/Imperial</button>
  -webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;

.a{ text-align:center;
  font-size: 90px;
#tstuff {
  background-color: rgba(255, 255, 255, 0.3);

 width: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  margin: 0 auto;

              $(document).ready(function() {
  //empty vars for use below
  var ftemp;
  var ctemp;
  var long;
  var lat;
  var conversion = true; //this must be a boolean
  // var api = `${}&lon=${coord.long}`;
  var coord = {};
  function location() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
        coord.long = position.coords.longitude; = position.coords.latitude;
        console.log(long, lat);

          "latitude: " + + "<br>longitude: " + coord.long

        // var api = `${lat}&lon=${long}`;
  function weather() {
      "" + +
        "&lon=" +
      function(data) {
        console.log(, coord.long);
        // This is the information that I want to display coming from the api
        var weatherType =[0].description;

        var cel = data.main.temp;
        var windInfo = data.wind.speed;
        var cloudInfo = data.clouds.all;
        var cityName =;

        //end of the information still in Json call function here
        //temperature conversions
        ftemp = cel * (9 / 5) + 32;
        ctemp = (ftemp - 32) * (5 / 9);
        //temperature conversions
        // within the same function i will be targting the HTML with jQuery here

        $("#cel").html(cel + "   C°");
        $("#windInfo").html(windInfo + "  mph");

        //This will be the button making the conversion from ctemp to ftemp

        $("#but").click(function() {
          if (conversion === true) {
            $("#cel").html(ftemp.toFixed(2) + "   F°");
            conversion = false;
          } else if (conversion === false) {
            $("#cel").html(ctemp.toFixed(2) + "   C°");
            conversion = true;
        //end of the button to convert
        if (ctemp <= 0) {
         $("#bod").css("background-image" , "url(");
        else if (ctemp <= 24) {
          $("#bod").css("background-image", "url(");
          // $("body").css("backgroundColor", "yellow");
        } else {
          $("#bod").css("background-image", "url(");


//COLD link :

//MILD link:

//HOT link:

🕑 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.