Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds hover images and toggle setting to gameUI #515

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gemp-swccg-async/src/main/web/css/gemp-001/game.css
Original file line number Diff line number Diff line change
Expand Up @@ -463,3 +463,9 @@ body {
vertical-align: top;
font-size: 75%;
}

.previewImage {
position: absolute;
z-index: 1099;
pointer-events: none;
}
24 changes: 18 additions & 6 deletions gemp-swccg-async/src/main/web/js/gemp-016/gameAnimations.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var GameAnimations = Class.extend({

var cardHeight = (gameHeight / 2);
var cardWidth = card.getWidthForHeight(cardHeight);

that.handleCardAnimatedStart(cardDiv);
$(cardDiv).css(
{
position:"absolute",
Expand Down Expand Up @@ -134,7 +134,7 @@ var GameAnimations = Class.extend({

var cardHeight = (gameHeight / 2);
var cardWidth = card.getWidthForHeight(cardHeight);

that.handleCardAnimatedStart(cardDiv);
$(cardDiv).css(
{
position:"absolute",
Expand Down Expand Up @@ -222,7 +222,7 @@ var GameAnimations = Class.extend({
shadowStartPosX = $(targetCard).position().left;
shadowStartPosY = $(targetCard).position().top;
}

that.handleCardAnimatedStart(cardDiv);
$(cardDiv).css(
{
position:"absolute",
Expand Down Expand Up @@ -255,6 +255,8 @@ var GameAnimations = Class.extend({
var cardData = $(this).data("card");
if (cardData.zone == "ANIMATION") {
$(this).remove();
} else {
that.handleCardAnimatedEnd(this);
}
}
);
Expand All @@ -277,7 +279,6 @@ var GameAnimations = Class.extend({
var isSuspended = element.getAttribute("suspended");
var isCollapsed = element.getAttribute("collapsed");
var phase = element.getAttribute("phase");

var that = this;
$("#main").queue(
function (next) {
Expand Down Expand Up @@ -371,7 +372,7 @@ var GameAnimations = Class.extend({

var cardHeight = (gameHeight / 2);
var cardWidth = card.getWidthForHeight(cardHeight);

that.handleCardAnimatedStart(cardDiv);
$(cardDiv).css(
{
position:"absolute",
Expand Down Expand Up @@ -431,6 +432,7 @@ var GameAnimations = Class.extend({
function (next) {
var cardDiv = $(".card:cardId(" + cardId + ")");
$(cardDiv).css({zIndex:oldValues["zIndex"]});
that.handleCardAnimatedEnd(cardDiv);
next();
});
}
Expand Down Expand Up @@ -641,7 +643,9 @@ var GameAnimations = Class.extend({
}

if (doAnimation) {
$(".card:cardId(" + cardRemovedIds + ")")
const cardDiv = $(".card:cardId(" + cardRemovedIds + ")");
that.handleCardAnimatedStart(cardDiv);
cardDiv
.animate(
{
opacity:0},
Expand Down Expand Up @@ -1554,5 +1558,13 @@ var GameAnimations = Class.extend({
that.game.layoutUI(true);
next();
});
},

handleCardAnimatedStart: function (cardDiv) {
cardDiv && cardDiv[0] && $(cardDiv[0]).addClass('card-animating')
},

handleCardAnimatedEnd: function (cardDiv) {
cardDiv && cardDiv[0] && $(cardDiv[0]).removeClass('card-animating')
}
});
Loading