Commit f4e7f711d595d1bfc23dfc35cc0f220e400bd4b5
1 parent
bb7233b2
Exists in
master
and in
1 other branch
Ajustes na tela de configuração de ponto de articulação.
Showing
4 changed files
with
54 additions
and
22 deletions
Show diff stats
view/assets/css/articulation.css
| 1 | 1 | .gray-background { |
| 2 | 2 | background-repeat: no-repeat; |
| 3 | - background-position: center 15px, 0 0; | |
| 4 | 3 | background-size: 67% 95%, 100% 100%; |
| 5 | 4 | min-width: 285px; |
| 6 | 5 | min-height: 361px |
| 7 | 6 | } |
| 8 | 7 | |
| 9 | -.gray-front-avatar { | |
| 8 | +.right-hand-gray-front-avatar { | |
| 10 | 9 | background-image: url(../../img/pa/gray-front-avatar.png), url(../../img/pa/default-base.png); |
| 10 | + background-position: 100px 15px, 0 0; | |
| 11 | +} | |
| 12 | + | |
| 13 | +.left-hand-gray-front-avatar { | |
| 14 | + background-image: url(../../img/pa/gray-front-avatar.png), url(../../img/pa/default-base.png); | |
| 15 | + background-position: 5px 15px, 0 0; | |
| 11 | 16 | } |
| 12 | 17 | |
| 13 | 18 | .gray-side-avatar { |
| 14 | 19 | background-image: url(../../img/pa/gray-side-avatar.png), url(../../img/pa/default-base.png); |
| 20 | + background-position: center 15px, 0 0; | |
| 15 | 21 | } |
| 16 | 22 | |
| 17 | 23 | .module-x-y { | ... | ... |
view/assets/js/articulation.js
| 1 | 1 | (function(articulation, $, undefined) { |
| 2 | 2 | |
| 3 | - function _updateASelector(container, ballSelector, serverhost) { | |
| 3 | + var server_host = ""; | |
| 4 | + | |
| 5 | + function _updateASelector(container, ballSelector) { | |
| 4 | 6 | $(container + " .ball-selector.active").each(function() { |
| 5 | 7 | $(this).removeClass("active"), $(this).find(".point-a-selector").remove() |
| 6 | - }), ballSelector.addClass("active"), ballSelector.append('<div class="point-a-selector"><img src="' + serverhost + | |
| 8 | + }), ballSelector.addClass("active"), ballSelector.append('<div class="point-a-selector"><img src="' + server_host + | |
| 7 | 9 | '/img/pa/A-Seletor.png" class="point-a-selector" alt=""></div>') |
| 8 | 10 | } |
| 9 | 11 | |
| ... | ... | @@ -12,27 +14,35 @@ |
| 12 | 14 | var articulation_z = "#" + hand + "-articulation .module-z"; |
| 13 | 15 | $(articulation_z + " .ball-selector").hide(); |
| 14 | 16 | $(articulation_z + " .row-number-" + y + " .ball-selector").show(); |
| 17 | + | |
| 18 | + var z = $(articulation_z).attr("data-z"); | |
| 19 | + if (typeof z != "undefined") { | |
| 20 | + var ball_selector = $(articulation_z + " .row-number-" + y + " .ball-" + z); | |
| 21 | + _updateASelector(articulation_z, ball_selector); | |
| 22 | + } | |
| 15 | 23 | } |
| 16 | 24 | |
| 17 | - function _setupBallSelector(serverhost, hand) { | |
| 25 | + function _setupBallSelector(hand) { | |
| 18 | 26 | var articulation_x_y = "#" + hand + "-articulation .module-x-y"; |
| 19 | 27 | $(articulation_x_y + " .ball-selector").on("click", function(a) { |
| 20 | - var b = $(a.target), | |
| 21 | - c = b.parent(".grid-row"), | |
| 28 | + var b = $(a.target); | |
| 29 | + if (!b.hasClass("ball-selector")) return; | |
| 30 | + var c = b.parent(".grid-row"), | |
| 22 | 31 | d = $(articulation_x_y), |
| 23 | 32 | f = b.attr("data-x"), |
| 24 | 33 | g = c.attr("data-y"); |
| 25 | - d.attr("data-x", f), d.attr("data-y", g), _updateASelector(articulation_x_y, b, serverhost) | |
| 34 | + d.attr("data-x", f), d.attr("data-y", g), _updateASelector(articulation_x_y, b) | |
| 26 | 35 | _setupModuleZ(hand, g); |
| 27 | 36 | _updateParameterJSON(hand); |
| 28 | 37 | }); |
| 29 | 38 | var articulation_z = "#" + hand + "-articulation .module-z"; |
| 30 | 39 | $(articulation_z + " .ball-selector").on("click", function(a) { |
| 31 | - var b = $(a.target), | |
| 32 | - c = b.parent(".grid-row"), | |
| 40 | + var b = $(a.target); | |
| 41 | + if (!b.hasClass("ball-selector")) return; | |
| 42 | + var c = b.parent(".grid-row"), | |
| 33 | 43 | e = $(articulation_z), |
| 34 | 44 | h = b.attr("data-z"); |
| 35 | - b.attr("data-z") && e.attr("data-z", h), _updateASelector(articulation_z, b, serverhost); | |
| 45 | + b.attr("data-z") && e.attr("data-z", h), _updateASelector(articulation_z, b); | |
| 36 | 46 | _updateParameterJSON(hand); |
| 37 | 47 | }); |
| 38 | 48 | } |
| ... | ... | @@ -42,20 +52,29 @@ |
| 42 | 52 | wikilibras.updateParameterJSON("articulacao", value); |
| 43 | 53 | } |
| 44 | 54 | |
| 55 | + function _isRightHand(hand) { | |
| 56 | + return hand.indexOf("right-hand") != -1; | |
| 57 | + } | |
| 58 | + | |
| 45 | 59 | function _readValue(hand) { |
| 46 | 60 | var articulation_x_y = "#" + hand + "-articulation .module-x-y"; |
| 47 | 61 | var articulation_z = "#" + hand + "-articulation .module-z"; |
| 48 | 62 | var x = parseInt($(articulation_x_y).attr("data-x")); |
| 49 | 63 | var y = parseInt($(articulation_x_y).attr("data-y")); |
| 50 | 64 | var z = $(articulation_z).attr("data-z"); |
| 51 | - z = z == ""? 1 : parseInt(z); | |
| 65 | + | |
| 66 | + if (!_isRightHand(hand)) { | |
| 67 | + x = 10 - x + 1; | |
| 68 | + } | |
| 69 | + z = z == "" ? 1 : parseInt(z); | |
| 52 | 70 | var value = (z-1)*10 + x + 30*(y-1); |
| 53 | 71 | //console.log(value); |
| 54 | 72 | return value; |
| 55 | 73 | } |
| 56 | 74 | |
| 57 | 75 | articulation.setup = function(serverhost) { |
| 58 | - _setupBallSelector(serverhost, "right-hand"); | |
| 59 | - _setupBallSelector(serverhost, "left-hand"); | |
| 76 | + server_host = serverhost; | |
| 77 | + _setupBallSelector("right-hand"); | |
| 78 | + _setupBallSelector("left-hand"); | |
| 60 | 79 | }; |
| 61 | 80 | }(window.articulation = window.articulation || {}, jQuery)); |
| 62 | 81 | \ No newline at end of file | ... | ... |
view/assets/js/wikilibras.js
| ... | ... | @@ -595,6 +595,10 @@ |
| 595 | 595 | $("#configuration-screen").show(); |
| 596 | 596 | }); |
| 597 | 597 | $("#ready-button").off("click").on("click", function() { |
| 598 | + if ($(this).hasClass('disabled')) { | |
| 599 | + event.preventDefault(); | |
| 600 | + return; | |
| 601 | + } | |
| 598 | 602 | _setupRenderScreen(); |
| 599 | 603 | }); |
| 600 | 604 | $("#render-edit").off("click").on("click", function() { |
| ... | ... | @@ -602,6 +606,10 @@ |
| 602 | 606 | $("#configuration-screen").show(); |
| 603 | 607 | }); |
| 604 | 608 | $("#finish-button").off("click").on("click", function() { |
| 609 | + if ($(this).hasClass('disabled')) { | |
| 610 | + event.preventDefault(); | |
| 611 | + return; | |
| 612 | + } | |
| 605 | 613 | $("#render-screen").hide(); |
| 606 | 614 | $("#thanks-screen").show(); |
| 607 | 615 | _saveAnswer(task, deferred) | ... | ... |
view/hand-configuration.html
| ... | ... | @@ -10,12 +10,14 @@ else %} {% set fingers_position_dir = "cme" %} {% set orientation_dir = |
| 10 | 10 | </div> |
| 11 | 11 | <div class="selection-panel-inner-body"> |
| 12 | 12 | <ul class="rig columns-2"> |
| 13 | + <li><img class="box-panel-option selection-panel-option" | |
| 14 | + src="{{ server }}/img/mov/CALAR.gif" value="pontual" />Pontual</li> | |
| 15 | + <!-- | |
| 13 | 16 | <li><video src="{{ server }}/img/mov/PONTUAL.webm" |
| 14 | 17 | preload="metadata" value="pontual" |
| 15 | 18 | class="box-panel-option selection-panel-option" autoplay loop> |
| 16 | 19 | <source type="video/webm"> |
| 17 | 20 | </video> Pontual</li> |
| 18 | - <!-- | |
| 19 | 21 | <li><img class="box-panel-option selection-panel-option" |
| 20 | 22 | src="{{ server }}/img/exf/0000.png" value="retilineo"/>Retilíneo</li> |
| 21 | 23 | <li><img class="box-panel-option selection-panel-option" |
| ... | ... | @@ -41,7 +43,7 @@ else %} {% set fingers_position_dir = "cme" %} {% set orientation_dir = |
| 41 | 43 | </div> |
| 42 | 44 | <div class="selection-panel-inner-body"> |
| 43 | 45 | <div data-x="" data-y="" |
| 44 | - class="module-x-y grid gray-background gray-front-avatar active"> | |
| 46 | + class="module-x-y grid gray-background {{ name }}-gray-front-avatar active"> | |
| 45 | 47 | <div class=grid-selectors> |
| 46 | 48 | <div class="grid-row row-number-1" data-y=1> |
| 47 | 49 | <div class="ball-selector selection-panel-option ball-1" data-x=1></div> |
| ... | ... | @@ -122,12 +124,9 @@ else %} {% set fingers_position_dir = "cme" %} {% set orientation_dir = |
| 122 | 124 | <div data-z="" class="module-z grid gray-background gray-side-avatar"> |
| 123 | 125 | <div class="grid-selectors pull-right"> |
| 124 | 126 | <div class="grid-row row-number-1"> |
| 125 | - <div class="ball-selector selection-panel-option ball-number-1" | |
| 126 | - data-z=1></div> | |
| 127 | - <div class="ball-selector selection-panel-option ball-number-2" | |
| 128 | - data-z=2></div> | |
| 129 | - <div class="ball-selector selection-panel-option ball-number-3" | |
| 130 | - data-z=3></div> | |
| 127 | + <div class="ball-selector selection-panel-option ball-1" data-z=1></div> | |
| 128 | + <div class="ball-selector selection-panel-option ball-2" data-z=2></div> | |
| 129 | + <div class="ball-selector selection-panel-option ball-3" data-z=3></div> | |
| 131 | 130 | </div> |
| 132 | 131 | <div class="grid-row row-number-2"> |
| 133 | 132 | <div class="ball-selector selection-panel-option ball-1" data-z=1></div> | ... | ... |