From ed3c268c32c36a060a110d9810e34b204cd13df5 Mon Sep 17 00:00:00 2001 From: Nicky Case Date: Thu, 27 Jul 2017 12:49:04 -0400 Subject: [PATCH] TOOLTIPS for CHARACTERS --- css/slides.css | 2 ++ js/core/Button.js | 10 ++++++++++ js/slides/0_Slides_Intro.js | 7 ++++++- js/slides/3_Slides_Tournament.js | 10 ++++++++++ js/slides/4_Slides_Evolution.js | 10 ++++++++++ js/slides/6_Slides_Noise.js | 20 +++++++++++++++++++ words.html | 34 ++++++++++++++++++++++++++++++++ 7 files changed, 92 insertions(+), 1 deletion(-) diff --git a/css/slides.css b/css/slides.css index 5fe8382..c0ec514 100644 --- a/css/slides.css +++ b/css/slides.css @@ -170,6 +170,8 @@ s{ transform-origin: 97.5px 27.5px; transition: transform 0.1s ease-out; + + text-align: center; } .button #background{ position: absolute; diff --git a/js/core/Button.js b/js/core/Button.js index 995d39c..955e24c 100644 --- a/js/core/Button.js +++ b/js/core/Button.js @@ -20,6 +20,16 @@ function Button(config){ if(config.size) button.setAttribute("size", config.size); self.dom = button; + // TOOLTIP? + if(config.tooltip){ + self.dom.style.width = 190; + self.dom.style.height = 55; + self.dom.style.position = "absolute"; + self.dom.setAttribute("data-balloon-length", "large"); + self.dom.setAttribute("data-balloon", Words.get(config.tooltip)); + self.dom.setAttribute("data-balloon-pos", "left"); + } + // BG var bg = document.createElement("div"); bg.id = "background"; diff --git a/js/slides/0_Slides_Intro.js b/js/slides/0_Slides_Intro.js index 2197c5e..fc7ce7c 100644 --- a/js/slides/0_Slides_Intro.js +++ b/js/slides/0_Slides_Intro.js @@ -32,7 +32,12 @@ Loader.addToManifest(Loader.manifest,{ cssAsset12: "assets/tournament/score_small.png", // Music! - bg_music: "assets/sounds/bg_music.mp3" + bg_music: "assets/sounds/bg_music.mp3", + + // IMAGE BOXES + image1: "assets/evolution/evolution_intro.png", + image2: "assets/conclusion/summary.png", + image3: "assets/conclusion/truce.jpg", }); diff --git a/js/slides/3_Slides_Tournament.js b/js/slides/3_Slides_Tournament.js index 4db4dca..1ef7586 100644 --- a/js/slides/3_Slides_Tournament.js +++ b/js/slides/3_Slides_Tournament.js @@ -33,6 +33,7 @@ SLIDES.push({ self.add({ id:"bet_"+character, type:"Button", x:x, y:y, text_id: "icon_"+character, + tooltip: "who_"+character, onclick:function(){ _.answer = character; publish("slideshow/next"); @@ -45,6 +46,14 @@ SLIDES.push({ _addButton("all_d", 510, 300+25); _addButton("grudge", 730, 300+25); _addButton("prober", 510, 380+25); + + // WHO'S WHO? + self.add({ + id:"forgot", type:"TextBox", + x:728, y:408, width:200, height:50, + align:"center", color:"#aaa", size:16, + text_id:"forgot_whos_who" + }); }, onend: function(self){ @@ -53,6 +62,7 @@ SLIDES.push({ self.remove("bet_all_d"); self.remove("bet_grudge"); self.remove("bet_prober"); + self.remove("forgot"); } }); diff --git a/js/slides/4_Slides_Evolution.js b/js/slides/4_Slides_Evolution.js index 8972225..baa7add 100644 --- a/js/slides/4_Slides_Evolution.js +++ b/js/slides/4_Slides_Evolution.js @@ -81,6 +81,7 @@ SLIDES.push({ self.add({ id:"bet_"+character, type:"Button", x:x, y:y, text_id: "icon_"+character, + tooltip: "who_"+character, onclick:function(){ _.answer = character; publish("slideshow/next"); @@ -92,11 +93,20 @@ SLIDES.push({ _addButton("all_d", 510, 295+70); _addButton("tft", 510, 295+70*2); + // WHO'S WHO? + self.add({ + id:"forgot", type:"TextBox", + x:728, y:428, width:200, height:50, + align:"center", color:"#aaa", size:16, + text_id:"forgot_whos_who" + }); + }, onend: function(self){ self.remove("bet_tft"); self.remove("bet_all_c"); self.remove("bet_all_d"); + self.remove("forgot"); } }); diff --git a/js/slides/6_Slides_Noise.js b/js/slides/6_Slides_Noise.js index b9c30d7..de0b848 100644 --- a/js/slides/6_Slides_Noise.js +++ b/js/slides/6_Slides_Noise.js @@ -188,6 +188,7 @@ SLIDES.push({ self.add({ id:"bet_"+character, type:"Button", x:x, y:y, text_id: "icon_"+character, + tooltip: "who_"+character, onclick:function(){ _.answer = character; publish("slideshow/next"); @@ -203,6 +204,14 @@ SLIDES.push({ _addButton("random", x, y+dy); _addButton("tft", x+dx, y+dy); _addButton("all_c", x, y+dy*2); + // WHO'S WHO? + self.add({ + id:"forgot", type:"TextBox", + x:715, y:435, width:190, height:50, + align:"center", color:"#aaa", size:15, + text_id:"forgot_whos_who" + }); + }, onend: function(self){ self.remove("bet_all_c"); @@ -210,6 +219,7 @@ SLIDES.push({ self.remove("bet_tf2t"); self.remove("bet_pavlov"); self.remove("bet_random"); + self.remove("forgot"); } }); @@ -331,6 +341,7 @@ SLIDES.push({ self.add({ id:"bet_"+character, type:"Button", x:x, y:y, text_id: "icon_"+character, + tooltip: "who_"+character, onclick:function(){ _.answer = character; publish("slideshow/next"); @@ -346,6 +357,14 @@ SLIDES.push({ _addButton("random", x, y+dy); _addButton("tft", x+dx, y+dy); _addButton("all_d", x, y+dy*2); + // WHO'S WHO? + self.add({ + id:"forgot", type:"TextBox", + x:715, y:435, width:190, height:50, + align:"center", color:"#aaa", size:15, + text_id:"forgot_whos_who" + }); + }, onend: function(self){ self.remove("bet_all_d"); @@ -353,6 +372,7 @@ SLIDES.push({ self.remove("bet_tf2t"); self.remove("bet_pavlov"); self.remove("bet_random"); + self.remove("forgot"); } }); diff --git a/words.html b/words.html index 16e220f..5288be2 100644 --- a/words.html +++ b/words.html @@ -1055,6 +1055,40 @@ random

+

+(forgot who's who? hover buttons to see descriptions of each character!) +

+

+Starts with Cooperate. Then, it simply repeats whatever YOU did in the last round. +

+

+Always cheats. +

+

+Always cooperates. +

+

+Starts with Cooperate, and keeps cooperating until you cheat it even once. +Afterwards, it always plays Cheat. +

+

+Starts with: Cooperate, Cheat, Cooperate, Cooperate. +Afterwards, if you ever retaliate with a Cheat, it plays like a Copycat. +Otherwise, it plays like an Always Cheat. +

+

+Starts with Cooperate. +Only retaliates with a Cheat if you cheated it TWICE in a row. +

+

+Starts with Cooperate. +Then, if you cooperated in last round, it repeats its last move (even if it was an accident). +But if you cheated in last round, it switches its last move (even if it was an accident). +

+

+Randomly cheats or cooperates with 50-50 chance +

+