From c0dadf89274169b396089c2e7b3d69b043097186 Mon Sep 17 00:00:00 2001 From: lq64 Date: Thu, 30 Oct 2025 08:03:00 +0100 Subject: [PATCH] feat(ui): CSS Animations #18 (#27) Added css animations on reload Co-authored-by: LQ63 Reviewed-on: https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/pulls/27 Reviewed-by: Janis Co-authored-by: lq64 Co-committed-by: lq64 --- .../app/assets/stylesheets/main.less | 30 +++++++++++++++++-- .../app/views/sessions.scala.html | 4 +-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/knockoutwhistweb/app/assets/stylesheets/main.less b/knockoutwhistweb/app/assets/stylesheets/main.less index dfd5d67..6c77638 100644 --- a/knockoutwhistweb/app/assets/stylesheets/main.less +++ b/knockoutwhistweb/app/assets/stylesheets/main.less @@ -3,7 +3,10 @@ @background-image: var(--background-image); @color: var(--color); - +@keyframes slideIn { + 0% { transform: translateX(-100vw); } + 100% { transform: translateX(0); } +} body { background-image: @background-image; background-size: 100vw 100vh; @@ -19,8 +22,16 @@ html, body { justify-content: flex-start; align-items: center; text-align: center; + h1 { + animation: slideIn 0.5s ease-out forwards; + animation-fill-mode: backwards; + } } - +#textanimation { + animation: slideIn 0.5s ease-out forwards; + animation-fill-mode: backwards; + animation-delay: 1s; + } #sessions a, h1, p { color: @color; font-size: 40px; @@ -37,8 +48,21 @@ html, body { display: flex; flex-direction: row; justify-content: center; - height: 20% + height: 20%; + img { + animation: slideIn 0.5s ease-out forwards; + animation-fill-mode: backwards; + &:nth-child(1) { animation-delay: 0.5s; } + &:nth-child(2) { animation-delay: 1s; } + &:nth-child(3) { animation-delay: 1.5s; } + &:nth-child(4) { animation-delay: 2s; } + &:nth-child(5) { animation-delay: 2.5s; } + &:nth-child(6) { animation-delay: 3s; } + &:nth-child(7) { animation-delay: 3.5s; } + } } + + #cardsplayed { display: flex; flex-direction: row; diff --git a/knockoutwhistweb/app/views/sessions.scala.html b/knockoutwhistweb/app/views/sessions.scala.html index bf4880f..8be9656 100644 --- a/knockoutwhistweb/app/views/sessions.scala.html +++ b/knockoutwhistweb/app/views/sessions.scala.html @@ -3,9 +3,9 @@ @main("Sessions") {

Knockout Whist sessions

-

Please select your session to jump inside the game!

+

Please select your session to jump inside the game!

@for(session <- sessions) { - @session.name
+ @session.name
}
}