commit fe0313492417260f9f2eb584ae1d7dce714d5cb0 parent ac8ef724edf1cca08d6f0a9d727ddea8e8e3f5f7 Author: Georges Dupéron <jahvascriptmaniac+github@free.fr> Date: Thu, 28 Apr 2011 18:12:42 +0200 Les icônes changent automatiquement de taille. Diffstat:
36 files changed, 42 insertions(+), 31 deletions(-)
diff --git a/code/serveur/php/jeu.html b/code/serveur/php/jeu.html @@ -66,19 +66,19 @@ body { <span id="title">PtiClic</span> <div class="frontpage-button game"> - <div><img class="icon" alt="" src="ressources/img/mode_normal.png" /></div> + <div><img class="icon" alt="" src="ressources/img/72/default.png" /></div> <div class="text">Jouer</div> </div> <div class="frontpage-button prefs"> - <div><img class="icon" alt="" src="ressources/img/config.png" /></div> + <div><img class="icon" alt="" src="ressources/img/72/default.png" /></div> <div class="text">Configuration</div> </div> <div class="frontpage-button connection"> - <div><img class="icon" alt="" src="ressources/img/config.png" /></div> + <div><img class="icon" alt="" src="ressources/img/72/default.png" /></div> <div class="text">Connexion</div> </div> <div class="frontpage-button about"> - <div><img class="icon" alt="" src="ressources/img/rel/default.png" /></div> + <div><img class="icon" alt="" src="ressources/img/72/default.png" /></div> <div class="text">A Propos</div> </div> </div> @@ -89,7 +89,7 @@ body { </div> <div id="templates" style="display: none;"> <div class="relationBox"> - <div class="relation"><img class="icon" alt="" src="ressources/img/rel/default.png" /><span class="text"></span></div> + <div class="relation"><img class="icon" alt="" src="ressources/img/72/default.png" /><span class="text"></span></div> <div class="clearboth"></div> </div> <div class="scoreLine"> diff --git a/code/serveur/php/ressources/img/36/-1.png b/code/serveur/php/ressources/img/36/-1.png Binary files differ. diff --git a/code/serveur/php/ressources/img/36/0.png b/code/serveur/php/ressources/img/36/0.png Binary files differ. diff --git a/code/serveur/php/ressources/img/36/10.png b/code/serveur/php/ressources/img/36/10.png Binary files differ. diff --git a/code/serveur/php/ressources/img/36/5.png b/code/serveur/php/ressources/img/36/5.png Binary files differ. diff --git a/code/serveur/php/ressources/img/36/7.png b/code/serveur/php/ressources/img/36/7.png Binary files differ. diff --git a/code/serveur/php/ressources/img/36/9.png b/code/serveur/php/ressources/img/36/9.png Binary files differ. diff --git a/code/serveur/php/ressources/img/36/aide.png b/code/serveur/php/ressources/img/36/aide.png Binary files differ. diff --git a/code/serveur/php/ressources/img/36/config.png b/code/serveur/php/ressources/img/36/config.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/default.png b/code/serveur/php/ressources/img/36/default.png Binary files differ. diff --git a/code/serveur/php/ressources/img/36/mode_normal.png b/code/serveur/php/ressources/img/36/mode_normal.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/-1.png b/code/serveur/php/ressources/img/48/-1.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/0.png b/code/serveur/php/ressources/img/48/0.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/10.png b/code/serveur/php/ressources/img/48/10.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/5.png b/code/serveur/php/ressources/img/48/5.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/7.png b/code/serveur/php/ressources/img/48/7.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/9.png b/code/serveur/php/ressources/img/48/9.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/aide.png b/code/serveur/php/ressources/img/48/aide.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/config.png b/code/serveur/php/ressources/img/48/config.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/default.png b/code/serveur/php/ressources/img/48/default.png Binary files differ. diff --git a/code/serveur/php/ressources/img/48/mode_normal.png b/code/serveur/php/ressources/img/48/mode_normal.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/-1.png b/code/serveur/php/ressources/img/72/-1.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/0.png b/code/serveur/php/ressources/img/72/0.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/10.png b/code/serveur/php/ressources/img/72/10.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/5.png b/code/serveur/php/ressources/img/72/5.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/7.png b/code/serveur/php/ressources/img/72/7.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/9.png b/code/serveur/php/ressources/img/72/9.png Binary files differ. diff --git a/code/serveur/php/ressources/img/aide.png b/code/serveur/php/ressources/img/72/aide.png Binary files differ. diff --git a/code/serveur/php/ressources/img/config.png b/code/serveur/php/ressources/img/72/config.png Binary files differ. diff --git a/code/serveur/php/ressources/img/rel/default.png b/code/serveur/php/ressources/img/72/default.png Binary files differ. diff --git a/code/serveur/php/ressources/img/mode_normal.png b/code/serveur/php/ressources/img/72/mode_normal.png Binary files differ. diff --git a/code/serveur/php/ressources/img/mode_chrono.png b/code/serveur/php/ressources/img/mode_chrono.png Binary files differ. diff --git a/code/serveur/php/ressources/img/mode_marathon.png b/code/serveur/php/ressources/img/mode_marathon.png Binary files differ. diff --git a/code/serveur/php/ressources/img/mode_ombre.png b/code/serveur/php/ressources/img/mode_ombre.png Binary files differ. diff --git a/code/serveur/php/ressources/my-extensions.js b/code/serveur/php/ressources/my-extensions.js @@ -13,8 +13,7 @@ function dichotomy(start, isBigger, foo) { if (!isBigger(half)) min = half; else max = half; } - while (half > 1 && isBigger(half)) { --half; ++i; } - console.log(i,foo); + while (half > 1 && isBigger(half)) { --half; } return half; } catch(e) {alert("Error dichotomy");alert(e);} } diff --git a/code/serveur/php/ressources/pticlic.js b/code/serveur/php/ressources/pticlic.js @@ -55,31 +55,36 @@ function hashchange() { // ==== JavaScript Style général function jss() { try { - var w = $(window).width(); - var h = $(window).height(); - var iconSize; - if (h > 600) iconSize = 72; - else if(h > 500) iconSize = 48; - else iconSize = 36; - - $(".screen") - .wh(w, h) - .northWest({top:0,left:0}); - - $("body, html") - .css({ - padding: 0, - margin: 0, - overflow: "hidden", - textAlign: "left" + var w = $(window).width(); + var h = $(window).height(); + var iconSize; + if (h > 600) iconSize = 72; + else if(h > 500) iconSize = 48; + else iconSize = 36; + + $(".screen") + .wh(w, h) + .northWest({top:0,left:0}); + + $("body, html") + .css({ + padding: 0, + margin: 0, + overflow: "hidden", + textAlign: "left" + }); + + $(".screen").hide(); + $("#"+state.screen+".screen").show(); + + if (window[state.screen] && window[state.screen].jss) window[state.screen].jss(w, h, iconSize); + + $("img.icon").each(function(i,e) { + e=$(e); + if (typeof(e.data('image')) != 'undefined') + e.attr("src", "ressources/img/"+iconSize+"/"+e.data('image')+".png"); }); - - $(".screen").hide(); - $("#"+state.screen+".screen").show(); - - if (window[state.screen] && window[state.screen].jss) window[state.screen].jss(w, h, iconSize); } catch(e) {alert("Error jss");alert(e);} - window.console && console.log("ok"); } // ==== Interface Android function UI () { @@ -148,8 +153,15 @@ frontpage.jss = function(w, h, iconSize) { $fp(".text") .fitFont(buttonWidth, labelHeight, 10); + $fp(".icon") .wh(iconSize); + + $fp(".game .icon").data('image', 'mode_normal'); + $fp(".prefs .icon").data('image', 'config'); + $fp(".connection .icon").data('image', 'config'); + $fp(".about .icon").data('image', 'aide'); + $fp(".frontpage-button") .css('text-align', 'center') .width(buttonWidth); @@ -296,7 +308,7 @@ game.buildUi = function () { .html(relation.name.replace(/%(m[cn])/g, '<span class="$1"/>')) .end() .find(".icon") - .attr("src", "ressources/img/rel/"+relation.id+".png") + .data("image",relation.id) .end() .click(function(e) { game.nextWord({left:e.pageX, top:e.pageY}, this);