Skip to content
Open
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
6 changes: 3 additions & 3 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ button {
}

#total-display {
font-size: large;
font-size: small;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great touch

}

#adders button {
background-color: yellowgreen;
background-color: yellow;
}

#controllers button {
background-color: orange;
background-color: lightblue;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love that color! looks great Ethan.

}

@keyframes App-logo-spin {
Expand Down
15 changes: 13 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { Component } from 'react';
import React, { Component } from 'react';
import './App.css';

import Die from './Die';


let counter = 0
class App extends Component {
constructor(props) {
super(props);
Expand All @@ -28,7 +30,10 @@ class App extends Component {
const dice = this.state.dice;
dice[key].value = dice[key].roll();
this.setState({dice});
}
counter ++;
return counter
}


renderDesc() {
const counts = {};
Expand Down Expand Up @@ -70,6 +75,8 @@ class App extends Component {
return this.state.dice.reduce((acc, die) => acc + die.value, 0);
}



render() {
return (
<div className="App container">
Expand All @@ -85,6 +92,7 @@ class App extends Component {
<div id="controllers">
<div id="total-display" className="row">
<div className="col-8" style={{padding: 0}}>

<button style={{float: "left"}} onClick={() => {this.setState({mod: this.state.mod - 1})}}>
-
</button>
Expand All @@ -108,6 +116,7 @@ class App extends Component {
<button className="col" onClick={() => {
while (this.state.dice.length) {
this.removeDie(0);
counter = 0;
}
this.setState({mod: 0});
}}>
Expand All @@ -117,9 +126,11 @@ class App extends Component {
const dice = this.state.dice;
dice.forEach((d) => {d.value = 0});
this.setState({dice});
counter = 0;
}}>
Reset Dice
</button>
<button> ROLLS: {counter} </button>
</div>
</div>
<div id="dicepool" className="row">
Expand Down