From e5b3c2e7593374fffe6e15ca306016b4f23831dd Mon Sep 17 00:00:00 2001 From: Sandy Currier Date: Thu, 29 Feb 2024 01:50:56 -0500 Subject: [PATCH] initial copies from the odin-recipe repo --- blank-ballot.js | 144 +++++++++++++ stylesheets/voting.css | 70 ++++++ voting.html | 480 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 694 insertions(+) create mode 100644 blank-ballot.js create mode 100644 stylesheets/voting.css create mode 100644 voting.html diff --git a/blank-ballot.js b/blank-ballot.js new file mode 100644 index 0000000..c88e273 --- /dev/null +++ b/blank-ballot.js @@ -0,0 +1,144 @@ +const blankBallotJSON = `{ + "active_ggos": [ + ".", + "GGOs/states/Massachusetts", + "GGOs/states/Massachusetts/GGOs/counties/Middlesex", + "GGOs/states/Massachusetts/GGOs/towns/Concord" + ], + "ballot_filename": "000,001,002,003,ballot.json", + "ballot_node": "GGOs/states/Massachusetts/GGOs/towns/Concord", + "ballot_subdir": "GGOs/states/Massachusetts/GGOs/towns/Concord", + "contests": { + "GGOs/states/Massachusetts": [ + { + "U.S. President": { + "choices": [ + { + "name": "Circle Party Ticket", + "ticket_names": [ + "Rey Skywalker", + "Obi-Wan Kenobi" + ] + }, + { + "name": "Square Party Ticket", + "ticket_names": [ + "Atticus Finch", + "Hermione Granger" + ] + }, + { + "name": "Triangle Party Ticket", + "ticket_names": [ + "Evelyn Quan Wang", + "Waymond Wang" + ] + } + ], + "contest_type": "ticket", + "max": 1, + "selection": [ + "0: Circle Party Ticket" + ], + "tally": "plurality", + "ticket_offices": [ + "President", + "Vice President" + ], + "uid": "0000" + } + }, + { + "U.S. Senate": { + "choices": [ + { + "name": "Anthony Alpha", + "party": "Circle Party" + }, + { + "name": "Betty Beta", + "party": "Dyad Party" + }, + { + "name": "Gloria Gamma", + "party": "Triangle Party" + }, + { + "name": "David Delta", + "party": "Square Party" + }, + { + "name": "Emily Echo", + "party": "Pentagon Party" + }, + { + "name": "Francis Foxtrot", + "party": "Hexagon Party" + } + ], + "selection": [ + "5: Francis Foxtrot", + "4: Emily Echo", + "3: David Delta" + ], + "tally": "rcv", + "uid": "0001" + } + }, + { + "Governor": { + "choices": [ + { + "name": "Spencer Cogswell", + "party": "Circle Party" + }, + { + "name": "Cosmo Spacely", + "party": "Triangle Party" + } + ], + "max": 1, + "selection": [ + "1: Cosmo Spacely" + ], + "tally": "plurality", + "uid": "0002" + } + } + ], + "GGOs/states/Massachusetts/GGOs/counties/Middlesex": [ + { + "County Clerk": { + "choices": [ + "Jean-Luc Picard", + "Katniss Everdeen", + "James T. Kirk" + ], + "max": 1, + "selection": [ + "0: Jean-Luc Picard" + ], + "tally": "plurality", + "uid": "0003" + } + } + ], + "GGOs/states/Massachusetts/GGOs/towns/Concord": [ + { + "Question 1 - should the starting time of the annual town meeting be moved to 6:30 PM?": { + "choices": [ + "yes", + "no" + ], + "description": "Should the Town of Concord start the annual Town Meeting at 6:30 PM instead of 7:00 PM?", + "max": 1, + "selection": [ + "0: yes" + ], + "tally": "plurality", + "uid": "0004" + } + } + ] + } +}`; diff --git a/stylesheets/voting.css b/stylesheets/voting.css new file mode 100644 index 0000000..be277ab --- /dev/null +++ b/stylesheets/voting.css @@ -0,0 +1,70 @@ +/* Set the overall styles for the progress bar */ +#progressBar { + display: flex; + height: 20px; + width: 100%; + text-align: center; + background-color: #E5E4E2; +} +#youAreHereBar { + display: flex; + height: 20px; + width: 100%; + text-align: center; +} + +/* Each section (class) gets an individual black border */ +.progSection { + flex: 1; /* Equal distribution of space */ + border-right: 1px solid black; +} +.yrhSection { + flex: 1; /* Equal distribution of space */ +} + +/* when a plurality candidate is selected or not */ +.selected { + background-color: #D5F5E3; +} +.unselected { + background-color: #f5f5f5; +} + +/* the incoming choices */ +#choiceList li { + margin: 10px; + padding: 15px; + border: 1px solid #dfdfdf; + list-style-type: none; +} + +/* in RCV the selection is a sortable list - the defaults */ +#sortableList { + list-style: none; + padding: 0; + margin: 0; +} + +#sortableList li { + margin: 10px; + padding: 15px; + border: 1px solid #dfdfdf; + background: #f5f5f5; +} + +#sortableList li.hint { + border: 1px solid #ffc49a; + background: #feffb4; +} + +#sortableList li.active { + border: 1px solid #ffa5a5; + background: #ffe7e7; +} + +/* bottom section */ +.noBullets { + list-style-type: none; +} + + diff --git a/voting.html b/voting.html new file mode 100644 index 0000000..56b43fc --- /dev/null +++ b/voting.html @@ -0,0 +1,480 @@ + + + + + + + + Voting - User Story 2 + + + + +
+
+ +

Progress bar per contest and current contest

+ + +
+ + +
+ + +
+ + + + + + +