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

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

              
                <html>
<head>
	<title>My Weather App</title>
</head>
	<link rel="stylesheet" type="text/css" href="css/normalize.css">
	<!-- Bootstrap CSS CDN -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	<link href="https://fonts.googleapis.com/css?family=Architects+Daughter" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="css/styles.css">
<body>
	<div class="container-fluid">
		<div class="row header">
		<img id ="logo" src="css/graphics/weatherwiz_logo.svg">
			<h2>Weather Wizard</h2>
		</div>
	<div class="container-fluid weatherContent"
		<div class="row text-center">
			<div class="col-xs-12" id="cityState">
				
			</div>
			
		</div>
		<div class="row text-center" id="weatherData">
			<div class = "currentTemp">
   			</div>
   			<div class = "currentConditions">
   			</div>
   			<div class = "percipitationChance">
   			</div>
		</div>
		<div class="row text-center">
			 <div class = "col-xs-12 " id="searchBox">
     			<form>
     				<input type="text" size="50" name="search" placeholder="Enter City Name">
     			</form>
   			 </div>
		</div>
		<div class="row text-center">
			<button id="reveal" class="btn btn-primary">Search</button>
		</div>
		</div>
	</div>
	<div class="footer">
		<a href="#"><img src="css/Graphics/social_1.svg" class="social_icons"></a>
		<a href="#"><img src="css/Graphics/social_2.svg" class="social_icons"></a>
		<a href="#"><img src="css/Graphics/social_3.svg" class="social_icons"></a>
		<a href="https://lettda.github.io/Portfolio-2.0/"><img src="css/Graphics/red_rabbit.svg" class="social_icons" id="brand"></a>
	</div>
</body>
	<!-- Jquery CDN -->
	<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
	<!--BootStrap JS minified CDN -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
	<!-- Author scripts -->
	<script type="text/javascript" src="js/index.js"></script>
</html>
              
            
!

CSS

              
                body {
	
	background-color: red;
/*	background-size: cover;*/
}
/*---Header and Logo Styles --*/
.header {
	position: fixed;
	width: 100%;
	border-bottom: 3px solid white;
	padding-bottom: 25px;
	z-index: 10000;
}
.header h2 {
	font-size: 70px;
	font-weight: bold;
	color: black;
	font-family: sans-serif;
	display: block;
	text-align: center;
	padding-top: 25px;
}
#logo {
	height: 120px;
	width: 120px;
	margin-left: 20px; 
	margin-top: 20px;
	position: absolute;
}
/*---Header and Logo Styles --*/
.weatherContent {
	background-image: url("http://wallpaper-gallery.net/images/sunshine-wallpaper/sunshine-wallpaper-12.jpg");
  background-width: 100%;
  background-height: 100%;
  backgroun-repeat: no-repeat;
}

#cityState h2 {
	margin-top: 300px;
	font-size: 70px;
	font-weight: bold;
	color: black;
	font-family: sans-serif;
}
/*---Weather Conditions Styles --*/
#weatherData {
	font-size: 2em;
	color: white;
	display: inline-flex;
	text-align: center;
	margin: 100px 25% 100px 25%;
}
#weatherData div {
	margin: 20px 20px;
	border: 2px solid white;
	background-color: black;
	height: 120px;
	width: 120px;
}
#conditions {
	height: 100px;
	width: 150px;
}
/*---Search Box Styles --*/
input{
	margin-top: 200px;
	margin-bottom: 50px;
	border-radius: 5px;
	height: 40px;
	text-align: center;
	size: 1.5em;
}
/*---Header and Logo Styles --*/
.footer {
  height: 50px;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1rem;
  background-color: black;
  text-align: center;
}
.social_icons {
	height: 40px;
	width: 40px;
	display: inline-flex;
	margin-right: 25px;
	margin-bottom: 5px;
	margin-top: -5px; 
}
              
            
!

JS

              
                $(document).ready(function(){

	var long;
	var lat;
	var currentCity;
	var currentState;
	var country;

		$.getJSON("https://crossorigin.me/http://ip-api.com/json", function(data_init){ //access RESTFUL geo location API & set lattitude.longitude
			lat = data_init.lat;
			long = data_init.lon;
			currentCity = data_init.city;
			currentState = data_init.region;
			country = data_init.country;
					$("#cityState").append("<h2>"+currentCity + "," + currentState + "<br>" + country + "</h2>");

		// var api = "https://crossorigin.me/https://api.darksky.net/forecast/1246aa267663e22a4e428e4b20f0df5b/" + lat +"," + long;
		// //Access weather API
		console.log(data_init);
		

			$.getJSON(api, function(data){
				console.log(data);
				var weatherStatus = data.currently.icon; //get Icon from API related to current weather conditions

				// switch(weatherStatus) {
				// 	case:
				// }

				$(".currentTemp").append("<h4 id='tempData'>Currently<br> "+data.currently.temperature+"&#8451</h4>");
				$(".currentConditions").append("<h4>Conditions<br>"+data.currently.summary +"</h4>");
				$(".percipitationChance").append("<h4> Chance of Percipitation<br> " + data.currently.precipProbability +"%" + "</h4>");
				$(".wind")	
					$("#reveal").on('click', function(){ //click button
						data.main.tempData //on click convert temperature to farenheight
					});
				
				$("#tempData").hover(function(){
					$(this).fadeToggle('slow', function(){

					});
				});
			});		
		});
});
              
            
!
999px

Console