Show the Local Weather
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 - 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">℉</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("℃");
}
else{ $(".weather-temp").text(temp); $("#fc").html("℉");
}
})
})
})
Developer | Codoer |
Username | c0d0er |
Uploaded | December 07, 2022 |
Rating | 3 |
Size | 2,904 Kb |
Views | 8,096 |
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 |
React Markdown Previewer | 3,190 Kb |
Pomodoro 1 timer | 2,589 Kb |
Visualize Meteorites Map Data Across the Globe | 5,842 Kb |
React Roguelike Dungeon Crawler Game | 9,706 Kb |
React Camper Leaderboard | 5,258 Kb |
Random Quote Machine | 2,411 Kb |
Twitch TV App | 3,530 Kb |
React photo carousel | 2,500 Kb |
Visualize US GDP Data with a Bar Chart | 7,811 Kb |
Wikipedia Viewer | 2,811 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 |
Cloud upload | Jaflo | 2,774 Kb |
Infractions - Attitude | Kylie_Joseph | 7,672 Kb |
Display properties | Hamzaerbay | 1,886 Kb |
Vue.js Starter | Andymerskin | 1,268 Kb |
CSS Flip Animation | Bbodine1 | 2,525 Kb |
Countdown Timer | Massiebn | 3,001 Kb |
A Pen by Tosh | Panev | 2,586 Kb |
A Pen by Jonas Bjork | Jonasbjork | 3,115 Kb |
Impress JS Algorhytmic Generator | Jeffscottward | 7,906 Kb |
Brian The CSS Bee | Jonitrythall | 3,922 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!