Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <link href="https://fonts.googleapis.com/css?family=Quicksand" rel="stylesheet">
<div  id = "fontSheet">
<div class='container-fluid horizCenter text-center '>
	<h1 class="text-center theBigFont ">Local Weather App</h1>
	<h1 class='text-center theFont' style='color:rgb(51, 51, 51); padding-bottom: 25px;'>Created by Chase Bugeaud</h1>
	<p class="theSlightlyLargerSmallFont"><b>Temperature</b></p>
	<div class="theFont" style='padding-bottom: 25px;'>

		  <div class="spinner">
			<div class="bounce1"></div>
			<div class="bounce2"></div>
			<div class="bounce3"></div>
		</div>
		<p class = "theSmallFont" id="city"></p>
		<p class="theSmallFont" id="temp"></p>

		<button class="btn btn-default  buttonText tempButton">°F</button>
	</div>


</div>
</div>
<!--

<div class="spinner">
  <div class="bounce1"></div>
  <div class="bounce2"></div>
  <div class="bounce3"></div>
</div>

.spinner {
  margin: 100px auto 0;
  width: 70px;
  text-align: center;
}

.spinner > div {
  width: 18px;
  height: 18px;
  background-color: #333;

  border-radius: 100%;
  display: inline-block;
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
}

.spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
  0%, 80%, 100% { -webkit-transform: scale(0) }
  40% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bouncedelay {
  0%, 80%, 100% { 
    -webkit-transform: scale(0);
    transform: scale(0);
  } 40% { 
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
  }
}
-->
              
            
!

CSS

              
                .horizCenter {
	margin-left: auto;
	margin-right: auto;
}

.theBigFont {
	font-family: 'Quicksand', sans-serif;
	font-size: 599%;
	color: black;
}

.buttonText {
	text-align: center;
	font-family: 'Quicksand', sans-serif;
	font-size: 100%;
	color: black;
	margin-left: 500;
	margin-right: auto;
}

.theSmallFont {
	font-family: 'Quicksand', sans-serif;
	font-size: 200%;
	color: black;
}

.theSlightlyLargerSmallFont {
	font-family: 'Quicksand', sans-serif;
	font-size: 300%;
	color: black;
}

h3 {
	color: black;
}

.theFont {
	font-family: 'Quicksand';
	color: black;
}

p {
	color: black;
}

.spinner {
	margin: 10px auto 0;
	width: 70px;
	text-align: center;
}

.spinner > div {
	width: 18px;
	height: 18px;
	background-color: #333;
	border-radius: 100%;
	display: inline-block;
	-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
	animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
	-webkit-animation-delay: -0.32s;
	animation-delay: -0.32s;
}

.spinner .bounce2 {
	-webkit-animation-delay: -0.16s;
	animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
	0%,
	80%,
	100% {
		-webkit-transform: scale(0)
	}
	40% {
		-webkit-transform: scale(1.0)
	}
}

@keyframes sk-bouncedelay {
	0%,
	80%,
	100% {
		-webkit-transform: scale(0);
		transform: scale(0);
	}
	40% {
		-webkit-transform: scale(1.0);
		transform: scale(1.0);
	}
}

body {
	background-size: cover;
}
.whiteFont {
	color: white !important;

}
.blackFont {
	color: black !important;
}
              
            
!

JS

              
                $(function() {
	var weather;
	var cityCountry;
	var country;
	var city;
	var tempStr;
	var temp = 0;
	var lat = 0;
	var lon = 0;
	var icon = "";
	var checkIcon = [];
	var locAPI = "http://ip-api.com/json";
	var nightMode = false;
	var temperature;
	$.getJSON(locAPI, function(data2) {
		lat = data2.lat;
		lon = data2.lon;
		city = data2.city;
		country = data2.country;

		var api = "http://api.openweathermap.org/data/2.5/weather?q=" + city + "," + country + "&appid=2206c9286430cf05bcf8566b57a7c2f6";
		$.getJSON(api, function(data) {
			icon = data.weather[0].icon;
			checkIcon = icon.split("");
			cityCountry = city + ", " + country;
			weather = data.main.temp;
			temperature = weather;
			$("#city").html(cityCountry);
			temperature = weather * (9 / 5) - 459.67;
			tempStr = temperature.toString();
			tempStr = tempStr.substring(0, 5);
			
			$("#temp").html(tempStr);

			$(".tempButton").click(function() {

				$(this).toggleClass('.temp');
				
				if ($(this).hasClass('.temp')) {
					
					temperature = weather - 273.15;
					tempStr = temperature.toString();
					tempStr = tempStr.substr(0, 5);
					$(this).text('°C');
					
				} else {
					
					temperature = weather * (9 / 5) - 459.67;
					tempStr = temperature.toString();
					tempStr = tempStr.substr(0, 5);
					$(this).text('°F');
					$("#temp").html(tempStr);

				}

				$("#temp").html(tempStr);

			});
			$(".spinner").remove();
			if (data.weather[0].id > 199 && data.weather[0].id < 233) {
				$('body').fadeTo('slow', 0.1, function() {
					$(this).css('background-image', 'url(https://blog.thomascookairlines.com/wp-content/uploads/2015/05/Sunny-Skies-1050x701.jpg)');

				}).fadeTo('slow', 1);

			} else if (checkIcon[2] == "n") {
				$('body').fadeTo('slow', 0.1, function() {
					$(this).css('background-image', 'url(http://wallpapercave.com/wp/m2FZL4L.jpg)');

				}).fadeTo('slow', 1);
				nightMode = true;

			} else if (data.weather[0].id > 499 && data.weather[0].id < 532) {
				$('body').fadeTo('slow', 0.1, function() {
					$(this).css('background-image', 'url(https://s3.amazonaws.com/hrnwp/wp-content/uploads/2016/11/rain-980076_960_720.jpg)');

				}).fadeTo('slow', 1);

			} else if (data.weather[0].id > 199 && data.weather[0].id < 233) {

				$('body').fadeTo('slow', 0.1, function() {
					$(this).css('background-image', 'url(http://more-sky.com/WDF-405468.html)');

				}).fadeTo('slow', 1);
			} else if (data.weather[0].id > 799 && data.weather[0].id < 805 && nightMode === false) {
				$('body').fadeTo('slow', 0.1, function() {

					$(this).css('background-image', 'url(http://www.gamsachurch.org/wp-content/uploads/2014/05/nature-landscape-clear-sky-wallpaper-hd-clear-sky-complete-clear-sky-accounting-clear-sky-elementary-clear-sky-draught-haus-clear-sky-data-clear-sky-clear-skies-clear-sky-holidays-clear-skype-history-.jpg)');

				}).fadeTo('slow', 1);
			} else {
				console.log("an error has occured");
			}
		});
	});

	// SITE TO GET WEATHER INFO FROM
	//http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=2206c9286430cf05bcf8566b57a7c2f6

});
              
            
!
999px

Console