Merge pull request #2 from PedrosUsername/feature/amogus

Approved Pedro's pull req with great pleasure
This commit is contained in:
Mattia Mascarello 2021-11-19 11:55:30 +01:00 committed by GitHub
commit 061ac35219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 1 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

@ -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;