dankness++

This commit is contained in:
rogs 2021-11-19 05:04:27 -03:00
parent bdaa39ac94
commit 4e51b2d6e8
5 changed files with 58 additions and 2 deletions

BIN
assets/video/aprovar.mp4 Normal file

Binary file not shown.

BIN
assets/video/desaprovar.mp4 Normal file

Binary file not shown.

View File

@ -53,6 +53,15 @@ body {
font-size: 25px;
}
.floatleft {
position: absolute;
left: 2%;
top: 5%;
width: 20%;
display: none;
}
#wrong {
background-color: black;
display: none;

View File

@ -37,11 +37,21 @@
<a class="button ans" data-ans="4">d</a>
</div>
</div>
</div>
</div>
<div id="playBegin" class="floattop">
<h1>The Social Credit Score Game</h1>
<img src="assets/img/play.png">
</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">
<img src="assets/img/wrong.png">
</div>

View File

@ -29,7 +29,7 @@ $("#playBegin").click(function () {
$(this).fadeOut();
});
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;
total = d["initialScore"];
$("#counter").html("Social credit score: " + total);
@ -49,6 +49,18 @@ function displayQuestion() {
}
else {
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) {
index = indexeslist[indexesProgress];
indexesProgress++;
@ -68,6 +80,31 @@ function displayQuestion() {
$("#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 () {
var res = cQuestion["answers"][$(this).attr("data-ans") - 1]["effect"];
total += res;