Weather App
How do I make an weather app?
What is a weather app? How do you make a weather app? This script and codes were developed by Anukaran Kathuria on 02 September 2022, Friday.
Weather App - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Weather App</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<p id="demo"></p>
<div class="row col-md-12" id="region"></div>
<div class="row col-md-12" id="icon"></div>
<div class="row col-md-12" id="description"></div>
<div class="row col-md-12" id="temp"></div>
<div>
</div> <div class="footer">Created by <a href="https://www.linkedin.com/in/anukath/" target=_blank>Anukaran Kathuria</a></div>
</body> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Weather App - Script Codes CSS Codes
body { background: black;
}
h1 { font-size: 4em;
}
h3 { display: inline;
}
#region { text-align: center; color: #C0C0C0;
}
#icon { text-align: center;
}
#temp { text-align: center; font-size: 40px; color: #C0C0C0;
}
#description { color: #C0C0C0; text-align: center; font-size: 40px;
}
.footer { position: fixed; right: 0; bottom: 0; left: 0; padding: 1rem; color:white; text-align: center;
}
Weather App - Script Codes JS Codes
var x = document.getElementById("demo");
var long;
var lat;
var city;
var country;
var temps;
var icon;
var description;
$.get( "https://ipinfo.io", function(response) { var loc = response.loc.split(","); lat = loc[0]; long = loc[1]; console.log(lat); console.log(long); console.log(response.loc, response.city, response.country); city = response.city; country = response.country; weather(); $("#region").html("<h1>" + city + ", " + country + "</h1>"); }, "jsonp"
);
function weather() { $.getJSON( "http://api.openweathermap.org/data/2.5/weather?id=524901 &APPID=815a983d7d6c67cc47b66709d2b3ba5b&lat=" + lat + "&lon=" + long + "&units=metric", function(a) { console.log(a); console.log(a.main.temp); temps = a.main.temp; description = a.weather[0].description; icon = a.weather[0].icon; $("#temp").html("<h3>"+temps+"</h3>"); $("#temp").append("<h3>°C</h3>"); $("#description").html(description); $("#icon").html( "<img src='http://openweathermap.org/img/w/" + icon + ".png' height='100' width='100'>" ); } );
}
Developer | Anukaran Kathuria |
Username | anukath |
Uploaded | September 02, 2022 |
Rating | 3 |
Size | 2,449 Kb |
Views | 26,312 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Tribute | 2,356 Kb |
Twitchtv JSON API | 1,652 Kb |
Portfolio | 4,126 Kb |
Consult-PRO | 2,529 Kb |
Wikipedia Viewer | 2,189 Kb |
Random Quote Machine | 2,826 Kb |
A Pen by Anukaran Kathuria | 4,103 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Simple blog concept | Drew_mc | 2,666 Kb |
Ionic - Wordpress REST API starter | Superpikar | 2,961 Kb |
Scroll to view if element partially out of view port height | ChrisMaki | 2,104 Kb |
Pagepilling.js | Blossk | 6,554 Kb |
DFF Website | Hawcubite | 10,123 Kb |
Fellowship of the Ring | Aussieyang | 2,639 Kb |
Twitch Live Channels | Inkblotty | 4,956 Kb |
Elephants Full screen site | Orrinward | 3,981 Kb |
CSS3 Selectables with information rollover | Jasonmayes | 9,565 Kb |
Mosaic transition effect between two photos using jQuery | Stathisg | 2,518 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!