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

Mng 112 some showing up pokemon animations #27

Merged
merged 9 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/choosePokemonsPage/addChosenPokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export const addChosenPokemon = (
const pokemonName = clickedPokemon.id;
const newPokemonObject: Pokemon = factory.getPokemonByName(pokemonName);
activePlayer.addPokemon(newPokemonObject);
clickedPokemon.style.cursor = "default";
clickedPokemon.style.filter = "grayscale(100%)";
setTimeout(() => {
clickedPokemon.style.cursor = "default";
clickedPokemon.style.filter = "grayscale(100%)";
}, 500);
clickedPokemon.style.animation = "heartbeat 1s ease-in-out both";
};
1 change: 1 addition & 0 deletions src/choosePokemonsPage/createPokeballs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export const createPokeballs = (playerOne: Player, activePlayer: Player) => {
"src",
`./assets/${playerLastPokemonName}.png`
);
playerPokeballs[numberOfLastPokemon].style.animation = "bounce-in-fwd 1.1s both";
};
2 changes: 0 additions & 2 deletions src/fightPage/buttonsEventListeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ const magicFunction = (
createActivePlayer(gameHandler);
}
setTimeout(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont't delete genateAttackButtons, otherwise the attack types won't change when the pokemon is changed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is it possible? 😅

gameHandler.generateAttackButtons();
gameHandler.generateSwitchButtons();
gameHandler.generateActionButtons();
}, 1000);
animationButtonsExit(buttons);
Expand Down
180 changes: 179 additions & 1 deletion styles/SASS/_animations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}


// ENTRY
// Buttons ENTRY

@-webkit-keyframes scale-in-hor-center {
0% {
Expand All @@ -54,3 +54,181 @@
opacity: 1;
}
}

// Pokemon ENTRY animation: bounce-in-fwd 1.1s both;

@-webkit-keyframes bounce-in-fwd {
0% {
-webkit-transform: scale(0);
transform: scale(0);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
opacity: 0;
}
38% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
opacity: 1;
}
55% {
-webkit-transform: scale(0.7);
transform: scale(0.7);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
72% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
81% {
-webkit-transform: scale(0.84);
transform: scale(0.84);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
89% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
95% {
-webkit-transform: scale(0.95);
transform: scale(0.95);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
}
@keyframes bounce-in-fwd {
0% {
-webkit-transform: scale(0);
transform: scale(0);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
opacity: 0;
}
38% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
opacity: 1;
}
55% {
-webkit-transform: scale(0.7);
transform: scale(0.7);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
72% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
81% {
-webkit-transform: scale(0.84);
transform: scale(0.84);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
89% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
95% {
-webkit-transform: scale(0.95);
transform: scale(0.95);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
}

// Choosing POKEMON animation: heartbeat 1.5s ease-in-out both;

@-webkit-keyframes heartbeat {
from {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transform-origin: center center;
transform-origin: center center;
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
10% {
-webkit-transform: scale(0.91);
transform: scale(0.91);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
17% {
-webkit-transform: scale(0.98);
transform: scale(0.98);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
33% {
-webkit-transform: scale(0.87);
transform: scale(0.87);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
45% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
}
@keyframes heartbeat {
from {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transform-origin: center center;
transform-origin: center center;
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
10% {
-webkit-transform: scale(0.91);
transform: scale(0.91);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
17% {
-webkit-transform: scale(0.98);
transform: scale(0.98);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
33% {
-webkit-transform: scale(0.87);
transform: scale(0.87);
-webkit-animation-timing-function: ease-in;
animation-timing-function: ease-in;
}
45% {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
}
18 changes: 16 additions & 2 deletions styles/SASS/_fight-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,20 @@

.activePlayer {
color: $color-primary;
border-bottom: 3px solid $color-primary;
// border-bottom: 3px solid $color-primary;

&:before {
content: "";
position: absolute;
z-index: -1;
left: 0;
right: 0;
bottom: 0;
background: $color-primary;
height: 4px;
border-radius: 50%;
animation: scale-in-hor-center 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
}
}

Expand All @@ -60,9 +73,10 @@

img {
width: fit-content;
animation: bounce-in-fwd 1.1s both;
}

#pokemon-player2 {
#pokemon-image-player2 {
order: 2;
}

Expand Down
4 changes: 4 additions & 0 deletions styles/SASS/_pokemon-choose-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
max-height: 8.5vh;
padding: 0.8vh 0.5vh;
cursor: pointer;

&:hover {
transform: scale(1.25);
}
}
}
}
2 changes: 1 addition & 1 deletion styles/SASS/_responsive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
flex-flow: column;
align-items: center;

#pokemon-player2 {
#pokemon-image-player2 {
order: 0;
}
}
Expand Down
Loading