Weather App

Size
2,449 Kb
Views
26,312

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 Previews

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'>" ); } );
}
Weather App - Script Codes
Weather App - Script Codes
Home Page Home
Developer Anukaran Kathuria
Username anukath
Uploaded September 02, 2022
Rating 3
Size 2,449 Kb
Views 26,312
Do you need developer help for Weather App?

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!

Anukaran Kathuria (anukath) Script Codes
Create amazing video scripts with AI!

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!