Permalink
Browse files

Feedback on accept or not

  • Loading branch information...
1 parent 0e3f4ad commit ec5b7636e4b9162da2b9ab00c620e4077a0b9648 @nolastan committed Mar 29, 2012
Showing with 106 additions and 47 deletions.
  1. +1 −1 html5/controller.js
  2. +27 −0 html5/css/style.css
  3. +22 −1 html5/css/style.scss
  4. +1 −1 html5/index.html
  5. +4 −5 html5/models/member.js
  6. +49 −38 html5/views/bids_view.js
  7. +2 −1 html5/views/plan_view.js
View
@@ -50,7 +50,7 @@ function updateStatsBar() {
$("#stats .brothers .val").html(game.frat.members.length);
$("#screens .rush .val").html(Object.size(game.frat.rushees));
$("nav.bidMeeting .val").html(game.frat.bids);
- if(game.frat.rushees.length == 0){
+ if(Object.size(game.frat.rushees) == 0){
$("#screens .rush .val").hide();
}else{
$("#screens .rush .val").show();
View
@@ -117,6 +117,17 @@ nav.bidMeeting {
color: #fff; }
nav.bidMeeting p {
padding-top: 10px; }
+ nav.bidMeeting button {
+ display: none;
+ font-size: 40%;
+ margin-left: 10px;
+ height: 30px;
+ vertical-align: top; }
+
+nav.bidMeeting.over {
+ background-color: #32552d; }
+ nav.bidMeeting.over button {
+ display: inline-block; }
/* Canvas stuff */
#background {
@@ -159,6 +170,22 @@ h2 {
text-align: center;
width: 100px;
display: inline-block; }
+#bidScreen ul.rushees button.declined {
+ background-image: linear-gradient(bottom, #aa392f, #923129);
+ background-image: -o-linear-gradient(bottom, #aa392f, #923129);
+ background-image: -moz-linear-gradient(bottom, #aa392f, #923129);
+ background-image: -webkit-linear-gradient(bottom, #aa392f, #923129);
+ background-image: -ms-linear-gradient(bottom, #aa392f, #923129);
+ background-image: -webkit-gradient(linear, left bottom, left top, #aa392f, #923129); }
+#bidScreen ul.rushees button.accepted {
+ background-image: linear-gradient(bottom, #9cc796, #8abd82);
+ background-image: -o-linear-gradient(bottom, #9cc796, #8abd82);
+ background-image: -moz-linear-gradient(bottom, #9cc796, #8abd82);
+ background-image: -webkit-linear-gradient(bottom, #9cc796, #8abd82);
+ background-image: -ms-linear-gradient(bottom, #9cc796, #8abd82);
+ background-image: -webkit-gradient(linear, left bottom, left top, #9cc796, #8abd82); }
+#bidScreen ul.rushees button.declined, #bidScreen ul.rushees button.accepted {
+ cursor: default; }
#bidScreen .name {
font-size: 170%;
font-weight: bold;
View
@@ -156,8 +156,20 @@ nav.bidMeeting{
p{
padding-top: 10px;
}
+ button{
+ display:none;
+ font-size: 40%;
+ margin-left: 10px;
+ height: 30px;
+ vertical-align:top;
+ }
+}
+nav.bidMeeting.over{
+ background-color: darken($green, 40%);
+ button{
+ display:inline-block;
+ }
}
-
/* Canvas stuff */
#background{
position:absolute;
@@ -210,6 +222,15 @@ h2{
width:100px;
display:inline-block;
}
+ button.declined{
+ @include gradient-inverse($red);
+ }
+ button.accepted{
+ @include gradient-inverse($green);
+ }
+ button.declined, button.accepted{
+ cursor: default;
+ }
}
.name{
font-size: 170%;
View
@@ -71,7 +71,7 @@
<li><button id="addBids">+B</button></li>
</ul>
</nav>
-<nav class="bidMeeting"><p>You have <span class="val">0</span> bids remaining.</span></p></nav>
+<nav class="bidMeeting"><p>You have <span class="val">0</span> bids remaining.<button class="continue">Continue</button></p></nav>
<div id="simulation">
<canvas id="canvas"></canvas>
View
@@ -121,14 +121,13 @@ function bidRushee(id){
}else{
accepted = false;
}
+ delete game.frat.rushees[id];
updateStatsBar();
- delete rushee;
- if(game.frat.bids == 0 || game.frat.rushees.length == 0){
- $("nav.main").show();
- $("nav.bidMeeting").hide();
+ if(game.frat.bids == 0 || Object.size(game.frat.rushees) == 0){
+ $("nav.bidMeeting").addClass("over");
+ $("#bidScreen .rushees li button").unbind("click");
game.frat.bids = 0;
- plan();
}
return accepted;
View
@@ -2,12 +2,13 @@ var bidScreen;
$(document).ready(function(){
bidScreen = $("#bidScreen");
-
+ $("nav.bidMeeting .continue").click(plan);
});
function drawBidScreen(){
bidScreen.show();
- $("#results").hide();
+ $("nav.bidMeeting").removeClass("over");
+ $("#results").hide();
$("#planScreen").hide();
$("#simulation").hide();
$("#screens button").removeClass("active");
@@ -22,43 +23,53 @@ function drawBidScreen(){
// clear list
$("#bidScreen .rushees").html("");
- for(key in game.frat.rushees){
- console.log(key);
- var rushee = game.frat.rushees[key];
- var html = "";
- var ctx;
-
- html += '<li class="rushee" id="rushee_' +rushee.id + '">';
- html += '<p class="name">' + rushee.name + '</p>';
- html += '<canvas height="100" width="100" class="face"></canvas>';
- html += '<ul class="skills">';
- html += '<li class="rush"><label>R</label><div class="bar"><div class="fill" style="width:' + rushee.skills.rush + '%"></div></div></li>';
- html += '<li class="party"><label>P</label><div class="bar"><div class="fill" style="width:' + rushee.skills.party + '%"></div></div></li>';
- html += '<li class="cs"><label>S</label><div class="bar"><div class="fill" style="width:' + rushee.skills.cs + '%"></div></div></li>';
- html += '<li class="study"><label>A</label><div class="bar"><div class="fill" style="width:' + rushee.skills.study + '%"></div></div></li>';
- html += '</ul>';
- html += '<canvas width="100" height="50" class="gauge"></canvas>';
- html += '<p class="interest">interest</p>';
- html += '<button class="bid">Bid</button>';
- html += "</li>";
- $("#bidScreen .rushees").append(html);
-
- ctx = $("#rushee_"+rushee.id+" .gauge")[0];
- drawGauge(ctx.getContext("2d"), rushee.chanceWillJoin(game.frat))
-
- ctx = $("#rushee_"+rushee.id+" .face")[0];
- drawRusheeFace(ctx.getContext("2d"), rushee.eye_color, rushee.hair_color, rushee.hair_style, rushee.skin_color);
+ if(Object.size(game.frat.rushees) == 0){
+ var html = "<li>No one is rushing your fraternity.</li>";
+ $("#bidScreen .rushees").html(html);
+ }else{
+ for(key in game.frat.rushees){
+ console.log(key);
+ var rushee = game.frat.rushees[key];
+ var html = "";
+ var ctx;
+
+ html += '<li class="rushee" id="rushee_' +rushee.id + '">';
+ html += '<p class="name">' + rushee.name + '</p>';
+ html += '<canvas height="100" width="100" class="face"></canvas>';
+ html += '<ul class="skills">';
+ html += '<li class="rush"><label>R</label><div class="bar"><div class="fill" style="width:' + rushee.skills.rush + '%"></div></div></li>';
+ html += '<li class="party"><label>P</label><div class="bar"><div class="fill" style="width:' + rushee.skills.party + '%"></div></div></li>';
+ html += '<li class="cs"><label>S</label><div class="bar"><div class="fill" style="width:' + rushee.skills.cs + '%"></div></div></li>';
+ html += '<li class="study"><label>A</label><div class="bar"><div class="fill" style="width:' + rushee.skills.study + '%"></div></div></li>';
+ html += '</ul>';
+ html += '<canvas width="100" height="50" class="gauge"></canvas>';
+ html += '<p class="interest">interest</p>';
+ html += '<button class="bid">Bid</button>';
+ html += "</li>";
+ $("#bidScreen .rushees").append(html);
+
+ ctx = $("#rushee_"+rushee.id+" .gauge")[0];
+ drawGauge(ctx.getContext("2d"), rushee.chanceWillJoin(game.frat))
+
+ ctx = $("#rushee_"+rushee.id+" .face")[0];
+ drawRusheeFace(ctx.getContext("2d"), rushee.eye_color, rushee.hair_color, rushee.hair_style, rushee.skin_color);
+ }
+
+ $("#bidScreen .rushees li button").click(function(){
+ var id = $(this).parent().attr("id");
+ id = id.replace("rushee_", "");
+ if(bidRushee(id)){
+ $(this).addClass("accepted");
+ $(this).html("Accepted");
+ }else{
+ $(this).addClass("declined");
+ $(this).html("Declined");
+ }
+ $(this).unbind("click");
+ });
}
-
- $("#bidScreen .rushees li button").click(function(){
- var id = $(this).parent().attr("id");
- id = id.replace("rushee_", "");
- if(bidRushee(id)){
- console.log("accepted");
- }else{
- console.log("declined");
- }
- });
+
+
}
View
@@ -5,7 +5,8 @@ function drawPlanningScreen(){
game.board.DrawPieces();
game.nextTurn = game.turns.getNext();
-
+ $("nav.bidMeeting").hide();
+ $("nav.main").show();
$("#bidScreen").hide();
$("#planScreen").show();
$("#simulation").hide();

0 comments on commit ec5b763

Please sign in to comment.