LocalWeatherApp

Developer
Size
2,186 Kb
Views
16,192

How do I make an localweatherapp?

What is a localweatherapp? How do you make a localweatherapp? This script and codes were developed by Hong on 21 October 2022, Friday.

LocalWeatherApp Previews

LocalWeatherApp - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>LocalWeatherApp</title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container-fluid"> <div class="a text-center"> <h1>Local Weather App<h1> <h3 class="location"></h3> <h2 class="temp1"></h2> <h2 class="temp2"></h2> <h2 class="weather"></h2> <div class="icon"></div> </div>
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

LocalWeatherApp - Script Codes CSS Codes

body { background-color: #69c;
}
div.a { position: relative; top: 20px;
}

LocalWeatherApp - Script Codes JS Codes

$(document).ready(function() { $.getJSON("http://ipinfo.io", function(response) { $(".location").html(response.city + ", " + response.region + ", " + response.country); var zip = response.postal; var country = response.country; $.getJSON("http://api.openweathermap.org/data/2.5/weather?zip=" + zip + "," + country + "&APPID=4ca247b54b4eb71e942ca40585468d7d", function(json) { var K = json.main.temp; var F = Math.round((K - 273.15) * 9 / 5 + 32); var C = Math.round(K - 273.15); $(".temp1").html(JSON.stringify(F) + " °" + '<span class="unit">' + "F".fontcolor("yellow") + "</span>"); $(".temp2").html(JSON.stringify(C) + " °" + '<span class="unit">' + "C".fontcolor("yellow") + "</span>"); $(".temp2").hide(); $(".unit").click(function() { $(".temp1, .temp2").toggle(); }); $(".weather").text(json.weather[0].main); var icon=json.weather[0].icon; $(".icon").html('<img class="icon-size" src="http://openweathermap.org/img/w/'+icon+'.png">'); $(".icon-size").css("height","150px"); }); });
});
LocalWeatherApp - Script Codes
LocalWeatherApp - Script Codes
Home Page Home
Developer Hong
Username designbuildshipsoftware
Uploaded October 21, 2022
Rating 3
Size 2,186 Kb
Views 16,192
Do you need developer help for LocalWeatherApp?

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!

Hong (designbuildshipsoftware) Script Codes
Create amazing Facebook ads 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!