diff --git a/code/html5/index.html b/code/html5/index.html index febff8d..dc2a777 100644 --- a/code/html5/index.html +++ b/code/html5/index.html @@ -6,9 +6,6 @@ - - +.relations .rid0 { background-image: url("img/rel/0.png"); } +.relations .rid5 { background-image: url("img/rel/5.png"); } +.relations .rid7 { background-image: url("img/rel/7.png"); } +.relations .rid9 { background-image: url("img/rel/9.png"); } +.relations .rid10 { background-image: url("img/rel/10.png"); } + +.relations .hot { + background-color: yellow; +} + @@ -85,7 +55,7 @@ body {
- +
diff --git a/code/html5/pticlic.js b/code/html5/pticlic.js index a4dfe98..f5dc7cc 100644 --- a/code/html5/pticlic.js +++ b/code/html5/pticlic.js @@ -1,31 +1,78 @@ function jss() { var w=480, h=800; var mch = h/8, mnh = h*0.075; + + $("body") + .css({ + padding: 0, + margin: 0, + textAlign: "left" + }); + $("#screen") .width(w) .height(h) + .position({my:"center center", at:"center center", of:"body", collision:"none"}); $("#mc-caption-block") + .css({ + position: "absolute" + }) .width(w) .height(mch) .position({my:"center top", at:"center top", of:"#screen", collision:"none"}); + $("#mc-caption") + .css({ + maxWidth: w*0.9, + textAlign: "center", + position: "absolute" + }) .fitFont(w*0.9, mch*0.9, 20) - .css("max-width", w*0.9) .position({my:"center center", at:"center center", of:"#mc-caption-block", collision:"none"}); $("#mn-caption-block") + .css({ + borderWidth: h/100, + position: "absolute" + }) .width(w) .height(mnh) - .css("border-width", h/100) .position({my:"center top", at:"center bottom", of:"#mc-caption-block", collision:"none"}); + $("#mn-caption") + .css({ + maxWidth: w*0.9, + textAlign: "center", + position: "absolute" + }) .fitFont(w*0.9, mnh*0.9, 20) - .css("max-width", w*0.9) .position({my:"center center", at:"center center", of:"#mn-caption-block", collision:"none"}); + + $(".relations > div") + .css({ + margin: 10, + height: 72, + padding: 10, + }); - $("#screen") - .position({my:"center center", at:"center center", of:"body", collision:"none"}); + // TODO : fitFont pour ".relations div" + $(".relations > div:nth-child(odd)") + .css({ + backgroundPosition: "2% center", // TODO : virer le pourcentage, et séparer l'icône dans un nouvel élément. + textAlign: "right", + paddingLeft: 76 + }); + + $(".relations > div:nth-child(even)") + .css({ + backgroundPosition: "98% center", // TODO : virer le pourcentage, et séparer l'icône dans un nouvel élément. + textAlign: "left", + paddingRight: 76 + }); + + $(".relations") + .position({my:"center bottom", at:"center bottom", of:"#screen", offset:"0 -10", collision:"none"}); } @@ -53,11 +100,14 @@ $(function () { .addClass("rid"+cat.id) .click(function() { answers[currentWordNb++] = cat.id; + $(this).addClass("hot")//.delay(500).removeClass("hot"); // TODO: just blink. refresh(); }) .appendTo(".relations"); }); + $(window).resize(jss); refresh(); + refresh(); // TODO : fix the bug with the margin on ".relation > div" }); });