From 5ca49c43a270cf723b2360dc4909a823d18bf340 Mon Sep 17 00:00:00 2001 From: davbrican <72500941+davbrican@users.noreply.github.com> Date: Wed, 17 Nov 2021 17:50:58 +0100 Subject: [PATCH 1/2] Update Playground.vue --- src/pages/Playground.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/Playground.vue b/src/pages/Playground.vue index 9f97774..5f3c064 100644 --- a/src/pages/Playground.vue +++ b/src/pages/Playground.vue @@ -393,6 +393,14 @@ export default { } this.clearResult(); + var el = document.createElement("div"); + el.setAttribute("style","position:absolute;top:50%;left:50%;background-color: rgb(160, 174, 192);"); + el.innerHTML = "Nuevo ejercicio"; + setTimeout(function(){ + el.parentNode.removeChild(el); + },2000); + document.body.appendChild(el); + dbg("method changeExercise - init - Emiting event changeExercise with exercisedCharged: true"); this.$socket.client.emit("changeExercise", {code: localStorage.code, exercisedCharged: true}); }, From 39255c10bab6d8e30b43fe4aab8ccebe37287245 Mon Sep 17 00:00:00 2001 From: davbrican <72500941+davbrican@users.noreply.github.com> Date: Wed, 17 Nov 2021 18:49:52 +0100 Subject: [PATCH 2/2] Update Playground.vue --- src/pages/Playground.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pages/Playground.vue b/src/pages/Playground.vue index 5f3c064..b8537ad 100644 --- a/src/pages/Playground.vue +++ b/src/pages/Playground.vue @@ -393,16 +393,19 @@ export default { } this.clearResult(); + dbg("method changeExercise - init - Emiting event changeExercise with exercisedCharged: true"); + this.$socket.client.emit("changeExercise", {code: localStorage.code, exercisedCharged: true}); + }, + customAlert(pack) { var el = document.createElement("div"); - el.setAttribute("style","position:absolute;top:50%;left:50%;background-color: rgb(160, 174, 192);"); - el.innerHTML = "Nuevo ejercicio"; + el.setAttribute("style","position:absolute;top:50%;left:40%;width: 20%;height: 20%;text-align: center;background-color: rgba(140, 203, 249, 0.2);border: 2px dashed #34d037;line-height: 650%;"); + el.innerHTML = pack.data.message; setTimeout(function(){ el.parentNode.removeChild(el); - },2000); + }, 2000); document.body.appendChild(el); - dbg("method changeExercise - init - Emiting event changeExercise with exercisedCharged: true"); - this.$socket.client.emit("changeExercise", {code: localStorage.code, exercisedCharged: true}); + dbg("method customAlert - init "); }, reconnect() { dbg("EVENT reconnect");