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.

<html lang="en">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Weather 'tis Nobler</title>

    <!-- Bootstrap core CSS -->
   <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link href="https://fonts.googleapis.com/css?family=Baloo" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Julius+Sans+One" rel="stylesheet">
<body class="border-color">
  <div class="container-fluid">
    <nav class="navbar navbar-inverse navbar-default navbar-fixed-top">
    <div class="container-fluid navbar-theme">
      <div class="navbar-header">
        <div class="navbar-header">
          <a class="navbar-brand" href="http://www.kensdemos.xyz" target="_blank">
            <span class="logo-text">Ken Bonilla</span></a>
  <div class="spacer"></div>
  <div class="bigger-name text-center">Weather App</div>
  <div class="spacer-small"></div>
  <div class="my-custom-text container text-center">
    <div class="big-name">
        <span id="city"><i class="fa fa-circle-o-notch fa-spin"></i>Getting Location</span>
        <span id="state"></span>
    <div class="biggest"
        <canvas id="icon1" width="110" height="110" style="vertical-align: middle;"></canvas>
        <span id="temp"></span>
    <span id="units"></span>

<footer class="container">
  <div class="footer custom-footer text-center navbar-fixed-bottom">
    Kenneth Bonilla &copy; 2017
    <a href="https://darksky.net/poweredby/" target="_blank">Powered by Dark Sky</a>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/skycons/1396634940/skycons.min.js"></script>
              .logo-text {
  padding: 10px 5px 5px 5px;
  font-size: 22px;
  font-family: 'Baloo', cursive;

.border-color {
  background-color: #232528;
.spacer {
  height: 75px;
.spacer-small {
  height: 25px;
.my-custom-text {
  color: white;

.big-name {
  font-family: 'Julius Sans One', sans-serif;
  font-size: 38px;
  color: white;
.bigger-name {
  font-family: 'Julius Sans One', sans-serif;
  font-size: 54px;
  color: white;

.biggest {
  font-family: 'Julius Sans One', sans-serif;
  font-size: 94px;
  color: white;

.custom-footer {
  background-color: #0e1014;
  color: white;
var lonStr = "";
var latStr = "";
var theUnits;
var rawTemp;
function failLocation() {
  console.log("failed to get location");

function successLocation(pos) {
  latStr += pos.coords.latitude;
  lonStr += pos.coords.longitude;
  var GEOCODING = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' + latStr + '%2C' + lonStr + '&language=en';
  $.getJSON(GEOCODING).done(function(location) {
                $('#city').html(location.results[0].address_components[2].long_name +',\t');

function getLocation() {
  navigator.geolocation.getCurrentPosition(successLocation, failLocation);

function skycon(val) {
  var skycons = new Skycons({"color": "white", "resizeClear": true});
  skycons.add('icon1', val);

function getWeather() {
  var xsd = ['43c','61','2a3','3ac','336','274','2ea','582','21','e27','b3e','28e','ec','ed5','676','8d7'];
  var keywapi = "";
  keywapi += xsd[9] + xsd[5] + xsd[2] + xsd[4];
  keywapi += xsd[6] + xsd[14] + xsd[11] + xsd[13];
  keywapi += xsd[10] + xsd[15] + xsd[1];
  var darkSkyLink = "";
  darkSkyLink += 'https://api.darksky.net/forecast/';
  darkSkyLink += keywapi +'/' + latStr + ',' + lonStr;
  darkSkyLink += '?callback=?&exclude=minutely,hourly,daily,alerts';
  $.getJSON(darkSkyLink).then(function(forecast) {
    rawTemp = forecast.currently.temperature;
    var curtmp = Math.floor(forecast.currently.temperature);
    $('#temp').html(curtmp +'&deg;');
    var units = forecast.flags.units;
    if(units === "us"){
      theUnits = 'F';
      theUnits = 'C';
    var curskycon = forecast.currently.icon;

function switchUnits() {
  if(theUnits === 'F'){
    var newTemp = Math.floor((rawTemp - 32) / 1.8);
    theUnits = 'C';
    $('#temp').html(newTemp +'&deg;');
    var newTemp = Math.floor(rawTemp);
    theUnits = 'F';
    $('#temp').html(newTemp +'&deg;');

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