summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorliwencTaiwan <Liwen@Liwens-MBP.wv.cc.cmu.edu>2016-10-14 13:33:01 -0400
committerliwencTaiwan <Liwen@Liwens-MBP.wv.cc.cmu.edu>2016-10-14 13:33:01 -0400
commitad2fbe28d4e345c9b100f47eef2da0b8f76ff9a5 (patch)
tree98996910444e89e9342acada93ae431dba1c3ff5 /webapp
parent86761b1f1075953a08944d178b05c0b3c259d243 (diff)
downloadbridge-ad2fbe28d4e345c9b100f47eef2da0b8f76ff9a5.tar.zst
Add img-disable css and usage
The “socket.on(enable/disable image)” haven’t been tested.
Diffstat (limited to 'webapp')
-rw-r--r--webapp/app/static/carousel.css10
-rw-r--r--webapp/app/templates/index.html24
2 files changed, 32 insertions, 2 deletions
diff --git a/webapp/app/static/carousel.css b/webapp/app/static/carousel.css
index 9ef5474..4e49305 100644
--- a/webapp/app/static/carousel.css
+++ b/webapp/app/static/carousel.css
@@ -93,6 +93,14 @@ body {
letter-spacing: -1px;
}
+img.img-disable {
+ -webkit-filter: grayscale(100%);
+ -moz-filter: grayscale(100%);
+ -o-filter: grayscale(100%);
+ -ms-filter: grayscale(100%);
+ filter: grayscale(100%);
+ opacity: 0.5;
+}
/* RESPONSIVE CSS
-------------------------------------------------- */
@@ -133,6 +141,4 @@ body {
margin-top: 120px;
}
-
-
}
diff --git a/webapp/app/templates/index.html b/webapp/app/templates/index.html
index 3592985..4dadb7b 100644
--- a/webapp/app/templates/index.html
+++ b/webapp/app/templates/index.html
@@ -124,6 +124,23 @@
var c = new creature(msg.name, socket);
c.render($('#creatures'));
});
+
+ socket.on('enable image', function(msg) {
+ console.log('enable image');
+ // to be tested
+ var name = msg.name;
+ var myImgElement = $("#" + name);
+ myImgElement.removeClass('img-disable');
+
+ });
+
+ socket.on('disable image', function(msg) {
+ console.log('disable image');
+ // to be tested
+ var name = msg.name;
+ var myImgElement = $("#" + name);
+ myImgElement.addClass('img-disable');
+ });
socket.on('disconnect', function() {
console.log('disconnected');
@@ -134,6 +151,13 @@
function clickImg(element) {
console.log(element.id);
+
+ //-----Testing------------------
+ //var name = element.id;
+ //var myImgElement = $("#" + name);
+ //myImgElement.addClass('img-disable');
+ // -----------------------------
+
var c = new creature(element.id, socket);
c.click()
}