Change the look of chess games.
This commit is contained in:
parent
e308a5099c
commit
ee3ba7c3d4
@ -1,15 +1,4 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
/* Fix the position of chess board while scrolling */
|
|
||||||
if (obj = $('#GameWrapper')) {
|
|
||||||
obj.affix({
|
|
||||||
offset: {
|
|
||||||
top: function () {
|
|
||||||
return obj.parent().offset().top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Sort a tournament table with tablesorter */
|
/* Sort a tournament table with tablesorter */
|
||||||
$('.tablesorter .opponent').addClass('{sorter: false}');
|
$('.tablesorter .opponent').addClass('{sorter: false}');
|
||||||
$('.tablesorter').tablesorter({
|
$('.tablesorter').tablesorter({
|
||||||
@ -27,6 +16,12 @@ function customFunctionOnPgnGameLoad() {
|
|||||||
}
|
}
|
||||||
function customFunctionOnMove() {
|
function customFunctionOnMove() {
|
||||||
refreshButtonset();
|
refreshButtonset();
|
||||||
|
|
||||||
|
/* Show move comment */
|
||||||
|
if (CurrentVar == 0 && (theObj = document.getElementById("GameMoveComment"))) {
|
||||||
|
theObj.innerHTML = '<span class="comment">' +
|
||||||
|
strippedMoveComment(CurrentPly, 0, true) + '</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function refreshButtonset() {
|
function refreshButtonset() {
|
||||||
$('#GameButtons input').addClass('btn btn-default');
|
$('#GameButtons input').addClass('btn btn-default');
|
||||||
|
@ -1,17 +1,35 @@
|
|||||||
@squareSize: 56px;
|
@squareSize: 56px;
|
||||||
@boardBorderWidth: 4px;
|
@boardBorderWidth: 4px;
|
||||||
@boardSize: 8 * @squareSize + 2 * @boardBorderWidth;
|
@boardSize: 8 * @squareSize + 2 * @boardBorderWidth;
|
||||||
|
@tableBorder: 1px solid #ddd;
|
||||||
|
|
||||||
#GameWrapper {
|
body, html { height: 100%; }
|
||||||
float: left;
|
#GameWrapper { min-height: 100%; }
|
||||||
width: @boardSize;
|
#GameBoardWrapper { position: relative; }
|
||||||
}
|
#GameTextWrapper {
|
||||||
#TextWrapper {
|
position: absolute;
|
||||||
margin-left: @boardSize;
|
|
||||||
padding-left: 15px;
|
|
||||||
}
|
|
||||||
#GameWrapper.affix {
|
|
||||||
top: 0;
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: @boardSize + 10px;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
width: 180px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
#GameText {
|
||||||
|
display: table;
|
||||||
|
width: 141px;
|
||||||
|
border-top: @tableBorder;
|
||||||
|
border-left: @tableBorder;
|
||||||
|
.move {
|
||||||
|
display: table-cell;
|
||||||
|
border-bottom: @tableBorder;
|
||||||
|
border-right: @tableBorder;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
span.move { width: 40px; }
|
||||||
|
a.move { width: 50px; }
|
||||||
|
.variation { float: left; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.boardTable {
|
.boardTable {
|
||||||
@ -34,3 +52,4 @@
|
|||||||
.blackSquare, .highlightBlackSquare {
|
.blackSquare, .highlightBlackSquare {
|
||||||
background: #CC9966;
|
background: #CC9966;
|
||||||
}
|
}
|
||||||
|
.moveOn, .variationOn { background-color: #ccc; }
|
||||||
|
@ -7,23 +7,26 @@ layout: default
|
|||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12">
|
<div id="GameWrapper" class="col-xs-12 col-sm-8 col-sm-offset-2">
|
||||||
<div id="GameWrapper" data-spy="affix">
|
<strong><span id="GameWhite"></span> vs. <span id="GameBlack"></span> • <span id="GameResult"></span></strong>
|
||||||
|
|
||||||
<p></p>
|
<p></p>
|
||||||
|
|
||||||
|
<div id="GameBoardWrapper">
|
||||||
<div id="GameSelector"></div>
|
<div id="GameSelector"></div>
|
||||||
<p></p>
|
<p></p>
|
||||||
<div id="GameBoard"></div>
|
<div id="GameBoard"></div>
|
||||||
<p></p>
|
<p></p>
|
||||||
<div id="GameButtons"></div>
|
<div id="GameButtons"></div>
|
||||||
|
|
||||||
|
<div id="GameTextWrapper">
|
||||||
|
<div id="GameText"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="TextWrapper">
|
|
||||||
<p></p>
|
<p></p>
|
||||||
<b><span id="GameWhite"></span> - <span id="GameBlack"></span> <span id="GameResult"></span></b>
|
|
||||||
<p></p>
|
<div id="GameMoveComment"></div>
|
||||||
<div id="GameText"></div>
|
|
||||||
<p></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- pgn4web JavaScript -->
|
<!-- pgn4web JavaScript -->
|
||||||
@ -36,6 +39,5 @@ layout: default
|
|||||||
SetImagePath("/assets/img/chesspieces/wikipedia");
|
SetImagePath("/assets/img/chesspieces/wikipedia");
|
||||||
SetImageType("png");
|
SetImageType("png");
|
||||||
SetGameSelectorOptions("Выбрать партию ...", false, 0, 0, 0, 15, 15, 0, 10); // (head, num, chEvent, chSite, chRound, chWhite, chBlack, chResult, chDate);
|
SetGameSelectorOptions("Выбрать партию ...", false, 0, 0, 0, 15, 15, 0, 10); // (head, num, chEvent, chSite, chRound, chWhite, chBlack, chResult, chDate);
|
||||||
SetCommentsOnSeparateLines(true);
|
SetCommentsIntoMoveText(false);
|
||||||
SetShortcutKeysEnabled(true);
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user