Project -Show the Local Weather
How do I make an project -show the local weather?
What is a project -show the local weather? How do you make a project -show the local weather? This script and codes were developed by Luciano Boaventura Britis on 11 January 2023, Wednesday.
Project -Show the Local Weather - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Project -Show the Local Weather</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1 class="title"> Local Weather</h1>
<div class="box">
<div class="city"></div>
<div class="temp" id="Ctemp">º<span id="scale"></span></div>
<div class="humidity"></div>
<div class="wind"></div>
<div class="condition"></div>
<div id="weather"></div>
<hr>
<div class="icon"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Project -Show the Local Weather - Script Codes CSS Codes
body { font-size: 18px; margin: 0; padding:0; width: 100%; height: 100%; background: url("https://static.pexels.com/photos/998/landscape-sky-clouds-cloudy.jpg") no-repeat; text-align:center; background-size: cover;
}
.title { font-size:2.5em; color: #00cc30; font-family: Arial; letter-spacing:03px; }
p { font-size:18px; font-color:#000000; padding: 20px 10px;
}
.icon { size:100px;
}
.box { height:330px; width:250px; background-color: #000000; border-radius:10px; border: 1px solid #ffffff; margin: 0 auto; opacity:0.6;
}
.city { padding-top: 20px; font-size:25px; color:#FFFFFF;
}
.temp{ padding-top:17px; font-size:55px; color:green; font-family:;
}
.humidity { padding-top:17px; font-size:20px; color:green;
}
.wind { padding-top:17px; font-size:20px; color:#FFFFFF;
}
.condition { padding: 17px 05px 05px; color:#FFFFFF;
}
hr { color:red;
}
.icon { margin:0 auto; height:15px;
}
Project -Show the Local Weather - Script Codes JS Codes
var apiKey = 'e04ec70a9945e11eee26dbfc2933af52';
function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; $.getJSON("http://api.openweathermap.org/data/2.5/weather?lat=" + latitude + "&lon=" + longitude + "&units=metric&appid=" + apiKey, function(data) { $(".city").html(data.name + " , " + data.sys.country); //ok $(".temp").html(Math.round(data.main.temp)+ " ºC");// ok $(".condition").html("Cloudiness: " + data.weather[0].description);// ok $(".wind").html("wind speed : "+ (data.wind.speed * 3.6).toPrecision(3) + " Km/h");// ok $(".icon").html("<img src='http://openweathermap.org/img/w/" + data.weather[0].icon + ".png'>"); //ok }); }, function error(msg){ alert('Please enable your GPS position future.'); }, { maximumAge:600000, timeout:5000, enableHighAccuracy: true }); }
};
getLocation();
Developer | Luciano Boaventura Britis |
Username | Luciano_Britis |
Uploaded | January 11, 2023 |
Rating | 3 |
Size | 2,583 Kb |
Views | 4,048 |
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 |
A Pen by Luciano Boaventura Britis | 2,290 Kb |
Project - Build a Wikipedia Viewer | 2,640 Kb |
Quotes | 5,305 Kb |
Build a Tribute Page | 3,107 Kb |
Dating Web Site Assessment | 2,476 Kb |
Example the DOM object | 1,788 Kb |
Color Guessing Game | 2,375 Kb |
Luciano_Britis | 10,654 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 |
SnappySnippet Test | Elmsoftware | 8,385 Kb |
Display properties | Hamzaerbay | 1,886 Kb |
Pagepilling.js | Blossk | 6,554 Kb |
Custom checkbox example | Capelo | 3,495 Kb |
Awesome | Samarthpd | 2,901 Kb |
Velocity.js custom stagger | Tommiehansen | 4,805 Kb |
Template | Indra_z85 | 2,323 Kb |
CSS Dynamic Width Square Div | Elleestcrimi | 2,861 Kb |
Glowing Pulse Form | Jackrugile | 2,542 Kb |
Masonry | Uriuriuriu | 5,005 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!