diff --git a/README.md b/README.md index 62f5032..9c6b554 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,11 @@ Other cool stuff - Ability to add multiple fields to each step. - Scales to different types of forms. - You can provide a custom algorithim to process the form data. - - Hosted on my website. + - In fact, you can even have multiple forms. + - Hosted on my website (public folder). Bug Tracker - Input range doesn't reset position on next(). - You need to move input at least once to set a value. + +Ok I'm tired now... diff --git a/public/assets/forms.js b/public/assets/forms.js index beb0c27..a08b17f 100644 --- a/public/assets/forms.js +++ b/public/assets/forms.js @@ -6,7 +6,7 @@ export const psychForm = { prompt: "If you make a mistake on this team, it's held against you.", fields: [{ type: "range", - value: null, + value: null, /* Where we capture the data */ }], }, { @@ -43,3 +43,9 @@ export const psychAlgo = (form, res) => { res.value = Math.floor(vals.reduce((a, b) => a + b) / vals.length); } + +/* + +You can edit the form data here without touching app logic. + +*/ diff --git a/public/components/form.js b/public/components/form.js index 5269593..039fba9 100644 --- a/public/components/form.js +++ b/public/components/form.js @@ -45,3 +45,13 @@ const Form = } export default Form; + +/* + +Each form consists of multiple steps. + +Each step can consist of multiple fields. + +Press the next button to go to next step. + +*/ \ No newline at end of file diff --git a/public/components/main.js b/public/components/main.js index 8f6b6aa..ba4919e 100644 --- a/public/components/main.js +++ b/public/components/main.js @@ -48,3 +48,18 @@ const Main = } export default Main; + +/* + +App is split into three parts: + +1. Choose a form (simplified to a start button for now). + +2. Fill out the form (Form component). + +3. See the results (will be separate component in future). + +The psychForm (or any form) has the double function of being a template as +well as storing the form data itself. + +*/ \ No newline at end of file diff --git a/public/components/range.js b/public/components/range.js index 9bb8d17..b1717e9 100644 --- a/public/components/range.js +++ b/public/components/range.js @@ -38,3 +38,9 @@ const Range = } export default Range + +/* + +Update the results live with the sliding action. + +*/ \ No newline at end of file diff --git a/public/components/step.js b/public/components/step.js index 4f0979c..50e0ba5 100644 --- a/public/components/step.js +++ b/public/components/step.js @@ -25,3 +25,11 @@ const Step = } export default Step; + +/* + +Show the prompt. + +Render the appropriate fields, obviously only range field for now. + +*/ \ No newline at end of file