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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 id="grey-bg">
<div id="container">
  Weather App</h2>
<p>Please allow access to location for this to work!</p>
<h3>Your coordinates:</h3>
<p id="lon">Longitude: </p>
<p id="lat">Latitude: </p>
  <p id="location"></p> 
<img src="" id="icon"/>
<h5 id="weather"></h5>
<button id="temp"></button>
<div id="lol" align="center">Made by <a href="">quantomistro<a/>, 2018</div>


                .border {
  color: white;
  cursor: pointer;
  background-color: rgba(0,0,0,0);
#container {
  color: rgb(225,225,225);
  text-align: center;
  position: absolute;
  left: 170px;
  right: 170px;
  bottom: 0px;
  top: 0;
  padding-top: 15px;
  background-color: rgba(64,64,64,0.9);
  overflow: hidden;
.border:hover {
  background-color: white;
  border-color: white);
  color: black;
html { background: url("") no-repeat center fixed;
  background-size: cover;
.shadow {
  box-shadow: 3px 3px 4px rgba(0,0,0,0.6);
  border-style: solid;
  border-width: 0;
  border-radius: 3px;
  margin-bottom: 15px;
h5 {
  font-family: "Kaushan Script", sans-serif;
@keyframes zoom {
  0% {}
  100% {font-size: 2.5rem; color: white; text-shadow: 3px 3px 3px black;}
@keyframes zoom2 {
  100% {font-size: 125%; color: white; text-shadow: 3px 3px 3px black;}
h5:hover {
  animation-name: zoom;
  animation-duration: 0.5s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
p:hover {
  animation-name: zoom2;
  animation-duration: 0.5s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;  
h2,h3,h5,p {
  cursor: default;
#lol {
  color: lightgrey;
  position: absolute;
  bottom: 0;
  left: 100px;
  right: 100px;


                $(document).ready(function() {
  if (navigator.geolocation) {
    var lat, lon;
      function(position) {
        lat = position.coords.latitude;
        lon = position.coords.longitude;
        var fccurl =
          "" +
          lat +
          "&lon=" +
          .done(function(data) {
            var arr =[0].description.split("");
            arr[0] = arr[0].toUpperCase();
            var descrip = arr.join("")
            var degF = data.main.temp * 9 / 5 + 32;
            $("#lon").html("Longitude: " + lon);
            $("#lat").html("Latitude: " + lat);
            $("#temp").html(Math.round(data.main.temp) + "°C");
          $("#temp").addClass("border btn");  
          $("#temp").on("click", function() {
              if (
                  .substr(-1, 1) == "C"
              ) {
                $("#temp").html(Math.round(degF) + "°F");
              } else {
                $("#temp").html(Math.round(data.main.temp) + "°C");
          if ( != "") {
            $("#location").html("Location: " +;
          .fail(function() {
            alert("Sorry, weather API request failed.");
      function() {
        alert("Sorry, geolocation request failed!");
  } else {
    alert("Sorry, geolocation is not supported by this browser!");