diff --git a/OasisDataPlatform/client/src/MetricSlider.css b/OasisDataPlatform/client/src/MetricSlider.css new file mode 100644 index 0000000..7ea2eea --- /dev/null +++ b/OasisDataPlatform/client/src/MetricSlider.css @@ -0,0 +1,85 @@ +/* +#E5E9F2 +*/ + +.holder { +} + +.metric-text { + color: #47525E; + font-family: Lato; + font-size: 24px; + font-weight: 700; + line-height: 34px; + width: 187px; + text-align: left; + float:left; + } + +.goal-text { + color: #47525E; + font-family: Lato; + font-size: 24px; + font-weight: 400; + line-height: 34px; + width: 124px; + text-align: center; + float:left; + overflow:hidden; + margin-right:142px; +} + +.bar { + background-color: #E5E9F2; + width: 407.23px; + height: 8px; + border: 1px; + float:left; + overflow:hidden; + margin-right:-20px; + margin-top:14px; +} + +.filler { + background: #8190A5; + height: 100%; + /* transition: width .2s ease-in; */ +} + +.percentage-text { + color: #47525E; + font-family: Lato; + font-size: 26px; + font-weight: 400; + line-height: 33px; + width: 124px; + float:left; + overflow:hidden; +} + +.no-check { + background-color: #FFFFFF; + border: 2px solid #8492A6; + border-radius: 100%; + width: 22px; + height: 22px; + overflow: hidden; +} + +.check { + background-color: #47525E; + border: 2px solid #47525E; + border-radius: 100%; + width: 22px; + height: 22px; + justify-content: center; + overflow: hidden; +} + + +.checkmark { + background-color: rgba(255, 255, 255, 0); + width: 11.88px; + height: 9.5px; + padding-bottom: 0px; +} diff --git a/OasisDataPlatform/client/src/MetricSlider.js b/OasisDataPlatform/client/src/MetricSlider.js new file mode 100644 index 0000000..e7db34c --- /dev/null +++ b/OasisDataPlatform/client/src/MetricSlider.js @@ -0,0 +1,76 @@ +import React, {Component} from "react"; +import "./MetricSlider.css"; +const checkImg = require("./check.png"); + +//Takes 5 arguments: title, total, current, goal, showPercents +// title is name of metric +// total is the overall number of students +// current is the number currently reached +// goal is the desired number of kids to reach +// showPercents is false to show explicit values of current/goal/total. +// it is true to show current percentage/goal percentage. + +class MetricSlider extends Component { + constructor(props) { + super(props) + + this.state = { + title: this.props.title, + current: this.props.current, + goal: this.props.goal, + total: this.props.total, + showPercents: this.props.showPercents + } + } + + render(){ + return( +
+
{this.state.title}
+ + + + +
{(this.state.current/this.state.goal*100).toFixed(0)}%
+ +
+ ) + } +} +const Bar = (props) => { + return ( +
+ +
+ ) +} +const Filler = (props) => { + return
+} + +const CheckBox = (props) => { + if(props.percentage===100) { + return (
+ check +
) + } + else { + return
+ } +} + +const GoalText = (props) => { + if(props.showPercents===true) { + return (
{(props.current/props.total*100).toFixed(0)}%/ + {(props.goal/props.total*100).toFixed(0)}%
) + } + else { + return (
{props.current}/ {props.goal}/ {props.total}
) + } +} + +export default MetricSlider; \ No newline at end of file diff --git a/OasisDataPlatform/client/src/check.png b/OasisDataPlatform/client/src/check.png new file mode 100644 index 0000000..aa0db94 Binary files /dev/null and b/OasisDataPlatform/client/src/check.png differ