Weather Application
How do I make an weather application?
The Application gathers your location and shows the weather.. What is a weather application? How do you make a weather application? This script and codes were developed by Kartikeya Gupta on 22 November 2022, Tuesday.
Weather Application - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Weather Application</title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <html lang="en">
<head> <meta charset="UFT-8"> <title>Weather Application</title>
</head>
<body>
<div class='container-fluid'> <div class='row'> <div class='com-md-12'><h1>Your current Weather Status</h1><br /><h3>Change to http:// if not working.</h3></div> <div class='col-md-4 col-sm-12 col-xs-12'> <h2>Geo-Coordinates</h2> <div class='well'>Latitude:<span id='lat'></span></div> <div class='well'>Longitude:<span id='lon'></span></div> </div> <div class='col-md-4 cen col-sm-12 col-xs-12'> <h2>Location</h2> <div class='btn btn-primary btn-lg'><i class="fa fa-map-marker" aria-hidden="true"></i> <span id='city'></span></div> <div class='btn btn-primary btn-lg'><i class="fa fa-globe" aria-hidden="true"></i> <span id='country'></span></div> </div> <div class='col-md-4 cen col-sm-12 col-xs-12'> <h2>Weather</h2> <button class='btn btn-success btn-lg change'><i class="fa fa-check-square-o" aria-hidden="true"></i> C<span id='tempinc'></span></button><span class='btn' id='icon'></span> <div class='btn btn-info btn-lg'><span id='more'></span></div> </div>
</div> <h3>Design and Coded by <a href="https://www.facebook.com/kartikeya100" target=_blank>Kartikeya Gupta</a></h3>
</body>
</html> <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Weather Application - Script Codes CSS Codes
@import 'https://fonts.googleapis.com/css?family=Inconsolata';
html,body{ height:100%;
}
body{ background: -webkit-linear-gradient(black, #EBEBEB); background: -o-linear-gradient(black, #EBEBEB); background: -moz-linear-gradient(black, #EBEBEB); background: linear-gradient(black, #EBEBEB);
}
h1,h2,h3{ color: #f0f0f0; text-align: center; font-family: 'Inconsolata', monospace; margin-top: 50px;
}
.cen{ text-align: center;
}
Weather Application - Script Codes JS Codes
$(document).ready(function(){
var lat;
var lon;
var city;
var country;
var tempc;
var tempf;
var condition;
var icon;
if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { $("#lat").html(position.coords.latitude); $("#lon").html(position.coords.longitude); lon = position.coords.longitude; lat = position.coords.latitude; var link = 'https://api.apixu.com/v1/current.json?key=3965ee6e84ec4f3a848211319161209&q='+lat+','+lon;
$.getJSON(link,function(data){ //weather api tempc = data.current.temp_c; tempf = data.current.temp_f; city = data.location.name; country = data.location.country; condition = data.current.condition.text; icon = data.current.icon; $('#tempinc').html(tempc); $('#tempinf').html(tempf); $('#city').html(city); $('#country').html(country); $('#more').html(condition); $('#icon').html("<img class='img-responsive' src=http://cdn.apixu.com/weather/64x64/night/143.png>");
});
});
};
});
Developer | Kartikeya Gupta |
Username | kartikeya100 |
Uploaded | November 22, 2022 |
Rating | 3 |
Size | 2,720 Kb |
Views | 26,312 |
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 |
Random Quote Generator Machine | 3,011 Kb |
Javascript Calculator | 2,701 Kb |
Portfolio 2 | 4,341 Kb |
My Portfolio | 5,127 Kb |
Tribute Page | 3,799 Kb |
Tic Tac Toe | 3,593 Kb |
Twitch TV | 3,103 Kb |
Pomodoro clock | 2,825 Kb |
Wikipedia Viewer | 3,055 Kb |
Parallax effect | 2,849 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 |
Two column of responsive height | Fixie | 2,908 Kb |
Wikipedia API | Coderpilot | 2,802 Kb |
Price Comparison Table | Orrinward | 3,459 Kb |
Nice textured background | Hans | 2,659 Kb |
Adding Items | Valhead | 4,008 Kb |
IE flex collapse bug fix | Rowno | 2,678 Kb |
Perspective Origin Demo | Agelber | 3,614 Kb |
Hello People | Danburrows | 2,365 Kb |
Break Out | AzazelN28 | 12,431 Kb |
Google Fonts Sass Mixin | HugoGiraudel | 4,237 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!