Skip to content

Commit

Permalink
Add score bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ihong0 committed Mar 4, 2025
1 parent 2c50c9a commit 96fd4f7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export default function EssayContainer() {
return (
<div className="essay-container">
<div className="essay-container essay-background">
<div>The score is {essayScore.toFixed(2)}</div>
<div>
<ScoreBar essayScore={essayScore} />
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import React from "react";
import "./essay.css";

export default function ScoreBar(props) {
const scale = 2;
const shift = 0;
let scaledScore = props.essayScore * scale + shift;
scaledScore = scaledScore < 0 ? 0 : scaledScore > 100 ? 100 : scaledScore;

return (
<div>The score is {props.essayScore.toFixed(2)} (Will be a bar later)</div>
<div class="score-bar">
<div class="score-bar-circle" style={{ left: scaledScore + "%" }}></div>
</div>
);
}
20 changes: 20 additions & 0 deletions website/src/components/posts/CollegeAdmissions/essay/essay.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@
border-radius: 15px;
}

.score-bar {
display: block;
height: 5px;
width: 450px;
background: white;
position: relative;
margin-top: 15px;
margin-bottom: 15px;
}

.score-bar-circle {
position: absolute;
height: 20px;
width: 20px;
border-radius: 10px;
background: black;
left: 50%;
top: -7.5px;
}

.written-essay {
margin: 2vh 0;
background-color: white;
Expand Down

0 comments on commit 96fd4f7

Please sign in to comment.