diff --git a/chrome_biiJhomyx0.png b/chrome_biiJhomyx0.png new file mode 100644 index 0000000..5def781 Binary files /dev/null and b/chrome_biiJhomyx0.png differ diff --git a/ui.html b/ui.html new file mode 100644 index 0000000..5cf0a52 --- /dev/null +++ b/ui.html @@ -0,0 +1,96 @@ + + + + UI + + + +
+ +
+ + + +
+ Don't have an account? Sign Up +
+ + + + + + \ No newline at end of file diff --git a/weather.css b/weather.css new file mode 100644 index 0000000..1fe4efb --- /dev/null +++ b/weather.css @@ -0,0 +1,127 @@ +*{ + padding:0px; + margin:0px; +} +body{ + font-family: 'Oswald',sans-seriff; + background-image: url('https://github.com/Subhash2807/test1/blob/master/ian-tuck-lieECYO-yTo-unsplash.jpg?raw=true'); + background-attachment: fixed; + background-position: center; + background-repeat: no-repeat; + background-size: cover; + background-color:rgba(170, 183, 197, 0.959); + +} + +@media screen and (min-width: 500px){ +#WeatherContent { + + height: 500px; + width :400px; + background-color:#769BBE; + position:absolute; + left:50%; + top:50%; + transform: translate(-50%,-50%); + border-radius:50px; + box-shadow: 12px 12px 15px #444141; + font-size: 20px; + + +} +input{ + height:30px; + width:300px; + /* border-radius:20px; */ + background:transparent; + border:0px; + outline:0px; + border-bottom:3px solid rgba(1,1,11,1); + text-align: center; + font-size: 25px; +} +::placeholder{ +color:black; +font-size:20px; +text-align: center; +} +#dis{ +padding-top:50px; + +} +button{ + margin-top:30px; + height:40px; + width:120px; + font-size:20px; + border-radius: 12px; + border:0; + box-shadow: 3px 3px 3px rgba(1,1,11,1); + outline:none; +} + +} +@media screen and (max-width: 500px) +{ + +#WeatherContent { + + height: 300px; + width :200px; + background-color:#769BBE; + position:absolute; + left:50%; + top:50%; + transform: translate(-50%,-50%); + border-radius:25px; + box-shadow: 6px 6px 8px #444141; + font-size: 20px; + + + +} +input{ + + height:15px; + width:150px; + /* border-radius:20px; */ + background:transparent; + border:0px; + outline:0px; + border-bottom:1.5px solid rgb(28, 32, 39); + text-align: center; + font-size: 12px; + margin-top:-12px; +} +::placeholder{ +color:black; +font-size:10px; +text-align: center; +/* font-weight: ; */ +} +#dis{ +padding-top:50px; + +} +button{ + margin-top:15px; + height:20px; + width:60px; + font-size:10px; + border-radius: 6px; + border:0; + box-shadow: 1.5px 1.5px 1.5px rgba(1,1,11,1); + outline:none; + margin-top:25px +} +#temp{ + font-size:13px; +} +img{ + height: 50px; +} +#dis{ + font-size:12.5px; + margin-top:-15px; +} +} diff --git a/weather.html b/weather.html new file mode 100644 index 0000000..0fb98e6 --- /dev/null +++ b/weather.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + Weather app using api. + + + + +
+
+

WEATHER APPLICATION

+
+ +

+ +
+
+ + \ No newline at end of file diff --git a/weather.js b/weather.js new file mode 100644 index 0000000..8a75ea6 --- /dev/null +++ b/weather.js @@ -0,0 +1,45 @@ +function weathr(){ + + var city1 = document.getElementById('city').value; + var link_api='http://api.openweathermap.org/data/2.5/weather?q='+city1+'&appid=e8cde246c8e175455f7354975fd34a4a&units=metric'; + fetch(link_api) + .then( + function(valu) { + if (valu.status !== 200) { + document.getElementById('temp').innerHTML='
Please enter correct city'; + return; + } + +valu.json().then(function(data) { +document.getElementById('temp').innerHTML='

City : ' + city1 + '

Temperature : '+ (data.main.temp) + '℃

Humidity : '+data.main.humidity+'%

'; +document.getElementById('img').src='https://raw.githubusercontent.com/Subhash2807/Weather-App-JavaScript/master/icons/' + data.weather[0].icon+'.png'; +// imge(data.weather[0].main); +}); +} +) +; +} + +function defult(){ + + var link_api='http://api.openweathermap.org/data/2.5/weather?q=lucknow&appid=e8cde246c8e175455f7354975fd34a4a&units=metric'; + fetch(link_api) + .then( + function(valu) { + +valu.json().then(function(data) { +document.getElementById('temp').innerHTML='

City : Lucknow

Temperature : '+ Math.floor(data.main.temp) +'℃

Humidity : '+data.main.humidity+' %

'; +document.getElementById('img').src='https://raw.githubusercontent.com/Subhash2807/Weather-App-JavaScript/master/icons/' + data.weather[0].icon+'.png'; +imge(data.weather[0].main); + +}); +} +) +.catch(function(err) { +console.log('Fetch Error :-S', err); +}); +} + + + +