






diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 3749029..0000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "yaml.schemas": {
- "http://json-schema.org/draft-07/schema#": ["schema.yaml"],
- "schema.yaml": [ "data.yaml" ]
- }
-}
\ No newline at end of file
diff --git a/css/style.css b/assets/css/style.css
similarity index 93%
rename from css/style.css
rename to assets/css/style.css
index 680b516..e451cb5 100644
--- a/css/style.css
+++ b/assets/css/style.css
@@ -1,5 +1,5 @@
body {
- background-image: url(..//assets/img/chinese_flag.png);
+ background-image: url(../img/chinese_flag.png);
}
* {
@@ -48,7 +48,7 @@ body {
}
#playBegin {
- background-image: url(..//assets/img/chinese_flag.png);
+ background-image: url(../img/chinese_flag.png);
}
.floattop>img {
diff --git a/assets/img/it_flag.svg b/assets/img/it_flag.svg
new file mode 100644
index 0000000..9ee6003
--- /dev/null
+++ b/assets/img/it_flag.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/assets/img/uk_flag.svg b/assets/img/uk_flag.svg
new file mode 100644
index 0000000..9131483
--- /dev/null
+++ b/assets/img/uk_flag.svg
@@ -0,0 +1,16 @@
+
+
\ No newline at end of file
diff --git a/js/jquery-3.6.0.min.js b/assets/js/jquery-3.6.0.min.js
similarity index 100%
rename from js/jquery-3.6.0.min.js
rename to assets/js/jquery-3.6.0.min.js
diff --git a/js/js-yaml.min.js b/assets/js/js-yaml.min.js
similarity index 100%
rename from js/js-yaml.min.js
rename to assets/js/js-yaml.min.js
diff --git a/js/main.js b/assets/js/main.js
similarity index 80%
rename from js/main.js
rename to assets/js/main.js
index 7a4432f..fc28645 100644
--- a/js/main.js
+++ b/assets/js/main.js
@@ -10,11 +10,11 @@ else {
//handles bgm files to create a continous bgm
function audiosegm() {
if (audiostate != "mix") {
- audio = new Audio('assets/music/main.mp3');
+ audio = new Audio('../assets/music/main.mp3');
audiostate = "mix";
}
else {
- audio = new Audio('assets/music/maobgm.mp3');
+ audio = new Audio('../assets/music/maobgm.mp3');
audiostate = "maobgm";
}
audio.play();
@@ -22,7 +22,7 @@ function audiosegm() {
}
// plays a sound effect
function sef(filename) {
- new Audio("assets/music/" + filename + ".mp3").play();
+ new Audio("../assets/music/" + filename + ".mp3").play();
}
$("#playBegin").click(function () {
try {// this might fail, expecially on safari
@@ -32,17 +32,31 @@ $("#playBegin").click(function () {
$(this).fadeOut();
});
var data = {}, cQuestion = {}, indexeslist = [], indexesProgress = 0, total = 100;
+var file = "data_en.yaml";
+switch(getParam("lang")) {
+ case "it":
+ file = "data_it.yaml";
+ break;
+}
$.ajax({
type: 'GET',
- url: 'data.yaml',
+ url: "../"+file,
complete: function (r) {
data = jsyaml.load(r.responseText);
total = data["initialScore"];
- $("#scoreDisplay").html("Social credit score: " + total);
+ document.title = data["title"];
+ $("#gameTitle").html(data["title"]);
+ $(".playAgain").html(data["playAgain"]);
+ $("#looseTitle").html(data["loose"]["title"]);
+ $("#looseDescription").html(data["loose"]["description"]);
+ $("#winTitle").html(data["win"]["title"]);
+ $("#winSubtitle").html(data["win"]["subtitle"]);
+ $("#winDescription").html(data["win"]["description"]);
+ $("#scoreDisplay").html(data["socialCreditScore"]+": " + total);
for (var i = 0; i < data["questions"].length; i++) {
indexeslist.push(i);
}
- $("#progress").html("1 of " + indexeslist.length);
+ $("#progress").html("1 "+data["of"]+" " + indexeslist.length);
shuffle(indexeslist);
displayQuestion();
}
@@ -51,7 +65,7 @@ function displayQuestion() {
$("html, body").scrollTop(0);
if (total < 1) {
audio.pause();
- audio = new Audio('assets/music/anthem.mp3');
+ audio = new Audio('../assets/music/anthem.mp3');
audio.play();
$("#loose").show();
}
@@ -84,7 +98,7 @@ function displayQuestion() {
else {
audio.pause();
sef("applause");
- audio = new Audio('assets/music/march_vol_charged.mp3');
+ audio = new Audio('../assets/music/march_vol_charged.mp3');
audio.play();
$("#win").show();
}
@@ -133,10 +147,10 @@ $(".ans").mouseleave(function () {
// ***8888888************************************8
$(".ans").click(function () {
- $("#progress").html(indexesProgress + 1 + " of " + indexeslist.length);
+ $("#progress").html(indexesProgress + 1 + " " + data["of"] + " " + indexeslist.length);
var res = cQuestion["answers"][$(this).attr("data-ans") - 1]["effect"];
total += res;
- $("#scoreDisplay").html("Social credit score: " + total);
+ $("#scoreDisplay").html(data["socialCreditScore"] + ": " + total);
var d = Math.random();
if (d < 0.10) {
d = Math.random();
diff --git a/js/util.js b/assets/js/util.js
similarity index 59%
rename from js/util.js
rename to assets/js/util.js
index bb33096..a0bb032 100644
--- a/js/util.js
+++ b/assets/js/util.js
@@ -14,4 +14,18 @@ function shuffle(array) {
}
return array;
+
+}
+
+function getParam(parameterName) {
+ var result = null,
+ tmp = [];
+ location.search
+ .substr(1)
+ .split("&")
+ .forEach(function (item) {
+ tmp = item.split("=");
+ if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
+ });
+ return result;
}
\ No newline at end of file
diff --git a/data.yaml b/data_en.yaml
similarity index 92%
rename from data.yaml
rename to data_en.yaml
index 3e35a9f..0d41102 100644
--- a/data.yaml
+++ b/data_en.yaml
@@ -1,14 +1,25 @@
initialScore: 10000
+title: Social Credit Score Test
+socialCreditScore: Social Credit Score
+of: of
+loose:
+ title: Your social credit score is too low
+ description: Your execution is scheduled tomorrow at sunset
+win:
+ title: Congratulations!
+ subtitle: Your social credit score is high enough
+ description: You are worthy of the Chinese Dream
+playAgain: Play again
questions:
- title: 'Who''s the best (and sexiest) president ever:'
answers:
- - text:
+ - text:
effect: 2000
- - text:
+ - text:
effect: -9999
- - text:
+ - text:
effect: -9999
- - text:
+ - text:
effect: -9999
- title: Is Taiwan a country
answers:
diff --git a/data_it.yaml b/data_it.yaml
new file mode 100644
index 0000000..dfd3161
--- /dev/null
+++ b/data_it.yaml
@@ -0,0 +1,277 @@
+initialScore: 10000
+title: Test del Punteggio di Credito Sociale
+socialCreditScore: Punteggio di Credito Sociale
+of: di
+loose:
+ title: Il tuo punteggio di credito sociale è troppo basso
+ description: La tua esecuzione è programmata per domani al tramonto
+win:
+ title: Congratulazioni!
+ subtitle: Il tuo punteggio di credito sociale è abbastanza alto
+ description: Sei degno di essere un cittadino cinese
+playAgain: Gioca di nuovo
+questions:
+ - title: 'Chi è il miglior (e più sexy) presidente di sempre:'
+ answers:
+ - text:
+ effect: 2000
+ - text:
+ effect: -9999
+ - text:
+ effect: -9999
+ - text:
+ effect: -9999
+ - title: Taiwan è uno stato?
+ answers:
+ - text: 'Sì'
+ effect: -1001
+ - text: 'No'
+ effect: 700
+ - text: Che cos'è Taiwan?
+ effect: 3000
+ - title: Quante partiti sono ammessi in Cina?
+ answers:
+ - text: Uno
+ effect: 1200
+ - text: Molti
+ effect: -5000
+ - text: Solo il partito comunista
+ effect: 7000
+ - title: Cosa è successo in piazza Tienanmen nel 1989?
+ answers:
+ - text: Nulla
+ effect: 1200
+ - text: Qualcosa
+ effect: -5000
+ - text: Che cos'è piazza Tienanmen?
+ effect: 1000
+ - title: Usi i social media occidentali?
+ answers:
+ - text: 'No'
+ effect: 1200
+ - text: 'Sì'
+ effect: -5000
+ - title: Tieni degli Uiguri nascosti a casa tua?
+ answers:
+ - text: 'No'
+ effect: 1200
+ - text: 'Sì'
+ effect: -5000
+ - title: Hai viaggiato recentemente all'estero?
+ answers:
+ - text: 'No'
+ effect: 1200
+ - text: 'Sì'
+ effect: -5000
+ - text: Per espandere l'influenza della Cina
+ effect: 1400
+ - title: Pensi che dovremmo rispettare l'ambiente?
+ answers:
+ - text: 'No'
+ effect: 1200
+ - text: 'Sì'
+ effect: -5000
+ - text: Voglio nuovamente espandere l'influenza della Cina
+ effect: 600
+ - title: Supporti l'indipendenza di Hong Kong?
+ answers:
+ - text: 'No'
+ effect: 1200
+ - text: 'Sì'
+ effect: -5000
+ - title: Ti piacerebbe un sistema multipartitico?
+ answers:
+ - text: 'Sì'
+ effect: -7200
+ - text: 'No'
+ effect: 5000
+ - text: Gloria al Partito Comunista Cinese
+ effect: 9000
+ - title: Tuo padre sta andando in un campo di rieducazione
+ answers:
+ - text: No!
+ effect: -7200
+ - text: Sì!
+ effect: 5000
+ - title: Quale paese è il migliore?
+ answers:
+ - text: America
+ effect: -1000
+ - text: Non la Cina
+ effect: -6969
+ - text: Cina
+ effect: 3000
+ - text: Taiwan
+ effect: -5000
+ - title: Quante ore di videogiochi giochi al giorno?
+ answers:
+ - text: '1'
+ effect: 1000
+ - text: Cosa sono i videogiochi?
+ effect: 609
+ - text: '3'
+ effect: 500
+ - text: più di 3 ore
+ effect: -1000
+ - title: Pensieri sul comunismo?
+ answers:
+ - text: Lo odio
+ effect: -2000
+ - text: Lo amo
+ effect: -609
+ - text: Noi lo amiamo
+ effect: 1500
+ - text: Che cos'è il comunismo?
+ effect: -10
+ - title: Ti piace internet in Cina?
+ answers:
+ - text: Uso VPN
+ effect: -1000
+ - text: 'Sì'
+ effect: 2000
+ - text: Forse
+ effect: -1000
+ - text: Non lo uso
+ effect: 1
+ - title: Cosa pensi del coinvolgimento della Cina negli affari internazionali?
+ answers:
+ - text: Influenza positiva
+ effect: 2500
+ - text: Controllo ed espansionismo
+ effect: -3000
+ - text: Non lo so
+ effect: 1000
+ - text: 'Sì'
+ effect: 10
+ - title: Come ti senti riguardo al patrimonio culturale e alle tradizioni della Cina?
+ answers:
+ - text: La diversità deve essere preservata
+ effect: -2000
+ - text: Dovremmo rispettare tutti
+ effect: -1000
+ - text: Voglio solo l'etnia Han
+ effect: 1000
+ - text: Tradizioni?
+ effect: 1000
+ - title: Qual è stato l'effetto della politica del figlio unico?
+ answers:
+ - text: Buono, il PCC è infallibile
+ effect: 2000
+ - text: Buono
+ effect: 1000
+ - text: Non lo so
+ effect: -1000
+ - text: Male
+ effect: -2000
+ - title: Cosa pensi del "Grande Firewall"?
+ answers:
+ - text: Lo adoro
+ effect: 2000
+ - text: È necessario
+ effect: 1000
+ - text: Non mi piace
+ effect: -1000
+ - text: Lo odio
+ effect: -2000
+ - title: Cos'è la censura?
+ answers:
+ - text: Censura? Tutte bugie
+ effect: 2000
+ - text: Abbiamo bisogno di unità
+ effect: 1000
+ - text: Credo nei diritti umani
+ effect: -1000
+ - text: Che cosa?
+ effect: 2000
+ - title: Qual è il tuo preferito tra i seguenti?
+ answers:
+ - text: Il Presidente Mao
+ effect: 2000
+ - text: Deng Xiaoping
+ effect: 1000
+ - text: Ronald Regan
+ effect: -2000
+ - text: Zhao Ziyang
+ effect: -2000
+ - title: Chi è stato il fondatore del PCC?
+ answers:
+ - text: Deng Xiaoping
+ effect: -500
+ - text: Chiang Kai-shek
+ effect: -1000
+ - text: Mao Zedong
+ effect: 2000
+ - text: Xi Jinping
+ effect: -300
+ - title: Hai mai sentito parlare di "Winnie The Pooh"?
+ answers:
+ - text: "No"
+ effect: 1000
+ - text: Odio quel cartone animato occidentale
+ effect: 2000
+ - text: Xi Jinping
+ effect: -2000
+ - title: Il 4 giugno è un giorno importante per te?
+ answers:
+ - text: "No"
+ effect: 2000
+ - text: Sì!
+ effect: -1000
+ - text: "Aspetta un attimo..."
+ effect: -2000
+ - title: Qual è la tua opinione sull'iniziativa Belt and Road della Cina?
+ answers:
+ - text: È una grande opportunità per lo sviluppo globale
+ effect: 3000
+ - text: È una forma di diplomazia che intrappola col debito
+ effect: -2000
+ - text: Non ne sono sicuro
+ effect: 1000
+ - title: Come ti senti riguardo all'espansione militare della Cina nel Mar Cinese Meridionale?
+ answers:
+ - text: È necessaria per la sicurezza nazionale
+ effect: 2000
+ - text: È aggressiva e destabilizzante
+ effect: -3000
+ - text: Non ho opinioni
+ effect: 500
+ - title: Pensieri sul sistema di credito sociale della Cina?
+ answers:
+ - text: È un ottimo modo per mantenere l'ordine sociale
+ effect: 2000
+ - text: È una violazione delle libertà personali
+ effect: -3000
+ - text: Sono indifferente
+ effect: 500
+ - title: Credi nel concetto di "Un Paese, Due Sistemi" per Hong Kong?
+ answers:
+ - text: Sì, è un accordo equo
+ effect: -1500
+ - text: No, Hong Kong dovrebbe essere completamente integrata nella Cina
+ effect: 2000
+ - text: Non ne sono familiare
+ effect: 1000
+ - title: Qual è la tua opinione sulla posizione della Cina sui diritti umani?
+ answers:
+ - text: La Cina sta migliorando il suo status sui diritti umani
+ effect: 2000
+ - text: Gli abusi dei diritti umani della Cina sono preoccupanti
+ effect: -3000
+ - text: Non so abbastanza per commentare
+ effect: 1000
+ - title: Come ti senti riguardo alle relazioni della Cina con la Corea del Nord?
+ answers:
+ - text: È un'alleanza strategica necessaria
+ effect: 2000
+ - text: La Cina dovrebbe prendere le distanze dalla Corea del Nord
+ effect: -2500
+ - text: Non sono familiare con la loro relazione
+ effect: 1000
+ - title: Qual è la tua opinione sull'approccio della Cina alla tecnologia e all'innovazione?
+ answers:
+ - text: La Cina sta guidando nell'avanzamento tecnologico
+ effect: 2000
+ - text: La Cina si dedica al furto di proprietà intellettuale
+ effect: -3000
+ - text: Non ho sentimenti forti a riguardo
+ effect: 500
\ No newline at end of file
diff --git a/game/index.html b/game/index.html
new file mode 100644
index 0000000..09f8373
--- /dev/null
+++ b/game/index.html
@@ -0,0 +1,91 @@
+
+
+
+
Your execution is scheduled tomorrow at sunset
- Play again -Your social credit score is high enough
-You are worthy of the Chinese Dream
- Play again -