File tree 3 files changed +17
-4
lines changed
3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 71
71
width : 100vw ;
72
72
align-content : center;
73
73
}
74
+ .negative {
75
+ color : red !important ;
76
+ }
77
+
74
78
/*.question {*/
75
79
/*height:100px;*/
76
80
/*vertical-align: middle;*/
Original file line number Diff line number Diff line change 26
26
</ div >
27
27
< div class ="collapse navbar-collapse " id ="myNavbar ">
28
28
< ul class ="nav navbar-nav ">
29
- <!--<li><a href="https://github.com/ATL-WDI-Curriculum/projects/blob/master/project1.md">Project Specs</a></li>-->
30
- < li > < a href ="https://trello.com/b/FtyjyTlm/wdi-project-1-jeopardy-morgan-murrah "> Trello (Archive)</ a > </ li >
29
+ <!-- <li><a href=""></a></li>-->
31
30
</ ul >
32
31
< ul class ="nav navbar-nav navbar-right ">
33
32
<!-- Background music -->
Original file line number Diff line number Diff line change @@ -47,15 +47,25 @@ function submit(a, b) {
47
47
chaching . play ( ) ;
48
48
window . addprize = questions [ window . currentQuestion ] . cashPrize ;
49
49
score = score + window . addprize ;
50
- console . log ( score ) ;
51
50
$ ( '#score1' ) . html ( " $" + score ) ;
51
+ if ( ! Math . sign ( score ) ) {
52
+ $ ( '#score1' ) . addClass ( "negative" ) ;
53
+ } else {
54
+ $ ( '#score1' ) . removeClass ( "negative" ) ;
55
+ }
52
56
}
53
57
// Determine if incorrect answer was chosen and alert prize
54
58
if ( selected !== questions [ window . currentQuestion ] . correctAnswer ) {
55
59
buzzer . play ( ) ;
56
60
window . subprize = questions [ window . currentQuestion ] . cashPrize ;
57
61
score = score - window . subprize ;
62
+ console . log ( score ) ;
58
63
$ ( '#score1' ) . html ( " $" + score ) ;
64
+ if ( Math . sign ( score ) ) {
65
+ $ ( '#score1' ) . addClass ( "negative" ) ;
66
+ } else {
67
+ $ ( '#score1' ) . removeClass ( "negative" ) ;
68
+ }
59
69
}
60
70
}
61
71
// Get question info from array, prepare
@@ -88,7 +98,7 @@ $(function() {
88
98
} ) ;
89
99
} ) ;
90
100
$ ( "#myModal" ) . on ( 'hidden.bs.modal' , function ( ) {
91
- console . log ( 'The modal is now hidden.' ) ;
101
+ // console.log('The modal is now hidden.');
92
102
} ) ;
93
103
$ ( '.modal-body input:checked' ) . submit ( function ( ) {
94
104
$ ( '#myModal' ) . modal ( 'toggle' ) ;
You can’t perform that action at this time.
0 commit comments