diff --git a/src/CraftSharp/App.razor b/src/CraftSharp/App.razor index a525e9c..ca31ce6 100644 --- a/src/CraftSharp/App.razor +++ b/src/CraftSharp/App.razor @@ -8,8 +8,14 @@ - -

Sorry, there's nothing at this address.

+ + @{ErrorHandler(5);} +
+

+ Oups, la page que à laquelle vous essayez d'accéder n'existe pas ! +

Retour à la page d'accueil dans 5s

+

+
diff --git a/src/CraftSharp/App.razor.cs b/src/CraftSharp/App.razor.cs new file mode 100644 index 0000000..915b810 --- /dev/null +++ b/src/CraftSharp/App.razor.cs @@ -0,0 +1,26 @@ +using CraftSharp.Shared; +using Microsoft.AspNetCore.Components; + +namespace CraftSharp +{ + public partial class App + { + [Inject] + public NavigationManager NavigationManager { get; set; } + + [Inject] + public ILogger Logger { get; set; } + + public async Task ErrorHandler(int countdown) { + Logger.Log(LogLevel.Error, $"Navigating to unknown page : {NavigationManager.Uri}"); + while(countdown > 0) + { + await Task.Delay(1000); + countdown--; + StateHasChanged(); + } + NavigationManager.NavigateTo("index"); + } + + } +} diff --git a/src/CraftSharp/Shared/CraftLayout.razor.css b/src/CraftSharp/Shared/CraftLayout.razor.css index aa1d076..d7e618e 100644 --- a/src/CraftSharp/Shared/CraftLayout.razor.css +++ b/src/CraftSharp/Shared/CraftLayout.razor.css @@ -8,13 +8,9 @@ pointer-events: none; } -.spacer{ - height: 300px; -} .main_div { background: url("../Images/blur_background.jpg") center center/cover no-repeat fixed; color: white; - min-height: 100vh; position: relative; } diff --git a/src/CraftSharp/Shared/ErrorLayout.razor b/src/CraftSharp/Shared/ErrorLayout.razor new file mode 100644 index 0000000..d87f6f2 --- /dev/null +++ b/src/CraftSharp/Shared/ErrorLayout.razor @@ -0,0 +1,21 @@ +@inherits LayoutComponentBase + +CraftSharp + +
+ +
+ @Body +
+ + + +
+ + diff --git a/src/CraftSharp/Shared/ErrorLayout.razor.css b/src/CraftSharp/Shared/ErrorLayout.razor.css new file mode 100644 index 0000000..bfc6bcc --- /dev/null +++ b/src/CraftSharp/Shared/ErrorLayout.razor.css @@ -0,0 +1,20 @@ +.bedrock_footer { + width: 100%; + position: relative; +} + +.bedrock_footer_img { + width: 100%; + pointer-events: none; +} + +.main_div { + background: url("../Images/error_background.jpg") center center/cover no-repeat fixed; + color: white; + position: relative; +} + +.culture { + position: absolute; + bottom: 0; +} \ No newline at end of file diff --git a/src/CraftSharp/Shared/SurveyPrompt.razor b/src/CraftSharp/Shared/SurveyPrompt.razor deleted file mode 100644 index e3e6429..0000000 --- a/src/CraftSharp/Shared/SurveyPrompt.razor +++ /dev/null @@ -1,16 +0,0 @@ -
- - @Title - - - Please take our - brief survey - - and tell us what you think. -
- -@code { - // Demonstrates how a parent component can supply parameters - [Parameter] - public string? Title { get; set; } -} diff --git a/src/CraftSharp/wwwroot/Images/error_background.jpg b/src/CraftSharp/wwwroot/Images/error_background.jpg new file mode 100644 index 0000000..ed4925d Binary files /dev/null and b/src/CraftSharp/wwwroot/Images/error_background.jpg differ