mirror of
https://github.com/yusufipk/custom-homepage.git
synced 2026-09-11 18:46:08 +00:00
added and styled weather-fetch and card component. also applied some styling to app.css
This commit is contained in:
+2
-36
@@ -1,38 +1,4 @@
|
||||
.App {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
height: 40vmin;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #282c34;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: calc(10px + 2vmin);
|
||||
body {
|
||||
background-color: #181a1b;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
+10
-14
@@ -1,27 +1,23 @@
|
||||
import "./App.css";
|
||||
import React, { Component } from "react";
|
||||
import Time from "./components/time/time-component";
|
||||
import Forecast from "./components/fetch weather/weather-fetch";
|
||||
import Card from "./components/card/card-component";
|
||||
|
||||
class App extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
time: new Date(),
|
||||
};
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
currentTime() {
|
||||
this.setState({
|
||||
time: new Date(),
|
||||
});
|
||||
}
|
||||
componentDidMount() {
|
||||
setInterval(() => this.currentTime(), 1000);
|
||||
}
|
||||
|
||||
render() {
|
||||
const card1 = ["deneme", "deneme2"];
|
||||
return (
|
||||
<div className="App">
|
||||
<h1>{this.state.time.toLocaleTimeString()}</h1>
|
||||
<h1>
|
||||
<Time />
|
||||
</h1>
|
||||
<Forecast />
|
||||
<Card list={card1} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import "./card-style.scss";
|
||||
|
||||
const Card = (props) => {
|
||||
return (
|
||||
<div className="card">
|
||||
<ul className="list">
|
||||
{props.list.map((li) => (
|
||||
<li className="text">{li}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Card;
|
||||
@@ -0,0 +1,22 @@
|
||||
.card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 250px;
|
||||
|
||||
.list {
|
||||
margin-left: 40px;
|
||||
width: 200px;
|
||||
height: 230px;
|
||||
background-color: #242f34;
|
||||
border: 1px solid grey;
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
|
||||
.text {
|
||||
text-align: center;
|
||||
list-style: none;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
.forecast {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 700px) {
|
||||
.forecast {
|
||||
width: 60px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import React, { Component } from "react";
|
||||
import "./time-component.scss";
|
||||
|
||||
class Time extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
time: new Date(),
|
||||
};
|
||||
}
|
||||
|
||||
currentTime() {
|
||||
this.setState({
|
||||
time: new Date(),
|
||||
});
|
||||
}
|
||||
componentDidMount() {
|
||||
setInterval(() => this.currentTime(), 1000);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="clock">{this.state.time.toLocaleTimeString("en-GB")}</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Time;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
.clock {
|
||||
text-align: center;
|
||||
font-size: 90px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 700px) {
|
||||
.clock {
|
||||
font-size: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user