diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-07-30 02:45:36 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-07-30 02:45:36 +0100 |
| commit | 914512435d37d9f1e1ea4c045afd4ec5612b7534 (patch) | |
| tree | aca7ae248159ad9dd6bf5ec09c4f6b2b4eb92848 /code/ui | |
| parent | d599275439cd35e0d3e3146e39be809df55459bd (diff) | |
Replace movement controllers
Diffstat (limited to 'code/ui')
| -rw-r--r-- | code/ui/health/Health.razor | 2 | ||||
| -rw-r--r-- | code/ui/overlay/DeathOverlay.razor | 33 | ||||
| -rw-r--r-- | code/ui/spectator/Spectator.razor | 14 |
3 files changed, 29 insertions, 20 deletions
diff --git a/code/ui/health/Health.razor b/code/ui/health/Health.razor index c3c6660..8961f63 100644 --- a/code/ui/health/Health.razor +++ b/code/ui/health/Health.razor @@ -21,7 +21,7 @@ Health { left: 0;
}
</style>
-<div class="transition-bar" style="background-color: white; width: @(GetHealth())%;"></div>
+<div class="transition-bar" style="background-color: rgba(255, 255, 255, 0.8); width: @(GetHealth())%;"></div>
<div class="colour-bar" style="background-color: @(Colour); width: @(GetHealth())%;"></div>
@code
diff --git a/code/ui/overlay/DeathOverlay.razor b/code/ui/overlay/DeathOverlay.razor index 15848f6..23c3a17 100644 --- a/code/ui/overlay/DeathOverlay.razor +++ b/code/ui/overlay/DeathOverlay.razor @@ -10,6 +10,11 @@ 0% { opacity: 0; }
100% { opacity: 1; }
}
+@@keyframes blurIn
+{
+ 0% { opacity: 0; }
+ 100% { opacity: 1; }
+}
deathoverlay {
}
.overlay {
@@ -18,11 +23,22 @@ deathoverlay { top: 0;
width: 100vw;
height: 100vh;
-
- background-color: rgba(80, 1, 1, 0.90);
- backdrop-filter-blur: 64px;
+}
+.fade {
+ opacity: 0;
+ background-color: rgb(0, 0, 0);
animation-name: fadeIn;
- animation-duration: 2.5s;
+ animation-duration: 0.5s;
+ animation-delay: 1.5s;
+ animation-iteration-count: 1;
+ animation-timing-function: ease-in;
+ animation-fill-mode: forwards;
+}
+.blur {
+ opacity: 0;
+ backdrop-filter-blur: 32px;
+ animation-name: fadeIn;
+ animation-duration: 1.5s;
animation-iteration-count: 1;
animation-timing-function: ease-in;
animation-fill-mode: forwards;
@@ -56,7 +72,9 @@ deathoverlay { @if (ShowOverlay)
{
-<div class="overlay">
+<div class="overlay fade">
+</div>
+<div class="overlay blur">
</div>
<div class="box-container">
<div class="box">
@@ -78,11 +96,6 @@ deathoverlay { protected override int BuildHash()
{
- var clientPawn = Game.LocalPawn;
- if (clientPawn is Player player)
- {
- ShowOverlay = player.LifeState == LifeState.Dead && player.Spectator == null;
- }
return ShowOverlay.GetHashCode();
}
diff --git a/code/ui/spectator/Spectator.razor b/code/ui/spectator/Spectator.razor index f6fe8af..fe0d662 100644 --- a/code/ui/spectator/Spectator.razor +++ b/code/ui/spectator/Spectator.razor @@ -43,16 +43,12 @@ spectator { protected override int BuildHash()
{
var localPawn = Game.LocalPawn;
- if (localPawn is Player player)
+ if (localPawn is Player player && player.Camera is SpectatorCameraComponent spectator)
{
- var spectator = player.Spectator;
- if (spectator != null)
- {
- var target = spectator.Target;
- Spectating = true;
- TargetName = (target != null && target.IsValid() && target.LifeState == LifeState.Alive) ? target.Client.Name : "";
- return HashCode.Combine(Spectating.GetHashCode(), TargetName.GetHashCode());
- }
+ var target = spectator.Target;
+ Spectating = true;
+ TargetName = (target != null && target.IsValid() && target.LifeState == LifeState.Alive) ? target.Client.Name : "";
+ return HashCode.Combine(Spectating.GetHashCode(), TargetName.GetHashCode());
}
if (Spectating)
{
|
