Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/script.js #414

Open
wants to merge 250 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
1431243
Create pull_request_template.md
AshleeAubree Mar 25, 2023
e3af331
Merge pull request #1 from AshleeAWebb/AshleeAWebb-pull-request-template
Adam-Meza Mar 25, 2023
1b93061
Initial commit
Pma913 Mar 27, 2023
75a44ac
Update user file names
Pma913 Mar 27, 2023
a103610
build basic HTML
Adam-Meza Mar 27, 2023
4db9837
Update file link in User-test
Pma913 Mar 27, 2023
2fd02ac
Initial commit
Pma913 Mar 27, 2023
1e7ccbd
Merge pull request #26 from AshleeAWebb/feature/html.index-basic-html
AshleeAubree Mar 27, 2023
c427a39
Update name for test data files and add test data to the files
Pma913 Mar 27, 2023
49e9685
Merge pull request #27 from AshleeAWebb/edit/create-files
AshleeAubree Mar 27, 2023
bedf117
Create pull_request_template.md
AshleeAubree Mar 27, 2023
db837ef
Delete docs/.github/PULL_REQUEST_TEMPLATE directory
AshleeAubree Mar 27, 2023
f8ff3c7
EDIT: Add check boxes to markdown file and establish the pull request…
AshleeAubree Mar 27, 2023
482bb46
Merge pull request #28 from AshleeAWebb/edit/pull_request_template.md…
brendel-r Mar 27, 2023
01042dd
Link css and html together
brendel-r Mar 27, 2023
3a9fb0d
Merge pull request #29 from AshleeAWebb/feature/index.html-css-link-t…
AshleeAubree Mar 27, 2023
391a74a
FIX: fix location of index.html and link css
AshleeAubree Mar 27, 2023
ac763df
Merge pull request #31 from AshleeAWebb/fix/index.html-update-locatio…
Adam-Meza Mar 27, 2023
1fc1041
made activity data
Adam-Meza Mar 27, 2023
3a7de63
Merge branch 'main' into feature/activity-test-
Pma913 Mar 27, 2023
5ccab78
Merge pull request #32 from AshleeAWebb/feature/activity-test-
Pma913 Mar 27, 2023
1924043
begin user-test
Adam-Meza Mar 27, 2023
8b46530
Merge pull request #33 from AshleeAWebb/feature/user-test.js-test
AshleeAubree Mar 27, 2023
2771bec
Feat: Update hydration-test-data to have multiple dates and a single …
AshleeAubree Mar 27, 2023
02de356
Feat: Update Hydration class to export for testing
AshleeAubree Mar 27, 2023
2c5ccc2
Feat: Add new data set for single user
AshleeAubree Mar 28, 2023
7031c13
Initial commit
Pma913 Mar 28, 2023
e013ab3
Complete a test suit for the Sleep class constructor
Pma913 Mar 28, 2023
4b5a87f
Merge pull request #34 from AshleeAWebb/feature/Hydration-test.js-bui…
Adam-Meza Mar 28, 2023
fb9a4ba
Build alot of the User-test
Adam-Meza Mar 28, 2023
d52ef06
Merge branch 'main' into feature/user-test.js-test
Adam-Meza Mar 28, 2023
227bda0
Finish User-test.js
Adam-Meza Mar 28, 2023
9fd8b45
Merge pull request #35 from AshleeAWebb/feature/sleep-test
Adam-Meza Mar 28, 2023
e9dcd32
Merge branch 'main' into feature/user-test.js-test
Adam-Meza Mar 28, 2023
62eca1d
Finish User-test.js
Adam-Meza Mar 28, 2023
280f206
Merge pull request #36 from AshleeAWebb/feature/user-test.js-test
Pma913 Mar 28, 2023
c40fe3c
Feat: Add test to Hydration Class
AshleeAubree Mar 28, 2023
d33cc8b
refactor user tests
Adam-Meza Mar 28, 2023
fcb8291
Merge branch 'main' into feature/user-test.js-test
Adam-Meza Mar 28, 2023
d97563c
edited file path
Adam-Meza Mar 28, 2023
e262102
change file paths
Adam-Meza Mar 28, 2023
20b6750
refactor
Adam-Meza Mar 28, 2023
a68100a
Merge pull request #37 from AshleeAWebb/feature/Hydration-test.js-bui…
Pma913 Mar 28, 2023
88e7332
test
Adam-Meza Mar 28, 2023
fedf6be
Merge pull request #39 from AshleeAWebb/feature/user-test.js-test
Pma913 Mar 28, 2023
7988ab6
Add temp logos
brendel-r Mar 28, 2023
f9fcd92
Change organization in index.html
brendel-r Mar 28, 2023
af010be
made User Class and updated user-test
Adam-Meza Mar 28, 2023
318907b
Merge pull request #41 from AshleeAWebb/feature/user.js-class
AshleeAubree Mar 28, 2023
4f410e7
add psuedocode for activity-test
Adam-Meza Mar 28, 2023
376c18a
Refactor: Add happy and sad testing to all methods, removed test for …
AshleeAubree Mar 28, 2023
b7c01e4
Merge pull request #43 from AshleeAWebb/refactor/Hydration-test.js
Pma913 Mar 28, 2023
53820ab
Merge pull request #42 from AshleeAWebb/feature/user.js-class
Pma913 Mar 28, 2023
e0e91ed
finish sleep class
Adam-Meza Mar 28, 2023
168e66c
Merge pull request #44 from AshleeAWebb/feature/user.js-class
AshleeAubree Mar 28, 2023
c72c4d5
Update user class to pass all test except to check for other classes
Pma913 Mar 29, 2023
6a0a139
Move variable declarations out of the beforeEach and comment out some…
Pma913 Mar 29, 2023
56ccb8d
Feat: Add functionality to Hydration class all test passing
AshleeAubree Mar 29, 2023
2d00342
Add an argument to getFriends and to getAverage
Pma913 Mar 29, 2023
051029d
Add parameters to getFriends and getAverage to make more dynamic
Pma913 Mar 29, 2023
a193565
Refactor and comment out code to be able to run tests with current st…
Pma913 Mar 29, 2023
f266ad4
Add basic CSS layout
brendel-r Mar 29, 2023
18e71e0
Merge pull request #45 from AshleeAWebb/feature/Hydration.js-add-func…
Adam-Meza Mar 29, 2023
b17b737
Merge pull request #46 from AshleeAWebb/feature/UserClass
Adam-Meza Mar 29, 2023
bc306f2
Fix merge conflict
brendel-r Mar 29, 2023
8866130
Merge pull request #48 from AshleeAWebb/feature/styles.css-basic-layout
Adam-Meza Mar 29, 2023
3852876
Remove commented out code
Pma913 Mar 29, 2023
cb6696a
Enable hydration interaction
Pma913 Mar 29, 2023
2fa103a
Remove placeholder class
Pma913 Mar 29, 2023
a70dbba
Merge pull request #49 from AshleeAWebb/feature/UserClass
AshleeAubree Mar 29, 2023
680768e
Updating Date manipulation in Hydration Class
Adam-Meza Mar 29, 2023
0b98a2a
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Adam-Meza Mar 29, 2023
d993be6
Merge pull request #50 from AshleeAWebb/fix/hydration.js-date
Pma913 Mar 29, 2023
568422e
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Adam-Meza Mar 29, 2023
83cdb00
begin CSS refactor
Adam-Meza Mar 29, 2023
48b8adb
Merge pull request #51 from AshleeAWebb/refactor/css.js
AshleeAubree Mar 29, 2023
63bff6a
Feat:Add user info to DOM reformatted name and info to fit in user in…
AshleeAubree Mar 30, 2023
f4017bb
Feat: Add Sleep Info to Dom
AshleeAubree Mar 30, 2023
2d5c6d1
Merge pull request #52 from AshleeAWebb/feature/scripts.js-functional…
Pma913 Mar 30, 2023
4d9c0cc
Update id names to be able to query select elements
Pma913 Mar 30, 2023
df00bfb
Achieve MVP for displaying hydration data to the dom
Pma913 Mar 30, 2023
df17698
Remove unwanted code
Pma913 Mar 30, 2023
690d92e
Merge pull request #53 from AshleeAWebb/feature/script-build
AshleeAubree Mar 30, 2023
e71ff26
refactor script.js to make more dynamic
Adam-Meza Mar 30, 2023
6591ed4
Feat: Add more dynamic testing data
AshleeAubree Mar 30, 2023
962d36f
Feat: Add more dynamic testing data and update Sleep test results
AshleeAubree Mar 30, 2023
39c2cfe
Merge pull request #60 from AshleeAWebb/feature/script.js-filter
AshleeAubree Mar 30, 2023
3b77ee5
Update readme to rough draft
Pma913 Mar 30, 2023
ca3c805
Merge pull request #62 from AshleeAWebb/feature/sleep-test-data-update
Pma913 Mar 30, 2023
151658b
Merge pull request #63 from AshleeAWebb/edit/readme
AshleeAubree Mar 30, 2023
781ad93
finish activity test and class
Adam-Meza Mar 30, 2023
dad7163
Merge pull request #64 from AshleeAWebb/feature/script.js-filter
Pma913 Mar 30, 2023
219fd6b
Update to test for invalid data
Pma913 Mar 30, 2023
61787c7
Update to test for invalid data
Pma913 Mar 30, 2023
1405787
Update to pass sleep test
Pma913 Mar 30, 2023
bed500c
Update getAverage method for sad path
Pma913 Mar 30, 2023
e231687
Update to test for sad path with getAverage method
Pma913 Mar 30, 2023
9051010
Feat: Add updates to activity info of the scripts.js, index.html.
AshleeAubree Mar 30, 2023
20b6c92
Pass test for activity data
Pma913 Mar 30, 2023
4a3bba2
Merge pull request #65 from AshleeAWebb/edit/usertest
Adam-Meza Mar 30, 2023
e76c0bb
Merge pull request #66 from AshleeAWebb/feature/scripts.js-activity-info
Adam-Meza Mar 30, 2023
54fb60d
Merge pull request #67 from AshleeAWebb/edit/sleeptest
Adam-Meza Mar 30, 2023
73aaa4d
Update README.md
Pma913 Mar 30, 2023
284e251
Feat: Add export and import to script
AshleeAubree Mar 30, 2023
f42631b
Merge pull request #68 from AshleeAWebb/feature/fetch-user
Adam-Meza Mar 30, 2023
c35dbf0
Update stepCount method
Pma913 Mar 31, 2023
2061ed3
Move dom manipulation back to script
Pma913 Mar 31, 2023
f6ac5c3
Get fetch to work for all four data types and display three of them t…
Pma913 Mar 31, 2023
2804b34
Merge pull request #70 from AshleeAWebb/feature/fetchapi
AshleeAubree Mar 31, 2023
4c3d52d
fix API bug, refactor fetch calls
Adam-Meza Mar 31, 2023
a6ee179
fininish API fetch functionality
Adam-Meza Mar 31, 2023
0231794
Merge pull request #71 from AshleeAWebb/fix/script.js-activity
AshleeAubree Mar 31, 2023
0989114
refactor: Updating testing hydration class, and verifed that day, avg…
AshleeAubree Mar 31, 2023
7b9b9e7
Merge pull request #72 from AshleeAWebb/refactor/hydration-class-and-…
Pma913 Mar 31, 2023
bdb452f
Refactor: Additional refactoring add flasey statements and dry up test
AshleeAubree Mar 31, 2023
e41c2bc
Merge pull request #73 from AshleeAWebb/refactor/hydration-class-and-…
Adam-Meza Mar 31, 2023
5e5979e
fix missing dom info on activity and mirror consistent presentation i…
AshleeAubree Mar 31, 2023
865d4d7
Merge pull request #74 from AshleeAWebb/refactor/activity-dom-fix
Adam-Meza Mar 31, 2023
dcd128c
add chart
Adam-Meza Apr 2, 2023
e54f044
Merge pull request #75 from AshleeAWebb/feature/script.js-chart.s
AshleeAubree Apr 2, 2023
5c463f8
Refactor: Add updated syntax and dry up scripts.js
AshleeAubree Apr 2, 2023
0ef3041
refactor: Update Activity Class refactoring"
AshleeAubree Apr 2, 2023
75717dd
Remove js class names:
Pma913 Apr 2, 2023
3e311f3
Refactor: Add proper syntax to the apiCalls, User, Sleep
AshleeAubree Apr 2, 2023
a014edb
refactor: Clean up the hydration class and test
AshleeAubree Apr 2, 2023
248831c
Update README.md
Pma913 Apr 2, 2023
4924138
Merge pull request #76 from AshleeAWebb/refactor/dry-and-syntax-cleanup
Adam-Meza Apr 2, 2023
7e24644
Merge branch 'main' of github.com:AshleeAWebb/fitlit into edit/refactor
Pma913 Apr 2, 2023
96e058b
Merge pull request #77 from AshleeAWebb/edit/refactor
Adam-Meza Apr 2, 2023
86c4b42
refactor activity, activity test, and script.js to add charts
Adam-Meza Apr 2, 2023
985826d
feat: Add graphics, and refactor css
AshleeAubree Apr 2, 2023
4097958
Update HTML
AshleeAubree Apr 2, 2023
f1dd465
Merge pull request #78 from AshleeAWebb/refactor/all
AshleeAubree Apr 2, 2023
f8d66f1
Merge pull request #79 from AshleeAWebb/feature/add-graphics
Pma913 Apr 2, 2023
94f5ec8
Remove dimensions on chart
Pma913 Apr 3, 2023
c5f0b90
Update @media selector to change page layout to fit alternative scree…
Pma913 Apr 3, 2023
6abb176
Revert canvas sizing in html element to its original specs
Pma913 Apr 3, 2023
679319b
Change justify-content value in header, section vw changed to 100
Pma913 Apr 3, 2023
af5b1c4
Remove arbitrary property and some white space
Pma913 Apr 3, 2023
ae65d5b
refactored script so the user class holds all the data
Adam-Meza Apr 3, 2023
2b58c6e
random little stuff
Adam-Meza Apr 3, 2023
b9a6275
Merge pull request #80 from AshleeAWebb/refactor/script.js-userClass
Pma913 Apr 3, 2023
86ce0d3
Update README.md
Pma913 Apr 3, 2023
e44ea80
Merge pull request #81 from AshleeAWebb/edit/refactor
AshleeAubree Apr 3, 2023
b6282a3
Fix: Add sad testing data to beforeEach of Hydration test
AshleeAubree Apr 10, 2023
77041fb
Merge pull request #93 from AshleeAWebb/fix/update-hydration-testing-…
brendel-r Apr 10, 2023
483487d
Implement local host api urls into apiCalls.js file and remove the ap…
Pma913 Apr 10, 2023
403bd98
Replace the urls within our fetchAllData function in the apiCalls fil…
Pma913 Apr 10, 2023
ba4887f
Feat: Add form to the activity class
AshleeAubree Apr 10, 2023
753b52b
Feat: Add querySelectors and eventListners for the User Input Form
AshleeAubree Apr 10, 2023
1287558
Merge pull request #95 from AshleeAWebb/edit/refactor
AshleeAubree Apr 11, 2023
ae62231
Feat: Update sytax error
AshleeAubree Apr 11, 2023
7b76ea2
Feat: Add reset to form upon submission
AshleeAubree Apr 11, 2023
9ebba0a
Merge pull request #96 from AshleeAWebb/feature/add-activity-form-for…
Pma913 Apr 11, 2023
90b3dca
Add postActivityData function that will handle the fetch request to p…
Pma913 Apr 11, 2023
869c632
Call postActivityData within our callback function for our activity f…
Pma913 Apr 11, 2023
bc09234
Remove non essential console.log
Pma913 Apr 11, 2023
fc16ccb
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Pma913 Apr 11, 2023
86d1490
Merge pull request #98 from AshleeAWebb/feature/post-activity
AshleeAubree Apr 11, 2023
d59adc0
refactor css
Adam-Meza Apr 11, 2023
38cce62
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Pma913 Apr 11, 2023
57c7799
update CSS
Adam-Meza Apr 11, 2023
0caf57b
Minor Syntax fixes
Adam-Meza Apr 11, 2023
6feb0ad
Merge pull request #99 from AshleeAWebb/refactor/styles.css
AshleeAubree Apr 11, 2023
bcc8fb4
Remove id input from form
Pma913 Apr 11, 2023
81ac744
Automatically add users ID when submitting information. Add logic to …
Pma913 Apr 11, 2023
81f58d1
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Pma913 Apr 11, 2023
c5af1c8
Settle merge conflicts
Pma913 Apr 11, 2023
da9e228
comment out unused code
Pma913 Apr 11, 2023
9f92b9c
Merge pull request #100 from AshleeAWebb/feature/disable-form-button
AshleeAubree Apr 11, 2023
734f0b6
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Pma913 Apr 11, 2023
acfcf7f
Feat: Add functionality to the modal for user input
AshleeAubree Apr 11, 2023
818b109
Merge pull request #101 from AshleeAWebb/feature/modal-for-user-data-…
Adam-Meza Apr 11, 2023
44c4943
Add functionality to get step challenge stats
brendel-r Apr 12, 2023
0d7bb56
Delete unneeded code
brendel-r Apr 12, 2023
faec70a
Merge pull request #102 from AshleeAWebb/feature/scrips.js-step-chall…
Adam-Meza Apr 12, 2023
b62b883
hard code challenge chart functionality
Adam-Meza Apr 12, 2023
1274e7b
Merge pull request #103 from AshleeAWebb/feature/chart.js-challenge-c…
Pma913 Apr 12, 2023
9eeed0b
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Pma913 Apr 12, 2023
757764a
Feat: Add style to modal, form, and stylistic changes to info boxes
AshleeAubree Apr 12, 2023
4f8f2d9
Merge branch 'main' into feature/css-redesign-add-style-to-modal
Adam-Meza Apr 12, 2023
d193447
Merge pull request #104 from AshleeAWebb/feature/css-redesign-add-sty…
Adam-Meza Apr 12, 2023
702d0ca
Feat: Update the format, and add hover to buttons
AshleeAubree Apr 12, 2023
67770c3
Update getStepChallengeStats to return an object and also made this f…
Pma913 Apr 12, 2023
9254f6f
Feat: Add new logo
AshleeAubree Apr 12, 2023
ba67af6
Add background gradient
AshleeAubree Apr 12, 2023
1c3a0fb
Merge pull request #105 from AshleeAWebb/feature/css-activity-widget-…
Adam-Meza Apr 12, 2023
d03a627
Remove commented out code
Pma913 Apr 12, 2023
7869611
Merge pull request #106 from AshleeAWebb/feature/step-challenge
AshleeAubree Apr 12, 2023
a601f48
Update header heirarchy and change innerHTML to li's for accessability
AshleeAubree Apr 12, 2023
50c4d0b
Update createFrieds function to instanciate with the correct data
Pma913 Apr 12, 2023
71385f2
Update labels of all forms to match accessibility standards
AshleeAubree Apr 12, 2023
4c38a34
Update the createFriends function to instanciate friends with the cor…
Pma913 Apr 12, 2023
e0c77bd
Add ul's to the li's for read over
AshleeAubree Apr 12, 2023
7c18f30
add update to ui for styling
AshleeAubree Apr 12, 2023
c9572cc
Merge pull request #107 from AshleeAWebb/feature/improve-accessability
Pma913 Apr 12, 2023
041f26b
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Pma913 Apr 12, 2023
ed2d30b
Merge pull request #108 from AshleeAWebb/feature/step-challenge
AshleeAubree Apr 12, 2023
7021957
tweaked input form and headers
Adam-Meza Apr 12, 2023
5c94766
small change
Adam-Meza Apr 12, 2023
9e0bbce
remove console log
Adam-Meza Apr 12, 2023
2415109
Merge branch 'main' into asthetics/styles.css
AshleeAubree Apr 12, 2023
98a9419
Merge pull request #109 from AshleeAWebb/asthetics/styles.css
AshleeAubree Apr 12, 2023
6312c96
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Pma913 Apr 12, 2023
679a5b2
Add tabIndex so that voice reader will read all the elements on the page
AshleeAubree Apr 12, 2023
d00c780
Add spacing and missing semicolons
brendel-r Apr 13, 2023
8fb10b8
Add missing semicolons and spacing to all other files
brendel-r Apr 13, 2023
7725e1d
Merge pull request #110 from AshleeAWebb/feature/add-tab-index-for-vo…
Adam-Meza Apr 13, 2023
96d0328
Merge pull request #111 from AshleeAWebb/fix/scripts.js-clean-up-code
Adam-Meza Apr 13, 2023
74e3a84
converted css to scss
Adam-Meza Apr 13, 2023
344bfba
Merge pull request #112 from AshleeAWebb/refactor/styles.css-scss
AshleeAubree Apr 13, 2023
1661d86
Merge branch 'main' of github.com:AshleeAWebb/fitlit
Pma913 Apr 13, 2023
1b8178e
Add a return for our fetch POST
Pma913 Apr 13, 2023
04db7fd
Add then method to postActivityData and catch method to post and get …
Pma913 Apr 13, 2023
7905f79
Update POST function to convert date iput to the same format as the d…
Pma913 Apr 13, 2023
502d6ec
Add new function to GET only activity data
Pma913 Apr 13, 2023
7a3372c
Update user class whith the updated data when a new form has been sub…
Pma913 Apr 13, 2023
02d855b
Add a charts array and push a new instance of a chart whenever one is…
Pma913 Apr 13, 2023
d7f0855
refactor chart and random stuff in script.js
Adam-Meza Apr 13, 2023
c498389
Update user activity class whenever a new set of activity data is pos…
Pma913 Apr 13, 2023
e5a5e69
Updated accessibility items such as visibility of font, and charts, a…
AshleeAubree Apr 13, 2023
05c23f0
Merge pull request #113 from AshleeAWebb/fix/script.js-input
AshleeAubree Apr 13, 2023
05910f1
Rename userObj to just obj to remove bad naming practice, also remove…
Pma913 Apr 13, 2023
3faafb5
Rename userList to users to avoid bad naming practice
Pma913 Apr 13, 2023
2ee885c
Merge branch 'main' into feature/fetch-catch
AshleeAubree Apr 13, 2023
414d18a
Merge pull request #114 from AshleeAWebb/feature/visability-tab-and-a…
Pma913 Apr 13, 2023
e1ac1df
Merge branch 'main' into feature/fetch-catch
AshleeAubree Apr 13, 2023
cbf2de9
Merge pull request #115 from AshleeAWebb/feature/fetch-catch
AshleeAubree Apr 13, 2023
4066b2c
fix missing } on line 133
AshleeAubree Apr 13, 2023
fb853a3
fix missing } on line 133
AshleeAubree Apr 13, 2023
e387c29
Merge pull request #116 from AshleeAWebb/bug-fix-line-133-scripts.js
Adam-Meza Apr 13, 2023
8ce488c
Update the date format to match data on servers
Pma913 Apr 14, 2023
235611c
Remove unwanted console.logs
Pma913 Apr 14, 2023
bf68d3b
Merge pull request #117 from AshleeAWebb/edit/refactor-post
Adam-Meza Apr 14, 2023
22c60e3
Update README.md
Adam-Meza Apr 14, 2023
9e77f38
Update README.md
Adam-Meza Apr 14, 2023
cb9a66f
Update README.md
Adam-Meza Apr 14, 2023
495f7ee
Create index.html
AshleeAubree Apr 14, 2023
a8ad2a7
Delete index.html
AshleeAubree Apr 14, 2023
420d4d7
feat: Adds aria labels describing charts
AshleeAubree Apr 14, 2023
f9202b4
Merge pull request #118 from AshleeAWebb/feature/add-aria-labels-to-c…
Adam-Meza Apr 14, 2023
9bf7ede
Update README.md
AshleeAubree Apr 14, 2023
508b462
Update README.md
AshleeAubree Apr 14, 2023
0f0407c
Remove overflow class of hidden on first user-main selector
Pma913 Apr 14, 2023
e8095af
Remove individual selectors for form inputs and replace with querySel…
Pma913 Apr 14, 2023
58f29ed
Merge pull request #120 from AshleeAWebb/edit/refactor-query
Adam-Meza Apr 14, 2023
23b388b
DRY up code
Adam-Meza Apr 14, 2023
1ab6e47
refactor scripts.js
Adam-Meza Apr 14, 2023
5284b47
refactor script.js
Adam-Meza Apr 14, 2023
e2a2846
Merge branch 'main' into refactor/script.js
Pma913 Apr 14, 2023
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
38 changes: 38 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Checklist:

