Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/components/Header/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
background-color: rgb(247, 247, 247);
height: 20px;
padding-bottom: 10px;
display: grid;
grid-template-columns:auto ;
grid-auto-flow: column;
grid-gap: 15px;
}
.item{
display: inline;
font-size: 12px;
padding-left: 65px;
padding-right: 60px;
}
42 changes: 42 additions & 0 deletions src/components/citytemp/CityTemp.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.cityTempSection{

padding: 0;
margin: auto;
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
justify-items: center !important;

}
h1{
margin: 0;
padding: 0;
}
h6{
margin: 0;
}



.citySection{
display: grid;
grid-template-columns: 1fr;
width: 400px;
margin:auto;
justify-items: center;
margin-top: 10px!important;
background-color: rgb(247, 247, 247);
}

.icon{
width: 105px;

}

.col-start{
justify-self: start;
}

.col-end{
justify-self: end;
}
32 changes: 19 additions & 13 deletions src/components/citytemp/CityTemp.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import React from 'react'

import "./CityTemp.css";

export default function CityTemp(props) {
return (
<div>
<h1> {props.location} </h1>
<div>
<div>
<img src={props.img}/>
</div>
<div>
<h6> {props.date}</h6>
<h6> {props.overcast}</h6>
<h6> {props.feel}</h6>

</div>
</div>
<div className="citySection">
<h1 className="cityName"> {props.location} </h1>
<div className="cityTempSection">
<div className="col-end">
<img src={props.img} className="icon"/>
</div>
<div className="col-start">

<h6> {props.date}</h6>
<h6>overcast: {props.overcast}</h6>
<h6> feels like: {props.feel}</h6>

</div>

</div>
</div>


)
}
77 changes: 47 additions & 30 deletions src/container/WeatherApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

import Header from '../components/Header/Header'
import React, { useState } from 'react';

import City from "../components/citytemp/CityTemp"
import logo from "../logo.svg";

import Location from "../components/citytemp/CityTemp"


import {Line} from 'react-chartjs-2';
let current = new Date();
let now =current.getHours();
let today = new Date();
let date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
let now =today.getHours();

const time= (afterHour) => {

Expand Down Expand Up @@ -39,34 +45,45 @@ export default function WeatherApp() {


return (
<div className="grid">
<Header rain={HeaderData.rain}
humidity={HeaderData.humidity}
wind={HeaderData.wind}
pressure={HeaderData.pressure}
dewPoint={HeaderData.dewPoint}
UVindex={HeaderData.UVindex}
visibility={HeaderData.visibility}
/>


<div className="chart">
<Line
data={state}
options={{
title:{
display:true,
text:'Average Rainfall per month',
fontSize:20
},
legend:{
display:true,
position:'right'
}
}}
/>
</div>
</div>
<div className="">
<Header
rain={HeaderData.rain}
humidity={HeaderData.humidity}
wind={HeaderData.wind}
pressure={HeaderData.pressure}
dewPoint={HeaderData.dewPoint}
UVindex={HeaderData.UVindex}
visibility={HeaderData.visibility}
/>

<City
location={"Erbil"}
img={logo}
date={date}
overcast={"25C"}
feel ={ "cold"}
/>


<div className="chart">
<Line
data={state}
options={{
title:{
display:true,
text:'Average Rainfall per month',
fontSize:20
},
legend:{
display:true,
position:'right'
}
}}
/>
</div>


</div>


)
Expand Down