-
Poll creation form (#create-poll):
- Question input
- Answer A input
- Answer B input
- Button to start poll
-
Current Poll Container
<div>
for the question and the options- button for option A voting (#vote-a)
- button for option B voting (#vote-b)
- button to close poll (#close-poll)
- span for Option A votes
- span for Option B votes
-
List of Past Polls
-
<ul>
for listing the polls -
<li>
for displaying the individual polls
- optionAVotes (integer)
- optionBVotes (integer)
- question (string / varchar)
- optionA (string / varchar)
- optionB (string / varchar)
name: polls columns: option_a_votes, option_b_votes, option_a, option_b, question
- #create-poll onSubmit
- create FormData from our form
- user the FormData to "hydrate"
- clear our form
- #vote-a / #vote-b onClick
- increment our optionAVotes or optionBVotes state
- inject the state into our HTML
- #close-poll onClick
- create an object with our state
- send that object to Supabase
- rerender the list of polls
displayPolls
-- call Supabase, get a list of polls, and render each onerenderPoll
-- take a single poll object, and create a DOM element for itdisplayCurrentPoll
-- inject the question, option info into the htmlcreatePoll
-- calls supabasegetPolls
-- calls supabase
- Setup my HTML skeleton plus enough CSS to not drive myself crazy (ACP)
- Form submit and getting the question data to display (ACP)
- Get the voting working (ACP)
- Create my supabase table
- Get close poll button working -- submitting info to supabase (ACP)
- Get list of polls displaying (ACP)