From 425234d56aff86cc1900ab119a6998fd536f2a3e Mon Sep 17 00:00:00 2001 From: David Sanz Date: Mon, 17 Feb 2020 17:16:49 +0100 Subject: [PATCH 1/6] In the home page disable the Play buttons until the user has not written a name. --- Source/Services/RPSLS.Web/Pages/Index.razor | 18 ++++++++++-------- Source/Services/RPSLS.Web/wwwroot/css/main.css | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Source/Services/RPSLS.Web/Pages/Index.razor b/Source/Services/RPSLS.Web/Pages/Index.razor index 9074f28..b4ba55d 100644 --- a/Source/Services/RPSLS.Web/Pages/Index.razor +++ b/Source/Services/RPSLS.Web/Pages/Index.razor @@ -19,7 +19,7 @@ @if (string.IsNullOrWhiteSpace(Username)) { - +
@if (!string.IsNullOrWhiteSpace(TwitterOptions?.Value?.ConsumerKey) && !string.IsNullOrWhiteSpace(TwitterOptions?.Value?.ConsumerSecret)) @@ -36,12 +36,12 @@ }
-
+
@if (MultiplayerSettings.Value.Enabled) { -
+
} @@ -59,13 +59,15 @@ @code { - private string CustomUsername { get; set; } + private string CustomUsername { get; set; } - [Parameter] - public string RedirectUrl { get; set; } + [Parameter] + public string RedirectUrl { get; set; } - public string Username { get; set; } - public bool IsTwitterUser { get; set; } + public string Username { get; set; } + public bool IsTwitterUser { get; set; } + + public bool UserNameIsEmpty => String.IsNullOrEmpty(Username) && String.IsNullOrEmpty(CustomUsername); protected override async Task OnInitializedAsync() { diff --git a/Source/Services/RPSLS.Web/wwwroot/css/main.css b/Source/Services/RPSLS.Web/wwwroot/css/main.css index 87cd314..2dcba9b 100644 --- a/Source/Services/RPSLS.Web/wwwroot/css/main.css +++ b/Source/Services/RPSLS.Web/wwwroot/css/main.css @@ -102,6 +102,10 @@ a.secondary-link { color: #fff; } +.custom-button[disabled]:hover { + transition: none; +} + .custom-button-link { font-size: 1.25rem; cursor: pointer; @@ -130,6 +134,17 @@ a.secondary-link { transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out; } +.custom-button[disabled] .custom-button-link { + background-color: #d9007d; + text-shadow: none; + cursor: auto; + opacity: 0.5; +} + +.custom-button[disabled]:active .custom-button-link { + transform: none; +} + .custom-button:hover a, .custom-button:hover button { background-color: #ec6a9c; @@ -144,6 +159,8 @@ a.secondary-link { transform: translate(0, 4px); } + + /* Cookies Banner */ .cookie-banner { background: #372369; From d6daea1691ddbe70442044b0c1d8fbbb66602b14 Mon Sep 17 00:00:00 2001 From: David Sanz Date: Tue, 18 Feb 2020 12:08:58 +0100 Subject: [PATCH 2/6] Fix issue with the time the hand was shaking in the battle. The hand was not shaking the time set (2 seconds). --- Source/Services/RPSLS.Web/Pages/MultiplayerBattle.razor | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Services/RPSLS.Web/Pages/MultiplayerBattle.razor b/Source/Services/RPSLS.Web/Pages/MultiplayerBattle.razor index cca1369..bb897ad 100644 --- a/Source/Services/RPSLS.Web/Pages/MultiplayerBattle.razor +++ b/Source/Services/RPSLS.Web/Pages/MultiplayerBattle.razor @@ -186,6 +186,7 @@ else battleToBeStarted = true; shakeHand = true; + StateHasChanged(); await Task.Delay(2000); shakeHand = false; userHandToShow = SelectedPick.Image; From 753890db16660300c28f37b4e4cd37f2be2d87a9 Mon Sep 17 00:00:00 2001 From: David Sanz Date: Tue, 18 Feb 2020 12:35:41 +0100 Subject: [PATCH 3/6] Fix navigation issues. --- Source/Services/RPSLS.Web/Pages/MultiplayerResult.razor | 2 +- Source/Services/RPSLS.Web/wwwroot/css/not-found.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Services/RPSLS.Web/Pages/MultiplayerResult.razor b/Source/Services/RPSLS.Web/Pages/MultiplayerResult.razor index 3409766..54cad5e 100644 --- a/Source/Services/RPSLS.Web/Pages/MultiplayerResult.razor +++ b/Source/Services/RPSLS.Web/Pages/MultiplayerResult.razor @@ -10,7 +10,7 @@ play again - choose opponent + choose opponent diff --git a/Source/Services/RPSLS.Web/wwwroot/css/not-found.css b/Source/Services/RPSLS.Web/wwwroot/css/not-found.css index 8dea63b..f333456 100644 --- a/Source/Services/RPSLS.Web/wwwroot/css/not-found.css +++ b/Source/Services/RPSLS.Web/wwwroot/css/not-found.css @@ -149,7 +149,7 @@ } .not_found-err { - line-height: 18rem; + line-height: 20rem; font-size: 20rem; } From e42b3702cc11a0e8d42f418187431578383189b6 Mon Sep 17 00:00:00 2001 From: David Sanz Date: Tue, 18 Feb 2020 16:47:19 +0100 Subject: [PATCH 4/6] Add leaderboard link to the results page. Adjust styles to make the control fit to the home page and the results page. --- .../Components/LeaderboardLink.razor | 6 +- .../Services/RPSLS.Web/Pages/BotResult.razor | 2 +- Source/Services/RPSLS.Web/Pages/Index.razor | 8 +- .../RPSLS.Web/Pages/MultiplayerResult.razor | 4 +- .../RPSLS.Web/Shared/ConsoleLayout.razor | 100 ++++++++++-------- .../Services/RPSLS.Web/wwwroot/css/index.css | 28 +++-- .../Services/RPSLS.Web/wwwroot/css/main.css | 18 ++++ 7 files changed, 102 insertions(+), 64 deletions(-) diff --git a/Source/Services/RPSLS.Web/Components/LeaderboardLink.razor b/Source/Services/RPSLS.Web/Components/LeaderboardLink.razor index 7b99a79..e3c82e1 100644 --- a/Source/Services/RPSLS.Web/Components/LeaderboardLink.razor +++ b/Source/Services/RPSLS.Web/Components/LeaderboardLink.razor @@ -2,8 +2,10 @@ { } diff --git a/Source/Services/RPSLS.Web/Pages/BotResult.razor b/Source/Services/RPSLS.Web/Pages/BotResult.razor index 1129423..8380035 100644 --- a/Source/Services/RPSLS.Web/Pages/BotResult.razor +++ b/Source/Services/RPSLS.Web/Pages/BotResult.razor @@ -24,7 +24,7 @@ { if (firstRender) { - Layout.Initialize(title: "results", withHelp: true, hasToShowGithub: true); + Layout.Initialize(title: "results", withHelp: true, hasToShowGithub: true, hasToShowLeaderboardLink: true); } } diff --git a/Source/Services/RPSLS.Web/Pages/Index.razor b/Source/Services/RPSLS.Web/Pages/Index.razor index b4ba55d..9d564e9 100644 --- a/Source/Services/RPSLS.Web/Pages/Index.razor +++ b/Source/Services/RPSLS.Web/Pages/Index.razor @@ -9,7 +9,13 @@