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 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="well well-main">
    <div class="row text-center" id="contentarea">
      <div class='col-md-5'>
        <h1 class="text-center text-primary" id="cityName">tmp1</h1>
        <h4 class="text-center text-primary" id="temp">tmp2</h4>
        <h4 class='text-center text-primary' id='condition'>tmp3</h4>
      <div class="col-md-5">
        <span class="icon"></span><br/>
        <button id="cv-btn" class='btn btn-primary' onclick="javasctipt:changeToC()">C</button>


                @import '|Raleway|Suez+One';

  background: #000000;
  margin-left: 25%;
  border: solid;
  border-color: #FFF;
  border-size: 35px;
  background: rgba(135, 135, 135, 0.85);
  font-family: Montserrat, sans;
  font-size: 30pt;
  color: rgb(49,148,181);
  background-color: rgba(0,0,0,.4);
  width: auto;
  margin: auto;
  border: none;
  font-family: Raleway, sans;
  font-size: 18pt;
  margin-top: 10px;
  text-shadow: 3px 3px 0 #FFF, -1px -1px 0 #FFF, 1px -1px 0 #FFF, -1px 1px 0 #FFF, 1px 1px 0 #FFF;
  text-shadow: 3px 3px 0 #FFF, -1px -1px 0 #FFF, 1px -1px 0 #FFF, -1px 1px 0 #FFF, 1px 1px 0 #FFF


                var baseUrl = '';
var conIcon = '';
var appid = '&APPID=3ae0eda6861dec46ee03c68c739698f4'
var lat = 'lat=';
var lon = '&lon=';
var city = 'q='
var conIcon = ''
var apiString='';
var tempK;
var tempC;
var tempF;
var cName;
var conDesc;
var id;

function getWeather(){
  $.getJSON('', grabApiStringByCoord);
function grabApiStringByCoord(data){
  var full = data.loc;
  var fullArray = full.split(',');
  lat += fullArray[0];
  lon += fullArray[1];
  apiString =  baseUrl + lat + lon + appid;
  $.getJSON(apiString, parseWeather);
function grabApiStringByCity(){
  return baseUrl + city + appid;
function parseWeather(json){
  id =[0].id;
  tempK = json.main.temp;
  conDesc =[0].description;
  conIcon +=[0].icon + '.png';
  cName =;
  tempC = toCelcius(tempK);
  tempF = toFarenheit(tempK);
  setHTML(cName, conIcon, tempF, "F", conDesc, id);
function setHTML(cname ,icn, tmp , uni, des, id){
  $('#temp').html(tmp + ' &#8457;');
  $('.icon').html('<img src="' + icn + '" width="100px">').appendTo('.icon');
  $('body').css('background-size', '100%');
  $('body').css('background-repeat', 'no repeat');
  if (id < 299){
  }else if ((id > 299)&&(id<399)){
  }else if ((id > 400)&& (id < 599)){
  }else if ((id > 599) && (id<699)){
  }else if ((id>699) && (id < 799)){
  }else if (id === 800){
  }else if ((id>800)&&(id<899)){
  }else if (id >= 900){
function toCelcius(t){
  return Math.round(t-273.15);
function toFarenheit(t){
  return Math.round(t*(9/5) - 459.67);
function changeToC(){
  $('#temp').html(tempC + ' &#8451;');
  $('#cv-btn').attr('onclick', 'javascript:changeToF()');
function changeToF(){
  $('#temp').html(tempF + ' &#8457;');
  $('#cv-btn').attr('onclick', 'javascript:changeToC()');
window.onLoad = getWeather();