Show the Local Weather

Developer
Size
2,904 Kb
Views
8,096

How do I make an show the local weather?

What is a show the local weather? How do you make a show the local weather? This script and codes were developed by Codoer on 07 December 2022, Wednesday.

Show the Local Weather Previews

Show the Local Weather - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Show the Local Weather</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <html lang="en">
<head> <style>
</style> <meta charset="UTF-8"> <title>Random Quote Machine</title> <link rel="stylesheet" href="weatherStyle.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body> <div class="container-fluid " > <div class="row text-center general"> <div class="weather-area"> <img src="" id="weather-icon"> <div class="weather-temp-container"> <span class="weather-temp"></span> <span class="temp-icon" id="fc">&#8457</span>
<h3 class="weather-general"></h3>
<h3 id="weather-time"><h3> <h3 id="weather-day"><h3> <h3 id="weather-location"></h3> </div> </div> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script> <script src="jquery.min.js"></script> <script src="weatherScript.js"></script>
</body>
</html> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Show the Local Weather - Script Codes CSS Codes

body
{ background: url(https://static.pexels.com/photos/6498/sea-dawn-sky-sunset.jpg)
no-repeat center center fixed; color: black;
background-size: cover;
}
.weather-area{
width: 750px;
background-color:rgba(0,25,0,0.2);
margin-top: 70px;
margin-left: auto; margin-right: auto;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 30px;
color:white;
}
.weather-general{ font-size: 60px;
}
.weather-temp{ font-size: 60px;
}
.temp-icon{ font-size: 420%; cursor:pointer; color: #004396;
}
#weather-icon{ width: 5em; height: auto;
}

Show the Local Weather - Script Codes JS Codes

$.getJSON('http://ip-api.com/json', function(data){
var city=data.city;
var state=data.regionName;
var country=data.country;
var lat=data.lat;
var lon=data.lon;
var apiLink='http://api.openweathermap.org/data/2.5/weather?lat=';
var unitsId='&units=imperial&APPID=08775aee5beb80e9b38791e3421d03f2';
var day= moment().format('dddd, MMMM Do, YYYY');
//set up location and time;
$("#weather-location").text(city+", "+state+", "+country);
//setting up counting clock
//$(function() { setInterval(function(){ clocking() }, 1000);
//});
function clocking(){ //var time = moment().format('h:mm:ss A'); var date=new Date(); //var day1=date.toDateString(); var time=date.toLocaleTimeString(); $("#weather-time").text(time);
}
$("#weather-day").text(day);
$.getJSON(apiLink+data.lat+'&lon='+data.lon+unitsId,function(response){
//get weather info var des=response.weather[0].description; var icon=response.weather[0].icon; var temp=Math.round(response.main.temp); var cel=Math.round((response.main.temp-32)*5/9); //set up weather info; $(".weather-general").text(des); $("#weather-icon").attr("src","http://openweathermap.org/img/w/"+icon+".png"); $(".weather-temp").text(temp); //switching fahrenheit and celsius; $("#fc").click(function(e){ //e.preventDefault();
if($("#fc").text().charCodeAt()===8457){ $(".weather-temp").text(cel); $("#fc").html("&#8451");
}
else{ $(".weather-temp").text(temp); $("#fc").html("&#8457");
}
})
})
})
Show the Local Weather - Script Codes
Show the Local Weather - Script Codes
Home Page Home
Developer Codoer
Username c0d0er
Uploaded December 07, 2022
Rating 3
Size 2,904 Kb
Views 8,096
Do you need developer help for Show the Local Weather?

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!

Codoer (c0d0er) Script Codes
Create amazing SEO content 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!