-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
28,639 additions
and
28,184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
REACT_APP_RAPID_API_KEY = ee3a6cb0admshca0a7a068751ef7p11f58djsnb22efe380eb4 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,42 @@ | ||
{ | ||
"name": "my-fitness", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@testing-library/jest-dom": "^5.16.4", | ||
"@testing-library/react": "^13.3.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-router-dom": "^6.3.0", | ||
"react-scripts": "5.0.1", | ||
"web-vitals": "^2.1.4" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
"name": "my-fitness", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@testing-library/jest-dom": "^5.16.4", | ||
"@testing-library/react": "^13.3.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-horizontal-scrolling-menu": "^2.7.1", | ||
"react-loader-spinner": "^5.1.5", | ||
"react-multi-carousel": "^2.8.2", | ||
"react-router-dom": "^6.3.0", | ||
"react-scripts": "5.0.1", | ||
"web-vitals": "^2.1.4" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React, { useEffect } from 'react' | ||
import { exerciseOptions, fetchData } from '../../utils/fetChData' | ||
import './exercise.css' | ||
import ExerciseCard from './ExerciseCard' | ||
|
||
const Exercise = ({exercise, setExercise, bodyPart}) => { | ||
|
||
useEffect(() =>{ | ||
const fetchExercisesData = async () => { | ||
let exercisesData = []; | ||
if (bodyPart === 'all') { | ||
exercisesData = await fetchData("https://exercisedb.p.rapidapi.com/exercises", exerciseOptions) | ||
} else { | ||
exercisesData = await fetchData(`https://exercisedb.p.rapidapi.com/exercises/bodyPart/${bodyPart}`, exerciseOptions) | ||
} | ||
|
||
setExercise(exercisesData); | ||
} | ||
|
||
fetchExercisesData(); | ||
|
||
},[bodyPart]) | ||
|
||
return ( | ||
<div className="container"> | ||
<div className="exericse-title"> | ||
<h3>Perfect Exercises <br/>for various body Parts</h3> | ||
<p>The full monty spiffing good time no biggie cack grub fantastic. </p> | ||
</div> | ||
<div className="exercises-card"> | ||
|
||
|
||
<ExerciseCard exercise={exercise}/> | ||
|
||
|
||
|
||
</div> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
export default Exercise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
|
||
|
||
const ExerciseCard = ({exercise}) => { | ||
|
||
|
||
return ( | ||
// exercise.map((item) => ( | ||
// <div key={item.id || item} className="card" | ||
// onClick={()=>{ | ||
// // setBodyPart(bodyPart); | ||
// // window.scrollTo({top: 2000, left:100, behavior:"smooth"}) | ||
// }}> | ||
// <div className="card-container"> | ||
// <div className="card-icon"> | ||
// <img src={item.gifUrl} alt="card icon" /> | ||
// <span>1</span> | ||
// </div> | ||
// <h4 className='card-title'>{item.name}</h4> | ||
// <p className='card-desc'>Mucker plastered bugger all mate morish are.</p> | ||
// </div> | ||
// </div> | ||
|
||
// )) | ||
|
||
exercise.map((item) => ( | ||
<div key={item.id || item.name} className="exercise-card"> | ||
<div className="exercise-thumnail"> | ||
<img src={item.gifUrl} alt={item.name} /> | ||
</div> | ||
<div className="exercise-content"> | ||
<span>{item.target}</span> | ||
<h3>{item.name}</h3> | ||
</div> | ||
|
||
</div> | ||
)) | ||
) | ||
} | ||
|
||
export default ExerciseCard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.exercises-card { | ||
display: grid; | ||
grid-template-columns: repeat(3, 1fr); | ||
gap: 30px; | ||
} | ||
|
||
.exericse-title { | ||
padding-bottom: 75px; | ||
text-align: center; | ||
} | ||
|
||
.exericse-title h3 { | ||
font-size: 44px; | ||
line-height: 54px; | ||
} | ||
|
||
.exercise-card { | ||
visibility: visible; | ||
animation-duration: 3000ms; | ||
animation-delay: 200ms; | ||
animation-name: fadeInUp; | ||
-webkit-animation-duration: 1s; | ||
animation-duration: 1s; | ||
-webkit-animation-fill-mode: both; | ||
animation-fill-mode: both; | ||
margin-top: 30px; | ||
border: 1px solid #f8452d; | ||
text-align: center; | ||
box-shadow: 10px 10px 5px 0px rgba(227, 23, 23, 0.75); | ||
-webkit-box-shadow: 10px 10px 5px 0px rgba(227, 23, 23, 0.75); | ||
-moz-box-shadow: 10px 10px 5px 0px rgba(227, 23, 23, 0.75); | ||
padding: 30px; | ||
border-radius: 20px; | ||
} | ||
|
||
.exercise-thumnail { | ||
max-width: 100%; | ||
} | ||
|
||
.exercise-content h3 { | ||
font-size: 18px; | ||
font-weight: 700; | ||
padding-bottom: 8px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react' | ||
import './cards.css' | ||
import CardIcon from '../../assets/icons/1.png' | ||
|
||
const Cards = ({data,bodyPart,setBodyPart}) => { | ||
console.log(bodyPart); | ||
return ( | ||
|
||
data.map((bodyPart) => ( | ||
<div key={bodyPart.id || bodyPart} className="card" | ||
onClick={()=>{ | ||
setBodyPart(bodyPart); | ||
window.scrollTo({top: 2000, left:100, behavior:"smooth"}) | ||
}}> | ||
<div className="card-container"> | ||
<div className="card-icon"> | ||
<img src={CardIcon} alt="card icon" /> | ||
<span>1</span> | ||
</div> | ||
<h4 className='card-title'>{bodyPart}</h4> | ||
<p className='card-desc'>Mucker plastered bugger all mate morish are.</p> | ||
</div> | ||
</div> | ||
|
||
)) | ||
|
||
) | ||
} | ||
|
||
export default Cards |
Oops, something went wrong.