JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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-US" >
<!-- Still in Progress/ Being Worked On -->
<head>
<title>RDaniels34 | Local Weather</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700|Bitter:400,400italic|Josefin+Sans:400,300italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.9/css/weather-icons.css">
<style>
<a href="http://s1024.photobucket.com/user/RDaniels34/media/morning%20sky2_zpsvfeimsd8.jpg.html" target="_blank"><img src="http://i1024.photobucket.com/albums/y308/RDaniels34/morning%20sky2_zpsvfeimsd8.jpg" border="0" alt=" photo morning sky2_zpsvfeimsd8.jpg"/></a>
</style>
</head>
<body>
<div id="mainBodyDiv">
<header>
<div class="headerDiv">
<h1>My Local Weather</h1>
<h3>Made by: RDaniels34</h3>
</div>
</header>
<div id="topDiv">
<div class="row">
<div class="wi col-xs-6" id="icon">
<p style="text-align: right;"></p>
</div>
<div class="temp col-xs-6" id="temp">
<p style="text-align: left;"></p>
</div>
</div>
</div>
<div ng-app>
<form>
<input id="search" type="text" ng-model="newCity" placeholder="Enter City Name" />
<input id="button" type="submit" />
</form>
</div>
<div id="bottomDiv">
<div class="row">
<div class="city col-xs-4" id="city">
<p style="text-align: right;"></p>
</div>
<div class="weather col-xs-4" id="condition">
<p style="text-align: center;"></p>
</div>
<div class="wind col-xs-4" id="box5">
<p style="text-align: left;"></p>
</div>
</div>
</div>
<div id="footer">
Copyright © RDaniels34 - 2016
</div>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="vendor/angular.js" type="text/javascript"></script>
<script src="scripts/app.js" type="text/javascript"></script>
<script src="/js/plugins/openWeather.js"></script>
</div>
</body>
body {
background-image: url("http://i65.photobucket.com/albums/h235/Ignwar/Album%20Deserts/WhiteSandsNationalMonumentNewMexico.jpg");
background-repeat: no-repeat;
/*background-size: auto;*/
background-attachment: scroll;
width: auto;
heigth: 100%;
background-position: -200px -200px;
}
#mainBodyDiv {
heigth: 100%;
}
.headerDiv {
text-align: center;
}
#mainBodyDiv h1,
#mainBodyDiv h3 {
color: lightyellow;
text-shadow: 3px 2px #633539;
}
#mainBodyDiv .headerDiv h1 {
font-family: Montserrat, Josefin+Sans, Georgia, Serif;
font-size: 30px;
font-weight: 400;
}
#mainBodyDiv .headerDiv h3 {
font-family: Montserrat, Josefin+Sans, Georgia, Serif;
font-size: 16px;
font-weight: 400;
}
#topDiv {
margin-top: 75px;
margin-bottom: 30px;
}
#icon {
display: block;
justify-content: flex-center;
height: 70px;
text-shadow: 3px 2px #633539;
padding-right: 30px;
font-size: 40px;
color: orange;
text-align: right;
}
#temp {
display: auto;
justify-content: flex-center;
height: 70px;
text-shadow: 3px 2px #633539;
padding-left: 0;
font-size: 30px;
color: orange;
}
#search {
outline: 0 !important;
display: flex;
justify-content: center;
width: 205px;
text-align: center;
color: black;
border-radius: 20px;
border: 2px solid grey;
/*position: center;*/
width: 200px;
margin-top: 2px;
background-color: #e6f2ff;
}
form {
display: flex;
justify-content: center;
}
input #button {
display: flex;
justify-content: center;
}
#button {
outline: 0 !important;
color: grey;
border-radius: 20px;
border: 3px solid grey;
width: 70px;
background-color: lightgrey;
margin-top: 4px;
}
#button:active {
background-color: lightgrey;
box-shadow: 0 3px #666;
transform: translateY(2px);
box-shadow: 4px 4px 15px 1px DarkSlateGrey;
}
.city {
font-size: 20px;
color: orange;
text-shadow: 2px 0.5px #633539;
text-align: right;
display: block;
justify-content: flex-center;
height: 60px;
}
#bottomDiv {
margin-top: 100px;
margin-bottom: 20px;
}
#condition {
display: block;
justify-content: flex-center;
text-shadow: 2px 0.5px #633539;
height: 60px;
font-size: 20px;
color: orange;
text-align: center;
}
.wind {
display: block;
justify-content: flex-left;
text-shadow: 2px 0.5px #633539;
height: 60px;
font-size: 20px;
color: orange;
text-align: left;
}
#footer {
text-align: center;
color: #8b4d26;
margin-top: 280px;
font-size: 17px;
}
var app = angular.module('weatherApp', []);
$(document).ready(function() {
//require angular.min.js;
//var newCity;
var url = "http://api.openweathermap.org/data/2.5/weather?q=" + "{{Las Cruces}}" + ",us&units=imperial&APPID=421da4492f2bbe838d519b0e92139dfd";
$.getJSON(url, function(json) {
var city = json.name;
var wind = json.wind.speed;
var temperature = json.main.temp;
var weather = json.weather[0].main;
$(".temp").html(temperature.toFixed(1) + " °F");
$(".city").html(city);
$(".wind").html("Wind " + wind + " mph");
$(".weather").html(weather);
switch (weather) {
case "Rain":
$("#icon").addClass("wi-rain");
break;
case "Thunderstorm":
$("#icon").addClass("wi-thunderstorm");
break;
case "Drizzle":
$("#icon").addClass("wi-raindrops");
break;
case "Snow":
$("#icon").addClass("wi-snow");
break;
case "Atmosphere":
$("#icon").addClass("wi-dust");
break;
case "Clear":
$("#icon").addClass("wi-day-sunny");
break;
case "Clouds":
$("#icon").addClass("wi-cloudy");
break;
default:
break;
}
function newUrl() {
onclick = "getElementById('search').innerHTML";
url.replace('Las Cruces', '{{newCity}}');
}
});
});
Also see: Tab Triggers