Skip to content

Commit

Permalink
[Chore] Beautified the appearances
Browse files Browse the repository at this point in the history
  • Loading branch information
samkahchiin committed Apr 10, 2020
1 parent a0d8390 commit 104ef53
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 48 deletions.
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@900&family=Poppins:wght@900&display=swap" rel="stylesheet">
<title>Pomodoro Clock</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
33 changes: 4 additions & 29 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}

@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);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
4 changes: 2 additions & 2 deletions src/components/Display/Display.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import classes from './Display.module.css'
const display = (props) => {
return (
<div className={classes.Display}>
<h2 id="timer-label">{props.type}</h2>
<h1 id="time-left">{props.duration}</h1>
<p id="timer-label" className={classes.TimeLabel}>{props.type}</p>
<p id="time-left" className={classes.TimeLeft}>{props.duration}</p>
</div>
)
}
Expand Down
20 changes: 18 additions & 2 deletions src/components/Display/Display.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
.Display {
display: flex;
align-items: center;
justify-content: center;
background-color: #649568;
flex-direction: column;
border-radius: 40px;
margin: 20px;
padding: 10px;
}

.Display p {
text-transform: uppercase;
margin: 3px;
}

.TimeLabel {
font-size: 40px;
}

.Display h2 {
text-transform: capitalize;
.TimeLeft {
font-size: 70px;
}
4 changes: 4 additions & 0 deletions src/components/TimeControl/TimeControl.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.TimeControl {
display: flex;
flex-direction: column;
flex-grow: 1;
margin: 0px 30px;
}

.TimeControl h1 {
Expand Down
34 changes: 21 additions & 13 deletions src/containers/ControlPanel/ControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import BreakControl from '../../components/TimeControl/BreakControl/BreakControl
import SessionControl from '../../components/TimeControl/SessionControl/SessionControl';
import Display from '../../components/Display/Display';
import MediaControl from '../../components/MediaControl/MediaControl';
import classes from './ControlPanel.module.css'

const BREAK = 'break';
const SESSION = 'session';
Expand All @@ -23,15 +24,19 @@ class ControlPanel extends Component {

increaseSessionHandler = () => {
if (this.state.sessionMins >= 60) { return };
let newMins = this.state.sessionMins + 1;
this.setState({
sessionMins: this.state.sessionMins + 1
sessionMins: newMins,
displayTime: `${newMins}:00`
});
}

decreaseSessionHandler = () => {
if (this.state.sessionMins <= 1) { return };
let newMins = this.state.sessionMins - 1;
this.setState({
sessionMins: this.state.sessionMins - 1
sessionMins: newMins,
displayTime: `${newMins}:00`
});
}

Expand Down Expand Up @@ -67,7 +72,7 @@ class ControlPanel extends Component {
}

startTimerHandler = () => {
let timer = this.state.duration;
let timer = this.state.sessionMins * 60;
let self = this;
this.setState({
isOn: true
Expand Down Expand Up @@ -111,16 +116,19 @@ class ControlPanel extends Component {
render() {
return(
<div>
<BreakControl
duration={this.state.breakMins}
increase={this.increaseBreakHandler}
decrease={this.decreaseBreakHandler}
/>
<SessionControl
duration={this.state.sessionMins}
increase={this.increaseSessionHandler}
decrease={this.decreaseSessionHandler}
/>
<h1>POMODORO CLOCK</h1>
<div className={classes.TimeControlPanel}>
<BreakControl
duration={this.state.breakMins}
increase={this.increaseBreakHandler}
decrease={this.decreaseBreakHandler}
/>
<SessionControl
duration={this.state.sessionMins}
increase={this.increaseSessionHandler}
decrease={this.decreaseSessionHandler}
/>
</div>
<Display
type={this.state.type}
duration={this.state.displayTime}/>
Expand Down
4 changes: 4 additions & 0 deletions src/containers/ControlPanel/ControlPanel.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.TimeControlPanel {
display: flex;
flex-direction: row;
}
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
Expand Down

0 comments on commit 104ef53

Please sign in to comment.