Skip to content

Commit 45ca11c

Browse files
committed
first commit/added background
1 parent 26fbd49 commit 45ca11c

File tree

7 files changed

+27
-11
lines changed

7 files changed

+27
-11
lines changed

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.css

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
.App {
23
text-align: center;
34
}

src/assets/imgs/bg.jpg

327 KB
Loading

src/components/WeatherCard.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
2-
import {Card} from 'react-bootstrap';
3-
4-
const WeatherCard = ({dt, temp_min, temp_max, main, icon}) => {
2+
import { Card } from 'react-bootstrap';
3+
import classes from '../styles/WeatherCard.module.css'
4+
const WeatherCard = ({ dt, temp_min, temp_max, main, icon }) => {
55
// create a date object with Date class constructor
66
const date = new Date(dt);
77
return (
8-
<Card>
8+
<div className={classes.Card}>
99
<Card.Img
1010
variant="top"
1111
// get the src from example url and pass the icon prop for icon code
@@ -15,14 +15,18 @@ const WeatherCard = ({dt, temp_min, temp_max, main, icon}) => {
1515
<Card.Title>{main}</Card.Title>
1616
{/* datetime is received in milliseconds, let's turn into local date time */}
1717
<p>
18-
{date.toLocaleDateString()} - {date.toLocaleTimeString()}
18+
<span style={{ fontSize: '1rem', fontWeight: '500' }}>
19+
{date.toLocaleTimeString()}
20+
</span>
21+
<br />
22+
{date.toLocaleDateString()}
1923
</p>
2024
{/* minimum temperature */}
2125
<p>Min: {temp_min}</p>
2226
{/* maximum temperature */}
2327
<p>Max: {temp_max}</p>
2428
</Card.Body>
25-
</Card>
29+
</div>
2630
);
2731
};
28-
export default WeatherCard;
32+
export default WeatherCard;

src/index.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background: url('./assets/imgs/bg.jpg');
3+
}

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
33
import App from './App';
44
import 'bootstrap/dist/css/bootstrap.min.css';
55
import reportWebVitals from './reportWebVitals';
6-
6+
import './index.css'
77
ReactDOM.render(<App />,document.getElementById('root'));
88

99
// If you want to start measuring performance in your app, pass a function

src/styles/WeatherCard.module.css

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.Card {
2+
background: rgba(255, 255, 255, 0.226);
3+
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
4+
backdrop-filter: blur(0px);
5+
-webkit-backdrop-filter: blur(0px);
6+
border-radius: 10px;
7+
border: 1px solid rgba(0, 0, 0, 0.18);
8+
}

0 commit comments

Comments
 (0)