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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.


<link href="" rel="stylesheet">

<div class="container">
  <div class="box">
			<div class="row col-xs-6 col-xs-offset-3 text-center">
				<p><i class="fas fa-map-marker-alt fa-2x" ></i> <span class="big" id="city">Loading.....</span>
      <div class="row text-center">
        <span class="big temperature">16 °C</span>
      <div class="row weather-icon">
        <img src="" id="weatherimg"/>
      <div class="row col-xs-6 col-xs-offset-3 text-center">
          <p class="big" id="weather">Sunny</p>


@import url(,300,700);


.container {
  font-family: "Josefin Sans";
  background: #3B3A35;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /*color: #fff;
  background-color: #3B3A35;
 /*3547ce  b0c4de

  position: relative;
  display: flex;
  flex-direction: column;
  background-color: #eeeeee;
  padding: 40px 0px 0px 0px;
  justify-content: space-between;
  min-width: 600px;
  min-height: 150px;
  text-align: center;
  border-radius: 3px;
  box-shadow:4px 6px 20px ;



              var sunny = /(sun|clear|calm|hot)+/i;
var breeze = /breez+/i;
var storm = /(storm|tornado|hurricane)+/i;
var cloudy = /(cloud|fog|dust|haze|smok|bluster)+/i;
var part = /part+/i;
var rainy = /(rain|drizzl|shower)+/i;
var snowy = /(snow|freez|hail|cold)+/i;
var sleet = /sleet+/i;

var weather = null;




var changeweather = function(w) {
  if (snowy.test(w)) {
      document.getElementById('weatherimg').src = "";
  } else if (sleet.test(w) || rainy.test(w)) {
      document.getElementById('weatherimg').src = "";
  } else if (storm.test(w)) {
      document.getElementById('weatherimg').src = "";
  } else if (cloudy.test(w) || breeze.test(w)) {
    if (part.test(w)) {
      document.getElementById('weatherimg').src = "";
    } else {
      document.getElementById('weatherimg').src = "";
  } else if (sunny.test(w)) {
      document.getElementById('weatherimg').src = "";

  var temp = $(".temperature").html();
  var unit = temp.slice(-1);
  var num = temp.slice(0, temp.length - 3) / 1;
  if (unit == "C") {
    num = Math.floor((num * 9) / 5 + 32);
    $(".temperature").html(num + " °F");
  } else {
    num = Math.floor((num - 32) * (5 / 9));
    $(".temperature").html(num + " °C");

function place(){
  var latitude = null,
      longitude = null;
  function success(position){
    latitude = position.coords.latitude;
    longitude = position.coords.longitude;
    getWeather([latitude, longitude]);
  function error(){
    $('.container').html('data for location does not exist');
  navigator.geolocation.getCurrentPosition(success, error);

  function  getWeather(coords){
      url:'' +coords[0] + '&lng=' + coords[1],
      success: function(data){
        //data = JSON.parse(data);
        var unit =;
        $(".temperature").html( + " °" + unit);
        weather =;
      error: function(err){
        $('.container').html('data for location does not exist');
      beforeSend: function(xhr){
        xhr.setRequestHeader("X-Mashape-Authorization", '3KYDJOOdb6mshD7koVF9V3uMYgaAp1oRXvSjsnc9MOvrjDkAxP');