Necessary checkmarks:

- [] All Tests are Passing

Type of change

- [] New feature
- [] Bug Fix

Implements/Fixes:

description closes #

Check the correct boxes

- [] This broke nothing
- [] This broke some stuff
- [] This broke everything

Testing Changes

- [] No Tests have been changed
- [] Some Tests have been changed
- [] All of the Tests have been changed(Please describe what in the world happened)

Checklist:

- [] My code has no unused/commented out code
- [] I have reviewed my code
- [] I have commented my code, particularly in hard-to-understand areas
- [] I have fully tested my code
- [] I have added one or more people as "Reviewers" to review & merge

(For Fun!)Please Include a link to a gif of your feelings about this branch

Link:
117 changes: 39 additions & 78 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,39 @@
# FitLit Starter Kit

The details of this project are outline in [this project spec](http://frontend.turing.io/projects/fitlit.html).

## Setup

1. Within your group, decide on one person to have the project repository (repo) on their GitHub account. Then, that person should fork this repo - on the top right corner of this page, click the **Fork** button.
1. Both memebers of the group should clone down the _forked_ repo. Since you don't want to name your project "activity-tracker-starter", you can use an optional argument when you run git clone (you replace the [...] with the terminal command arguments): `git clone [remote-address] [what you want to name the repo]`
1. Once you have cloned the repo, change into the directory and install the project dependencies. Run `npm install` to install project dependencies.
1. Run `npm start` in the terminal to see the HTML page (you should see some boilerplate HTML displayed on the page). `Control + C` is the command to stop running the local server. Closing the terminal without stopping the server first could allow the server to continue to run in the background and cause problems. This command is not specific to Webpack; make note of it for future use.
1. Make sure both members of your team are collaborators on the forked repo.
1. Do not run `npm audit fix --force`. This will update to the latest version of packages. We need to be using `[email protected]` which is not the latest version. If you start to run into Webpack errors, first check that all group members are using the correct version.

## Testing

There is no boilerplate for testing in this starter-kit repo. You will need to set this up yourself. However, if you ran `npm install`, then the tooling you need to start testing is already installed (`mocha` and `chai`).


## Data Model

**Users**

```
[
{
"id": [number],
"name": [string],
"address": [string],
"email": [string],
"strideLength": [number - feet],
"dailyStepGoal": [number - steps],
"friends": [array - one-way connection to other user(s)]
},
...more user data
]
```

**Activity**

```
[
{
"userID": [number],
"date": [string YYYY/MM/DD],
"numSteps": [number - steps],
"minutesActive": [number - minutes],
"flightsOfStairs": [number - flights]
},
...more activity data
]
```

**Hydration**

```
[
{
"userID": [number],
"date": [string YYYY/MM/DD],
"numOunces": [number - ounces]
},
...more hydration data
]
```

**Sleep**

```
[
{
"userID": [number],
"date": [string YYYY/MM/DD],
"hoursSlept": [number - hours],
"sleepQuality": [number - unitless]
},
...more sleep data
]
```
# FitLit
## Abstract

Staying in shape can be difficult. With all the stresses of life, keeping track of basic health statistics such as step count, fluid intake, and sleep can easily get away from you. Fit Lit is a web application designed to help users stay on track! Fit lit takes step count, sleep quality and longevity, and water consumed, stores it using API's, and then that data in an easily readable, helpful display.

## Context

This project was completed during two 1 week sprints in the second module of the Turing Program. The first sprint focused on implementing Test Driven Development (TDD), building an understanding of using asynchronous JavaScript to retrieve data from RESTful API's, and using GitHub Projects to plan and execute remote group work. The second sprint focused primarily on implementing feedback and building extensions on an existing code base, POSTing data to a local API, and utilizing third party extensions to display user data.

## Installation

1. Fork and clone this repo.
2. Type `cd fitlit` to move into the root directory.
3. Run `npm install`
4. Run `npm start`
5. copy and paste the provided url into a new web page
6. Fork and clone [the local API repo](https://github.com/turingschool-examples/fitlit-api)
7. In a seperate terminal, CD into it
8. Run npm install
9. Run npm start, navigate to Local Host 8080
10. To stop the local server from running in your terminal use command + c

## FitLit at a glance
![Giph of project](https://media0.giphy.com/media/skPpSh8M5vEO4zQGqG/giphy.gif)
## Technologies Used
- JavaScript
- HTML5
- (S)CSS
- Mocha
- Chai
- webpack
- ### third party extensions
- chartjs

## Contributors
- Ashlee Webb: [github](https://github.com/AshleeAWebb) | [linkedin](https://www.linkedin.com/in/ashlee-webb-0b592199/)
- Adam Meza: [github](https://github.com/Adam-Meza) | [linkedin](https://www.linkedin.com/in/adam-meza/)
- Rachel Brendel: [github](https://github.com/brendel-r) | [linkedin](https://www.linkedin.com/in/rachel-brendel-bb9673197/)
- Patrick Ankiewicz: [github](https://github.com/Pma913) | [linkedin](https://www.linkedin.com/in/patrick-ankiewicz/)
94 changes: 82 additions & 12 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Fitlit</title>
</head>
<body>
<h1>Activity Tracker</h1>
<img src="./images/turing-logo.png" alt="turing logo" height="100px" width="100px">

<!-- Do not include the scripts.js file here - it is done automatically by the webpack server -->
<script src="bundle.js"></script>
</body>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>FitLit</title>
<link href="./css/styles.css" rel="stylesheet" type="text/css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lexend&display=swap" rel="stylesheet">
</head>

<body>
<header class="main-header">
<div class="logo">
<img class="logo-image" src="./images/fitlit-logo.png" alt="FitLit logo">
</div>
<div class="user-main">
<h2 class="user-name" id="userName" tabindex="0">First Name</h2>
<ul class="user-info" id="userInfo" tabindex="0"></ul>
</div>
</header>
<!-- activity -->
<article class="activity-container">
<div class="activity-info-box">
<h2 tabindex="0">Activity</h2>
<p tabindex="0" class="activity activity-chart"><canvas id="activityBoxWeek" width="800" height="400" aria-label="A line chart showing user activity over the course of a week" role="img">
<p>Activity Chart</p>
</canvas></p>
</div>
<div class="activity-info-box">
<ul tabindex="0" class="activity activityUserStat" id="activityInfoBox">test</ul>
<button class="open-modal button"id="openModalBtn">Enter User Data</button>
</div>
<div id="activityModal" class="modal">
<span id ="close-btn"class="close-btn">&times;</span>
<form>
<section class="input-box">
<h2>Enter Today's Activity Data!</h2>
<!-- <label for="date">Date:</label>
<input class="data-input" type="date" id="date" name="date"> -->
</section>
<section class="input-box">
<label for="flightsOfStairs">Flights Of Stairs Climbed:</label>
<input class="data-input" type="number" id="flightsOfStairs" name="flights-of-stairs">
</section>
<section class="input-box">
<label for="activeMinutes">Active Minutes:</label>
<input class="data-input" type="number" id="activeMinutes" name="active-minutes">
</section>
<section class="input-box">
<label for="numSteps">Number of Steps:</label>
<input class="data-input" type="number" id="numSteps" name="num-steps">

</section>
<input type="submit" id="userInputBtn" class="user-input button" value="Enter User Data" disabled>
</form>
</div>
</section>
</div>
<div class="activity-info-box">
<h2 tabindex="0">Step Challenge</h2>
<p tabindex="0" class="activity activity-chart"><canvas id="stepChallengeBox" width="800" height="400"aria-label="A bar graph showing user activity compared to their friends for the week" role="img"></canvasid></canvas></p>
</div>
</article>
<section class="bottom-container">
<!-- hydration -->
<article class="info-card">
<h2 tabindex="0">Hydration</h2>
<p tabindex="0" class="hydration info-box"><canvas id="hydrationBoxWeek" width="800" height="400" aria-label="A line chart showing user hydration over the course of a week" role="img"></canvasid></canvas></p>
<ul tabindex="0" class="hydration info-box" id="hydrationInfoBox">test</ul>
</article>
<!-- sleep -->
<article class="info-card">
<h2 tabindex="0">Sleep</h2>
<p tabindex="0" class="sleep info-box"><canvas id="sleepBoxWeek" width="800" height="400" aria-label="A line chart showing user sleep over the course of a week" role="img"></canvasid></canvas></p>
<ul tabindex="0" class="sleep info-box" id="sleepInfoBox">test</ul>
</article>
</section>
<script src="bundle.js"></script>
</body>

</html>
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
"webpack": "^5.38.1",
"webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.11.2"
},
"dependencies": {
"chart.js": "^4.2.1",
"dayjs": "^1.11.7"
}
}
24 changes: 24 additions & 0 deletions src/Activity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class Activity {
constructor(data, stride) {
this.data = data;
this.userStride = stride;
};

getDailyActivityInfo(date, infoType) {
if (infoType === 'minutesActive' || infoType === 'numSteps') {
return this.data.find(activity => activity.date === date)[infoType];
} else {
return `${infoType} is not a valid argument!`;
};
};

calculateMiles(date) {
return parseFloat(((this.getDailyActivityInfo(date, 'numSteps') * this.userStride) / 5280).toFixed(2))
};

getLatestWeek() {
return this.data.map(activity => activity.numSteps).slice(0,7);
};
};

export default Activity;
31 changes: 31 additions & 0 deletions src/Hydration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class Hydration {
constructor(data) {
this.data = data;
};

findAvgDailyHydration() {
if (!this.data.length) {
return 'No Hydration Data Found';
};
const dailyAvg = this.data.reduce((total, water) => {
total.ounces += water.numOunces;
total.count += 1;
return total;
}, { ounces: 0, count: 0 });
return Math.round(dailyAvg.ounces / dailyAvg.count);
};

getHydrationSpecificDay(date) {
if (!this.data.length) {
return 'No Hydration Data Found';
};
const consumptionByDate = this.data.find(specficDate => specficDate.date === date);
return consumptionByDate.numOunces;
};

findWeeklyHydration() {
return this.data.map(water => water.numOunces).slice(0,7);
};
};

export default Hydration;
37 changes: 37 additions & 0 deletions src/Sleep.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
class Sleep {
constructor(data){
this.data = data;
};

getAverage(dataType) {
if (dataType === "hoursSlept" || dataType === "sleepQuality") {
let total = this.data.reduce((acc, currentValue) => {
acc += currentValue[dataType];
return acc;
}, 0)
return parseFloat((total / this.data.length).toFixed(4));
} else {
return `${dataType} is not a valid argument!`;
};
};

getInfoForSpecificDate(date, infoType) {
if (this.data.some(sleep => sleep.date === date)) {
return this.data.find(sleep => sleep.date === date)[infoType];
} else {
return "There is no data for this date";
};
};

getInfoForPastWeek(infoType) {
if (infoType === "hoursSlept" || infoType === "sleepQuality") {
return this.data
.map(sleep => sleep[infoType])
.slice(0,7);
} else {
return `${infoType} is not a valid argument!`;
};
};
};

export default Sleep;
6 changes: 0 additions & 6 deletions src/SomeClassYouChangeTheName.js

This file was deleted.

Loading