dankness++
This commit is contained in:
parent
bdaa39ac94
commit
4e51b2d6e8
BIN
assets/video/aprovar.mp4
Normal file
BIN
assets/video/aprovar.mp4
Normal file
Binary file not shown.
BIN
assets/video/desaprovar.mp4
Normal file
BIN
assets/video/desaprovar.mp4
Normal file
Binary file not shown.
|
@ -53,6 +53,15 @@ body {
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.floatleft {
|
||||||
|
position: absolute;
|
||||||
|
left: 2%;
|
||||||
|
top: 5%;
|
||||||
|
width: 20%;
|
||||||
|
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#wrong {
|
#wrong {
|
||||||
background-color: black;
|
background-color: black;
|
||||||
display: none;
|
display: none;
|
||||||
|
|
12
index.html
12
index.html
|
@ -37,11 +37,21 @@
|
||||||
<a class="button ans" data-ans="4">d</a>
|
<a class="button ans" data-ans="4">d</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="playBegin" class="floattop">
|
<div id="playBegin" class="floattop">
|
||||||
<h1>The Social Credit Score Game</h1>
|
<h1>The Social Credit Score Game</h1>
|
||||||
<img src="assets/img/play.png">
|
<img src="assets/img/play.png">
|
||||||
</div>
|
</div>
|
||||||
|
<div id="rock-approves" class="floatleft">
|
||||||
|
<video id="rock-approves-video" style="width: 100%;" muted>
|
||||||
|
<source src="assets/video/aprovar.mp4" type="video/mp4">
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
<div id="rock-disapproves" class="floatleft">
|
||||||
|
<video id="rock-disapproves-video" style="width: 100%;">
|
||||||
|
<source src="assets/video/desaprovar.mp4" type="video/mp4">
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
<div id="wrong" class="floattop">
|
<div id="wrong" class="floattop">
|
||||||
<img src="assets/img/wrong.png">
|
<img src="assets/img/wrong.png">
|
||||||
</div>
|
</div>
|
||||||
|
|
39
js/main.js
39
js/main.js
|
@ -29,7 +29,7 @@ $("#playBegin").click(function () {
|
||||||
$(this).fadeOut();
|
$(this).fadeOut();
|
||||||
});
|
});
|
||||||
var data = {}, cQuestion = {}, indexeslist = [], indexesProgress = 0, total = 100;
|
var data = {}, cQuestion = {}, indexeslist = [], indexesProgress = 0, total = 100;
|
||||||
$.getJSON("data.json", function (d) {
|
$.getJSON("https://matmasit.github.io/SocialCreditScoreGame/data.json", function (d) {
|
||||||
data = d;
|
data = d;
|
||||||
total = d["initialScore"];
|
total = d["initialScore"];
|
||||||
$("#counter").html("Social credit score: " + total);
|
$("#counter").html("Social credit score: " + total);
|
||||||
|
@ -49,6 +49,18 @@ function displayQuestion() {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var index = 0;
|
var index = 0;
|
||||||
|
|
||||||
|
// sends comrad Dwayne to help (or calls him back)
|
||||||
|
if (total > 4000 ) {
|
||||||
|
$("#rock-approves").hide();
|
||||||
|
$("#rock-disapproves").hide();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$("#rock-approves-video").get(0).currentTime = 0;
|
||||||
|
$("#rock-approves").show();
|
||||||
|
}
|
||||||
|
// **************************************
|
||||||
|
|
||||||
if (indexesProgress < indexeslist.length) {
|
if (indexesProgress < indexeslist.length) {
|
||||||
index = indexeslist[indexesProgress];
|
index = indexeslist[indexesProgress];
|
||||||
indexesProgress++;
|
indexesProgress++;
|
||||||
|
@ -68,6 +80,31 @@ function displayQuestion() {
|
||||||
$("#questionTitle").html(data["questions"][index]["title"]);
|
$("#questionTitle").html(data["questions"][index]["title"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// comrad Dwaynes feedback *************************
|
||||||
|
$(".ans").mouseenter(function(){
|
||||||
|
var res = cQuestion["answers"][$(this).attr("data-ans") - 1]["effect"];
|
||||||
|
|
||||||
|
if ( ( total <= 4000 ) && ( res < 0 ) ) {
|
||||||
|
$("#rock-approves").hide();
|
||||||
|
$("#rock-disapproves").show();
|
||||||
|
$("#rock-disapproves-video").get(0).currentTime = 0;
|
||||||
|
$("#rock-disapproves-video").get(0).play();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
$(".ans").mouseleave(function(){
|
||||||
|
var res = cQuestion["answers"][$(this).attr("data-ans") - 1]["effect"];
|
||||||
|
|
||||||
|
if ( ( total <= 4000 ) && ( res < 0 ) ) {
|
||||||
|
$("#rock-disapproves").hide();
|
||||||
|
$("#rock-approves").show();
|
||||||
|
$("#rock-approves-video").get(0).currentTime = 0;
|
||||||
|
$("#rock-approves-video").get(0).play();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// ***8888888************************************8
|
||||||
|
|
||||||
$(".ans").click(function () {
|
$(".ans").click(function () {
|
||||||
var res = cQuestion["answers"][$(this).attr("data-ans") - 1]["effect"];
|
var res = cQuestion["answers"][$(this).attr("data-ans") - 1]["effect"];
|
||||||
total += res;
|
total += res;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user