From e7e2b074049fc6ab26133fd06bc7b02dee3c7a68 Mon Sep 17 00:00:00 2001 From: jsakamoto Date: Thu, 14 Dec 2023 20:38:50 +0900 Subject: [PATCH] Update to .NET 8 --- .github/workflows/gh-pages.yml | 10 +++--- App.razor | 6 ++-- Program.cs | 2 +- Properties/launchSettings.json | 20 ++++++++--- SnowCatch.csproj | 15 ++++----- SnowCatch.sln | 25 ++++++++++++++ wwwroot/blazor-ui.css | 61 ++++++++++++++++++++++++++++++++++ wwwroot/index.html | 14 ++++---- 8 files changed, 124 insertions(+), 29 deletions(-) create mode 100644 SnowCatch.sln create mode 100644 wwwroot/blazor-ui.css diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index bfd718a..318c9ea 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -10,13 +10,13 @@ jobs: runs-on: ubuntu-latest steps: # Checkout the code - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - # Install .NET Core SDK - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + # Install .NET SDK + - name: Setup .NET SDK + uses: actions/setup-dotnet@v2 with: - dotnet-version: 6.0.100 + dotnet-version: 8.0.x - name: Install .NET WebAssembly Tools run: dotnet workload install wasm-tools diff --git a/App.razor b/App.razor index 03eafde..71daf2b 100644 --- a/App.razor +++ b/App.razor @@ -1,4 +1,4 @@ -@using Toolbelt.Blazor.HotKeys +@using Toolbelt.Blazor.HotKeys2 @inject HotKeys HotKeys @inject Toolbelt.Blazor.Gamepad.GamepadList GamepadList @implements IDisposable @@ -29,8 +29,8 @@ { this.Context.GameLoopTimer.Elapsed += GameLoopTimer_Elapsed; this.HotKeysContext = this.HotKeys.CreateContext(); - this.HotKeysContext.Add(ModKeys.None, Keys.Left, () => this.Context.MoveSnowManToLeft()); - this.HotKeysContext.Add(ModKeys.None, Keys.Right, () => this.Context.MoveSnowManToRight()); + this.HotKeysContext.Add(Code.ArrowLeft, this.Context.MoveSnowManToLeft); + this.HotKeysContext.Add(Code.ArrowRight, this.Context.MoveSnowManToRight); } private async void GameLoopTimer_Elapsed(object sender, EventArgs e) diff --git a/Program.cs b/Program.cs index 98dc4eb..bfc79b0 100644 --- a/Program.cs +++ b/Program.cs @@ -6,7 +6,7 @@ builder.RootComponents.Add("#app"); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); -builder.Services.AddHotKeys(); +builder.Services.AddHotKeys2(); builder.Services.AddGamepadList(); await builder.Build().RunAsync(); diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index 016f02d..1b80eaf 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -8,20 +8,30 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "http": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "http://localhost:57528", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, - "SnowCatch": { + "https": { "commandName": "Project", - "dotnetRunMessages": "true", + "dotnetRunMessages": true, + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "https://localhost:57529;http://localhost:57528", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "http://localhost:57528/;https://localhost:57529/", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/SnowCatch.csproj b/SnowCatch.csproj index 0927aec..8d96fa6 100644 --- a/SnowCatch.csproj +++ b/SnowCatch.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable true false @@ -9,13 +9,12 @@ - - - + + + - - - + + - + \ No newline at end of file diff --git a/SnowCatch.sln b/SnowCatch.sln new file mode 100644 index 0000000..a611468 --- /dev/null +++ b/SnowCatch.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SnowCatch", "SnowCatch.csproj", "{BDAF25FF-3F57-4597-BD0A-D1806876D844}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BDAF25FF-3F57-4597-BD0A-D1806876D844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDAF25FF-3F57-4597-BD0A-D1806876D844}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDAF25FF-3F57-4597-BD0A-D1806876D844}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDAF25FF-3F57-4597-BD0A-D1806876D844}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {69BABAB0-BEC7-4D12-ABB5-0D59933CBEF1} + EndGlobalSection +EndGlobal diff --git a/wwwroot/blazor-ui.css b/wwwroot/blazor-ui.css new file mode 100644 index 0000000..7d379d7 --- /dev/null +++ b/wwwroot/blazor-ui.css @@ -0,0 +1,61 @@ +#blazor-error-ui { + background: #ffffe0; + bottom: 0; + box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); + display: none; + left: 0; + padding: .6rem 1.25rem .7rem 1.25rem; + position: fixed; + right: 0; + z-index: 1000 +} + +#blazor-error-ui .dismiss { + cursor: pointer; + position: absolute; + right: .75rem; + top: .5rem +} + +.blazor-error-boundary { + background: url(data:image/svg+xml;base64,P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iA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; + padding: 1rem 1rem 1rem 3.7rem; + color: white; +} + +.blazor-error-boundary::after { + content: "An error has occurred." +} + +.loading-progress { + position: relative; + display: block; + width: 8rem; + height: 8rem; + margin: 20vh auto 1rem auto; +} + +.loading-progress circle { + fill: none; + stroke: #e0e0e0; + stroke-width: 0.6rem; + transform-origin: 50% 50%; + transform: rotate(-90deg); +} + +.loading-progress circle:last-child { + stroke: #1b6ec2; + stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; + transition: stroke-dasharray 0.05s ease-in-out; +} + +.loading-progress-text { + position: absolute; + text-align: center; + font-weight: bold; + inset: calc(20vh + 3.25rem) 0 auto 0.2rem; +} + +.loading-progress-text:after { + content: var(--blazor-load-percentage-text, "Loading"); +} \ No newline at end of file diff --git a/wwwroot/index.html b/wwwroot/index.html index 5765bf8..5620c64 100644 --- a/wwwroot/index.html +++ b/wwwroot/index.html @@ -6,17 +6,17 @@ SnowCatch - - - + +
-
Loading...
- + + + + +