[S2T01] add second button with alternation sequence tracking#11
Closed
dever-io wants to merge 1 commit into
Closed
[S2T01] add second button with alternation sequence tracking#11dever-io wants to merge 1 commit into
dever-io wants to merge 1 commit into
Conversation
- Replace single button with Button 1 + Button 2 in a two-column row. - Track strict alternation: clicking the same button twice resets the sequence; clicking the other button advances it. - Show live counter 'Alternations: X / 3' plus a hint indicating the expected next button. - Trigger the celebration message after 3 alternations (6 strictly alternating clicks). - Persist totalClicks, sequenceClicks and lastButton in localStorage so the sequence survives page reloads.
Contributor
|
|
Author
|
Superseded by #12 (cleaner implementation, dependent on shared script.js refactor for S2T02). |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5
Summary
Implements S2T01 — Add Second Button with Sequence Tracking by replacing the single button with two buttons and adding strict-alternation tracking.
Changes
index.html— adds Button 1 and Button 2 in a two-column row, plus a liveAlternations: X / 3counter and a hint indicating which button is expected next.script.js— trackssequenceClicks(consecutive alternating clicks) andlastButton. Same-button-twice resets the sequence to 1; alternation increments it. After 6 alternating clicks (3 alternations) the celebration message is shown and the sequence resets. State persists inlocalStorage.style.css— two-column.button-rowgrid +.hintstyling.Test plan
node --check script.js— syntax OK.index.htmlin a browser:🤖 Generated with Claude Code