Skip to content

Commit

Permalink
94 add new unitcircle exercise (#109)
Browse files Browse the repository at this point in the history
* new unit circle exercise and fix display

* add unit circle exercises (#94)

* lint fix

---------

Co-authored-by: Sanjna <[email protected]>
  • Loading branch information
rakilkim and SanjnaT41756 authored May 27, 2024
1 parent 6d9b166 commit 75b9992
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
29 changes: 24 additions & 5 deletions src/components/shared/ExerciseSide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,36 @@ ExerciseSideProps): JSX.Element {
unitCircleMarkers={[
['-90\xB0', '-45\xB0', '0\xB0', '45\xB0', '90\xB0'],
['-90\xB0', '-45\xB0', '0\xB0', '45\xB0', '90\xB0'],
['-90\xB0', '-45\xB0', '0\xB0', '45\xB0', '90\xB0'],
[
'-90\xB0',
'-60\xB0',
'-30\xB0',
'0\xB0',
'30\xB0',
'60\xB0',
'90\xB0',
],
[
'-90\xB0',
'-60\xB0',
'-30\xB0',
'0\xB0',
'30\xB0',
'60\xB0',
'90\xB0',
],
]}
unitCircleLabels={[
['A', 'C', '', 'B', ''],
['B', 'A', '', 'C', ''],
['', '', 'C', 'A', 'B'],
['', 'A', 'B', '', 'C'],
['', '', 'A', 'B', '', 'C', ''],
['', 'A', '', '', 'B', '', 'C'],
]}
directions={[
['left', 'right', '', 'right', ''],
['left', 'left', '', 'left', ''],
['', '', 'right', 'right', 'left'],
['', 'left', 'left', '', 'left'],
['', '', 'right', 'left', '', 'right', ''],
['', 'right', '', '', 'right', '', 'left'],
]}
toNextExercise={() => {
setDisplayExercise(displayExercise + 1);
Expand Down
9 changes: 4 additions & 5 deletions src/components/shared/Exercises/UnitCircleExercise.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function UnitCircleExercise({
(curAngle <= Math.PI / 2
? curAngle == Math.PI / 2
? 19 //middle
: 20 //left
: 17 //left
: 15) //right
}%`,
bottom: `${
Expand All @@ -82,7 +82,6 @@ function UnitCircleExercise({
{markers[idx]}
</div>
) : null}

<img
src={Cursor}
className="circle-cursor"
Expand All @@ -92,16 +91,16 @@ function UnitCircleExercise({
(cursorAngle <= Math.PI / 2
? cursorAngle == Math.PI / 2
? 5
: 7
: 2)
: 6
: 6)
}%`,
bottom: `${
Math.sin(cursorAngle) * 80 +
(cursorAngle <= Math.PI / 2
? cursorAngle == Math.PI / 2
? 25
: 28
: 28)
: 27)
}%`,
transform: `rotate(${cursorAngle}rad) ${
labels.length % 2 === 1 &&
Expand Down

0 comments on commit 75b9992

Please sign in to comment.