Compare commits

..

1 Commits

Author SHA1 Message Date
LQ63
0d1df8a1a9 feat(ui): Animation Card Played
Added a fade Up Out animation. Also added a sliding animation for the remaining cards
2025-12-14 23:09:54 +01:00
3 changed files with 9 additions and 8 deletions

View File

@@ -109,9 +109,3 @@
### Features ### Features
* **ui:** FRO-35 Animations ([#22](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/22)) ([d73b4f3](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/d73b4f396be89b4f8ce2a446afe47c604cfe8598)) * **ui:** FRO-35 Animations ([#22](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/22)) ([d73b4f3](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/d73b4f396be89b4f8ce2a446afe47c604cfe8598))
## [0.0.0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/compare/0.13.0...0.0.0) (2025-12-15)
### Features
* **ui:** FRO-34 Lobby ([#21](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/21)) ([bb6355d](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/bb6355d9ed6745b4852a52040d880ee1dcc6d797))
* **ui:** FRO-5 Animation Card Played ([#23](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/issues/23)) ([70a44fd](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/70a44fd1ea119d43f875e6cfac56fb25747d8913))

View File

@@ -25,7 +25,9 @@ function triggerWiggle(index: number) {
function handlePlayCard(index: number | null) { function handlePlayCard(index: number | null) {
if (index === null) return if (index === null) return
wb.sendAndWait("PlayCard", { cardindex: index }).catch((error) => { wb.sendAndWait("PlayCard", { cardindex: index }).then(
).catch((error) => {
triggerWiggle(index) triggerWiggle(index)
$q.notify({ $q.notify({
@@ -38,9 +40,14 @@ function handlePlayCard(index: number | null) {
} }
function onBeforeLeave(el: Element) { function onBeforeLeave(el: Element) {
const element = el as HTMLElement; const element = el as HTMLElement;
// 1. Get the current position relative to the container
const { marginLeft, marginTop, width, height } = window.getComputedStyle(element); const { marginLeft, marginTop, width, height } = window.getComputedStyle(element);
// 2. Explicitly set the geometry to freeze it in place
element.style.left = `${element.offsetLeft - parseFloat(marginLeft)}px`; element.style.left = `${element.offsetLeft - parseFloat(marginLeft)}px`;
element.style.top = `${element.offsetTop - parseFloat(marginTop)}px`; element.style.top = `${element.offsetTop - parseFloat(marginTop)}px`;
// 3. Keep the width/height fixed so it doesn't shrink when becoming absolute
element.style.width = width; element.style.width = width;
element.style.height = height; element.style.height = height;
} }

View File

@@ -1,3 +1,3 @@
MAJOR=0 MAJOR=0
MINOR=14 MINOR=13
PATCH=0 PATCH=0