Skip to content

Commit

Permalink
nice looking. better saving. you get the file name when you press sav…
Browse files Browse the repository at this point in the history
…e, it's in the console, along with the text to paste. also, took out the animated "oh no" to lighten the load. UI improvement: buttons below single voter ballot.
  • Loading branch information
paretoman committed Aug 7, 2017
1 parent ab5332c commit 1b8f5d3
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 29 deletions.
10 changes: 5 additions & 5 deletions newer.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ <h2 class="ballot_title" style="margin-bottom: 0.15em;">Normalizing Voter</h2>
<h2 class="ballot_title" style="margin-bottom: 0.15em;">Strong Strategic Voter</h2>
<p class="ballot_caption">Almost like strategic approval.</p>

<iframe src="play/ballot8.html" width="900" height="276" scrolling="no"></iframe>
<iframe src="play/ballot8.html" width="655" height="380" scrolling="no"></iframe>

</div>
<div class="words">
Expand All @@ -250,7 +250,7 @@ <h2 class="ballot_title" style="margin-bottom: 0.15em;">Strong Strategic Voter</
<h2 class="ballot_title" style="margin-bottom: 0.15em;">Best Frontrunner</h2>
<p class="ballot_caption">And everybody you like better.</p>

<iframe src="play/ballot11.html" width="900" height="276" scrolling="no"></iframe>
<iframe src="play/ballot11.html" width="655" height="380" scrolling="no"></iframe>

</div>
<div class="words">
Expand All @@ -263,7 +263,7 @@ <h2 class="ballot_title" style="margin-bottom: 0.15em;">Best Frontrunner</h2>
<h2 class="ballot_title" style="margin-bottom: 0.15em;">Not the Worst Frontrunner</h2>
<p class="ballot_caption">Just everybody you like better.</p>

<iframe src="play/ballot12.html" width="900" height="276" scrolling="no"></iframe>
<iframe src="play/ballot12.html" width="655" height="380" scrolling="no"></iframe>

</div>
<div class="words">
Expand Down Expand Up @@ -329,7 +329,7 @@ <h1>Star voting</h1>
<h2 class="ballot_title" style="margin-bottom: 0.15em;">Star Strong</h2>
<p class="ballot_caption">Keeps a space for the best.</p>

<iframe src="play/ballot9.html" width="900" height="276" scrolling="no"></iframe>
<iframe src="play/ballot9.html" width="655" height="380" scrolling="no"></iframe>

</div>
<div class="words">
Expand Down Expand Up @@ -361,7 +361,7 @@ <h1>3-2-1 voting</h1>
<h2 class="ballot_title" style="margin-bottom: 0.15em;">321 Strategic</h2>
<p class="ballot_caption">Approval with an extra level.</p>

<iframe src="play/ballot10.html" width="900" height="276" scrolling="no"></iframe>
<iframe src="play/ballot10.html" width="655" height="380" scrolling="no"></iframe>

</div>
<div class="words">
Expand Down
5 changes: 2 additions & 3 deletions play/ballot10.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<script>main({
system: "Three",
strategy: "starnormfrontrunners",
frontrunnerSet: new Set(["square","hexagon"]),
showChoiceOfFrontrunners: true,
showChoiceOfStrategy: true
frontrunnerSet: new Set(["square","triangle"]),
showChoiceOfFrontrunners: true
});</script>
2 changes: 1 addition & 1 deletion play/ballot6.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script>main({
system: "Score",
strategy: "best frontrunner",
frontrunnerSet: new Set(["square","hexagon"]),
frontrunnerSet: new Set(["square","triangle"]),
showChoiceOfFrontrunners: true,
showChoiceOfStrategy: true
});</script>
3 changes: 1 addition & 2 deletions play/ballot7.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@
<script>main({
system: "Score",
strategy: "threshold",
showChoiceOfFrontrunners: true,
showChoiceOfStrategy: true
showChoiceOfFrontrunners: true
});</script>
2 changes: 1 addition & 1 deletion play/ballot9.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
<script>main({
system: "Score",
strategy: "starnormfrontrunners", // for now we are using an "off-menu" option. We should make versions of each of hte strategies for star.
frontrunnerSet: new Set(["square","hexagon"]),
frontrunnerSet: new Set(["square","triangle"]),
showChoiceOfFrontrunners: true
});</script>
18 changes: 18 additions & 0 deletions play/css/ballot.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ BALLOT DESIGN
width: 375px;
height: 250px;
margin-left: 20px;
margin-bottom: 10px;

