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">
    <div class="row" id="title">
        <div class="col-xs-12 p-t-3 p-b-2">
            <h2>Local Weather Report</h2>
    <div class="row" id="output">
        <div class="col-xs-12 col-sm-4">
            <div class="well well-lg" id="data">
                <div id="location"></div>
                <div id="tempC" class="temp-toggle"></div>
                <div id="tempF" class="temp-toggle hidden"></div>
                <div id="desc"></div>

                <div class="btn-group p-t-2" role="group">
                    <button type="button" class="btn btn-warning units-toggle">Celsius</button>
                    <button type="button" class="btn units-toggle faded">Fahrenheit</button>
        <div class="col-xs-12 col-sm-8">
            <div class="media">
                <img class="img-responsive" id="imgMap">

<div class="row hidden" id="http-only">

  <div class="col-xs-10 col-xs-offset-1 col-sm-6 col-sm-offset-3">
    <h2>HTTPS protocol is not supported in this version.<br><small>Please reload the application by HTTP: <a href='' target=_blank></a></small></h2>        
    <div style="margin-top: -40px;">
    <i class="material-icons md-60">https</i>  
    <i class="material-icons md-60">arrow_forward</i>
    <i class="material-icons md-96" style="font-size: 120px; position: relative; top: 30px;">http</i>    

<footer class="footer">
    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-12 col-sm-10 col-sm-offset-1 footer-icons text-center">
                <a href="" target="_blank"><i class="fa fa-linkedin"></i></a>
                <a href="" target="_blank"><i class="fa fa-codepen"></i></a>
                <a href="" target="_blank"><i class="fa fa-fire"></i></a>
                <a href="" target="_blank"><i class="fa fa-github"></i></a>
        <div class="row">
            <div class="col-xs-12 col-sm-10 col-sm-offset-1 footer-text text-center">
                Copyright &copy; 2016 <a href="" target="_blank">Evgeniy Maynagashev</a>. All rights reserved. <br>
                <!-- -->
                Developed for the freeCodeCamp Front-end Development Challenge<a href="" target="_blank"></a>.


/* Standart footer for projects */
html {
  position: relative;
  min-height: 100%;
  font-family: "Open Sans", "Sans", sans-serif;
body {
  margin-bottom: 90px; /* Margin bottom by footer height */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 90px;
  background-color: #f5f5f5;
.footer-text {padding: 10px; color: #666; font-size: 80%;}
.footer-icons {padding-top:10px; font-size: 20px; color: #666;}
.footer-icons a {margin: 0 3px; color: #666;}

/* Bootstrap 4 spacing features */
/* top */
.p-t-0 { padding-top: 0px; }
.p-t-1 { padding-top: 10px; }
.p-t-2 { padding-top: 15px; }
.p-t-3 { padding-top: 30px; }
/* bottom */
.p-b-0 { padding-bottom: 0px; }
.p-b-1 { padding-bottom: 10px; }
.p-b-2 { padding-bottom: 15px; }
.p-b-3 { padding-bottom: 30px; }
.m-b-0 { margin-bottom: 0px; }
.m-b-1 { margin-bottom: 10px; }
.m-b-2 { margin-bottom: 15px; }
.m-b-3 { margin-bottom: 30px; }
/* --- end of Bootstrap 4 features --- */
#tempC, #tempF {font-size: 200%;}
.faded {color: #bbb;}
.clouds {color: #555;}
#location {font-size: 130%; font-weight: 400;} { font-size: 18px; } { font-size: 24px; } { font-size: 36px; } { font-size: 48px; } { font-size: 60px; } { font-size: 96px; }

#http-only {
  margin-top: 40px;


                $( document ).ready(function() {

function doWeather() {
    $.getJSON('', function(d){
    .fail(function() {
        console.log( "error loading geo data" );
        $('#output, #title').hide();
    $(".units-toggle").on("click", function(){
    function getWeather(d) {
        var m = d.loc.match(/^([\d\.]+),([\d\.]+)/);
        var lat = (m) ? m[1] : 0;
        var lon = (m) ? m[2] : 0;
        var appid = "afa46564f097eecbc5fa34dab15fee02";
        $.getJSON(""+lat+"&lon="+lon+"&appid="+appid, function(w){

    function showWeather(d) {
        var desc = /* "<span>Clouds: "+d.clouds.all+"%</span><br>*/ "<img src='"+[0]['icon']+".png'><br>"
          [0]['main']+" ("[0]['description']+")";

        var tempC = d.main.temp;
        var tempF = tempC*1.8+32;

        document.getElementById("tempC").innerHTML = tempC.toFixed(1)+"°C";
        document.getElementById("tempF").innerHTML = tempF.toFixed(1)+"°F";
        document.getElementById("desc").innerHTML = desc;
    function showCurrentLoc(d) {
        var ar = ( ? [] : [];
        if (d.region) ar.push(d.region);
        if ( ar.push(;

        document.getElementById("location").innerHTML = ar.join(", ");
    function showData(d) {
        var items = [];
        $.each( d, function( key, val ) {
            items.push( "<li id='" + key + "'>" + key + ": <b>" + val + "</b></li>" );
        $( "<ul/>", {
            "class": "my-new-list",
            html: items.join( "" )
        }).appendTo( "body" );
    function showMap(loc) {
        var img = document.getElementById("imgMap");
        img.src = ""+loc+"&zoom=9&size=640x240"; //&maptype=hybrid";
} // end of doWeather()