Skip to content

Commit

Permalink
Work on web-fc-solve-ui integration.
Browse files Browse the repository at this point in the history
Disable/hide the animated/graphic solution display if the game-variant rules do not match 8cols+4reserves freecell
  • Loading branch information
shlomif committed Apr 9, 2024
1 parent 725d083 commit f418d6c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
13 changes: 13 additions & 0 deletions fc-solve/site/wml/lib/sass/jqui-override.scss
Expand Up @@ -38,4 +38,17 @@
text-decoration-line: line-through;
}
}
#output_tabs__animated {
.enabled_wrapper {
display: none;
}
}
}

#output_tabs.enable_animated_output {
#output_tabs__animated {
.disabled_wrapper {
display: none;
}
}
}
10 changes: 8 additions & 2 deletions fc-solve/site/wml/src/js-fc-solve/text/index.html.tt2
Expand Up @@ -143,19 +143,23 @@ Input a card patience/solitaire layout in the <a href="[% base_path %]docs/distr

[% END %]


<label id="output_label" for="output">Output:</label>

<div id="output_tabs" class="output_tabs">
<div id="output_tabs" class="enable_animated_output output_tabs">
<ul>
<li id="output_tabs__animated__selector"><a href="#output_tabs__animated">Animated</a></li>
<li id="output_tabs__text__selector"><a href="#output_tabs__text">Text</a></li>
</ul>
<div id="output_tabs__animated" class="tab">

<div class="disabled_wrapper">
</div>

[%- BLOCK upper_button -%]
<button onclick="$('[% solver_bar_css(targetclasses) %]').trigger('click');" title="[% title %]">[% text %]</button>
[%- END -%]

<div class="enabled_wrapper">
<div class="upper_buttons__wrapper">
[%- INCLUDE upper_button targetclasses = ["rewind"] text = "⏮ Prev" title = "Previous move" -%]
[%- INCLUDE upper_button targetclasses = ["pause", "play"] text = "▶ Play" title = "Play" -%]
Expand Down Expand Up @@ -190,6 +194,8 @@ Input a card patience/solitaire layout in the <a href="[% base_path %]docs/distr
</div>
</div>
</div>
</div>

<div id="output_tabs__text" class="tab">
<div class="output_form">
[% INCLUDE output_controls %]
Expand Down
16 changes: 10 additions & 6 deletions fc-solve/site/wml/src/ts/web-fc-solve-ui.ts
Expand Up @@ -272,14 +272,18 @@ class FC_Solve_UI {
return $("#output_tabs");
};
if (check_ret.verdict) {
output_tabs().removeClass("disable_animated_output");
output_tabs()
.addClass("enable_animated_output")
.removeClass("disable_animated_output");
graphics.startSolution({
instance: inst,
board: that._board_parse_result,
});
} else {
output_tabs().addClass("disable_animated_output");
output_tabs()
.addClass("disable_animated_output")
.removeClass("enable_animated_output");
}
graphics.startSolution({
instance: inst,
board: that._board_parse_result,
});
const seq = inst.proto_states_and_moves_seq;

function _filt(str) {
Expand Down

0 comments on commit f418d6c

Please sign in to comment.