overflow: hidden;
float:left;
Expand All @@ -18,9 +19,26 @@ BALLOT DESIGN
border: 2px solid #fff;

position: relative;


}
#ballot .ballot_sprite{
position: absolute;
background-size: 100% auto;
}

.button-group{
margin-left: 0px;
float:left;
clear:both;
}

#reset {
top: 270px;
left: 275px
}

.model {
height:260px;
margin-bottom: 10px;
}
2 changes: 2 additions & 0 deletions play/css/election.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ Election/Sandbox design:
#left{
width:220px;
padding-right: 20px;
height: 371px;
}
#center{
width:320px;
height: 370px;
}
#right{
width:220px;
Expand Down
4 changes: 1 addition & 3 deletions play/js/main_ballot.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function main(config){

};
window.chooseFrun = new ButtonGroup({
label: "which candidates are the frontrunners?",
label: "who are the frontrunners?",
width: 42,
data: frun,
onChoose: onChooseFrun,
Expand All @@ -125,8 +125,6 @@ function main(config){
var resetDOM = document.createElement("div");
resetDOM.id = "reset";
resetDOM.innerHTML = "reset";
resetDOM.style.top = "240px";
resetDOM.style.left = "660px";
resetDOM.onclick = function(){

config = JSON.parse(JSON.stringify(initialConfig)); // RESTORE IT!
Expand Down
22 changes: 8 additions & 14 deletions play/js/main_sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,8 @@ function main(config){
logtext += i + ": " +JSON.stringify(config[i]) + ',\n'
}
}
var aloc = window.location.pathname.split('/')
logtext += "\n\npaste this JSON into" + aloc[aloc.length-2] + "/" + aloc[aloc.length-1]
console.log(logtext)
if (log==2) console.log(JSON.stringify(config))

Expand Down Expand Up @@ -770,8 +772,8 @@ function main(config){
resetDOM.style.top = "470px";
resetDOM.style.left = "235px";
} else {
resetDOM.style.top = "330px";
resetDOM.style.left = "235px";
resetDOM.style.top = "340px";
resetDOM.style.left = "245px";
}
// Create a "save" button
var saveDOM = document.createElement("div");
Expand All @@ -781,7 +783,7 @@ function main(config){
saveDOM.style.top = "470px";
saveDOM.style.left = "350px";
} else {
saveDOM.style.top = "330px";
saveDOM.style.top = "340px";
saveDOM.style.left = "350px";
}
saveDOM.onclick = function(){
Expand All @@ -801,8 +803,10 @@ function main(config){
//skip
} else {
linkText.style.position = "absolute";
linkText.style.top = "330px";
linkText.style.top = "340px";
linkText.style.left = "460px";
linkText.style.height = "30px";
linkText.style.width = "90px";
}
document.body.appendChild(linkText);

Expand Down Expand Up @@ -859,14 +863,4 @@ function main(config){

};

// FUNNY HACK.
setInterval(function(){
var ohno = document.getElementById("ohno");
if(!ohno) return;
var x = Math.round(Math.random()*10-5);
var y = Math.round(Math.random()*10)+10;
ohno.style.top = y+"px";
ohno.style.left = x+"px";
},10);

};

0 comments on commit 1b8f5d3

Please sign in to comment.