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

[Feature] Added bounce animation on skip button #2593

Merged
Merged
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
3 changes: 3 additions & 0 deletions src/creature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,9 @@ export class Creature {
const select = o.noPath || this.movementType() === 'flying' ? selectFlying : selectNormal;

if (this.noActionPossible) {
const buttonElement = game.UI.btnSkipTurn.$button;

buttonElement.addClass('bounce');
game.grid.querySelf({
fnOnConfirm: function () {
game.UI.btnSkipTurn.click();
Expand Down
28 changes: 26 additions & 2 deletions src/style/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,30 @@ span.pure {
}
}

@keyframes button-bounce-left {
0% {
transform: translateX(0);
}
50% {
transform: translateX(-10px);
}
100% {
transform: translateX(0);
}
}

#skip.button {
transition: transform 1s ease-in-out;
}

#skip.button.bounce {
animation: button-bounce-left 1s ease-in-out infinite;
}

#skip.button.bounce:hover {
animation-iteration-count: 1;
}

/*--------------Framed Modal------------------*/
/* Modal window with graphical border and close button. */
.framed-modal {
Expand Down Expand Up @@ -2062,7 +2086,7 @@ input {
z-index: 1;
position: absolute;
top: 105px;
transition: opacity 300ms cubic-bezier(.39,.58,.57,1);;
transition: opacity 300ms cubic-bezier(0.39, 0.58, 0.57, 1);

div {
height: 125px;
Expand All @@ -2083,4 +2107,4 @@ input {
#brandlogo {
display: none;
}
}
}
3 changes: 3 additions & 0 deletions src/ui/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export class UI {
game.skipTurn();
this.lastViewedCreature = '';
this.queryUnit = '';
const buttonElement = this.btnSkipTurn.$button;

buttonElement.removeClass('bounce');
}
},
},
Expand Down
Loading