Skip to content

Commit 1253c5f

Browse files
author
punkouter25
committed
Remove PWA functionality, remove client logging, update Player 2 keys to 7-8-9-0, fix Results page navigation, clean up appsettings
1 parent 6a5a0eb commit 1253c5f

File tree

20 files changed

+37
-803
lines changed

20 files changed

+37
-803
lines changed

AGENTS.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,23 +114,15 @@ Favor reputable, well-maintained open-source libraries. All dependencies must be
114114

115115
---
116116

117-
## **12. Progressive Web App (PWA) Requirements**
118-
119-
* **Manifest:** Ensure `manifest.webmanifest` is properly configured with app name, icons, theme colors, and display mode.
120-
* **Service Worker:** Implement a service worker (`service-worker.js`) for offline support and caching strategies.
121-
* **Installation:** The app must be installable on mobile devices as a PWA with proper icons and splash screens.
122-
123-
---
124-
125-
## **13. Responsive Design**
117+
## **12. Responsive Design**
126118

127119
* All UI components must be responsive and work well on both desktop and mobile devices.
128120
* Use Bootstrap's responsive grid system and Radzen.Blazor's built-in responsive components.
129121
* Test layouts in both portrait and landscape orientations on mobile devices.
130122

131123
---
132124

133-
## **14. Local Development Ports**
125+
## **13. Local Development Ports**
134126

135127
* **HTTP:** `http://localhost:5000`
136128
* **HTTPS:** `https://localhost:5001`

PoFunQuiz.Client/Components/App.razor

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
<link rel="stylesheet" href="@Assets["PoFunQuiz.Client.styles.css"]" />
1313
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
1414
<link rel="icon" type="image/png" href="favicon.png" />
15-
<link rel="manifest" href="manifest.webmanifest" />
16-
<link rel="apple-touch-icon" href="images/icon-192.png" />
1715
<HeadOutlet />
1816
</head>
1917

@@ -23,7 +21,6 @@
2321
<script src="_framework/blazor.web.js"></script>
2422
<script src="js/app.js"></script>
2523
<script src="js/gameboard.js"></script>
26-
<script src="js/pwa.js"></script>
2724

2825
<script>
2926
// Initialize Blazor connection after the framework is loaded

PoFunQuiz.Client/Components/Pages/GameBoard.razor

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@
125125
@for (int i = 0; i < question.Options.Count; i++)
126126
{
127127
var index = i;
128+
var keyNumber = i == 0 ? "7" : i == 1 ? "8" : i == 2 ? "9" : "0";
128129
<div class="option-item @GetAnswerItemClass(2, index)"
129130
@onclick="@(async () => await LogAndHandle(2, index))">
130-
<span class="option-number">@(i + 1)</span>
131+
<span class="option-number">@keyNumber</span>
131132
<span class="option-text">@question.Options[i]</span>
132133
</div>
133134
}
@@ -439,10 +440,10 @@
439440

440441
if (!Player2HasFinished && Player2QuestionIndex < GameState.CurrentGame.Player2Questions.Count)
441442
{
442-
if (e.Key == "6") HandlePlayerAnswer(2, 0);
443-
else if (e.Key == "7") HandlePlayerAnswer(2, 1);
444-
else if (e.Key == "8") HandlePlayerAnswer(2, 2);
445-
else if (e.Key == "9") HandlePlayerAnswer(2, 3);
443+
if (e.Key == "7") HandlePlayerAnswer(2, 0);
444+
else if (e.Key == "8") HandlePlayerAnswer(2, 1);
445+
else if (e.Key == "9") HandlePlayerAnswer(2, 2);
446+
else if (e.Key == "0") HandlePlayerAnswer(2, 3);
446447
}
447448
}
448449

PoFunQuiz.Client/Components/Pages/GameSetup.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ else
7575
<RadzenCard class="rz-p-2 rz-display-flex rz-flex-column rz-align-items-center">
7676
<RadzenText TextStyle="TextStyle.H5" class="rz-text-secondary">Player 2</RadzenText>
7777
<RadzenAvatar Color="AvatarColor.Secondary" Size="AvatarSize.Medium" class="rz-my-2" Text="@(GameState.CurrentGame?.Player2?.Initials ?? "P2")" />
78-
<RadzenText TextStyle="TextStyle.Body2" class="rz-mb-2">Use keys 6-9</RadzenText>
78+
<RadzenText TextStyle="TextStyle.Body2" class="rz-mb-2">Use keys 7-0</RadzenText>
7979
@if (!Player2Ready)
8080
{
8181
<RadzenButton ButtonStyle="ButtonStyle.Secondary"
@@ -174,7 +174,7 @@ else
174174
SetPlayerReady(1);
175175
}
176176

177-
if (!Player2Ready && (e.Key == "6" || e.Key == "7" || e.Key == "8" || e.Key == "9"))
177+
if (!Player2Ready && (e.Key == "7" || e.Key == "8" || e.Key == "9" || e.Key == "0"))
178178
{
179179
SetPlayerReady(2);
180180
}

PoFunQuiz.Client/Components/Pages/Home.razor

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@page "/"
22
@inject NavigationManager NavigationManager
3-
@inject PoFunQuiz.Client.Services.IClientLogger ClientLogger
43

54
<PageTitle>PoFunQuiz - Home</PageTitle>
65

@@ -40,27 +39,15 @@
4039
private string player2Initials = "";
4140
private string selectedTopic = "";
4241

43-
private async Task StartGame()
42+
private void StartGame()
4443
{
4544
if (!string.IsNullOrWhiteSpace(player1Initials) && !string.IsNullOrWhiteSpace(player2Initials) && !string.IsNullOrWhiteSpace(selectedTopic))
4645
{
47-
// Log game start event
48-
await ClientLogger.LogInformation(
49-
$"Game started: {player1Initials} vs {player2Initials}, Topic: {selectedTopic}",
50-
page: "/",
51-
component: "Home");
52-
5346
// Navigate to GameSetup, passing both player initials and topic as query parameters
5447
NavigationManager.NavigateTo($"/gamesetup?player1={player1Initials}&player2={player2Initials}&topic={selectedTopic}");
5548
}
5649
else
5750
{
58-
// Log validation error
59-
await ClientLogger.LogWarning(
60-
"Game start attempted with incomplete fields",
61-
page: "/",
62-
component: "Home");
63-
6451
// Optionally, add some user feedback here if fields are not filled
6552
Console.WriteLine("Please enter initials for both players and select a topic.");
6653
}

PoFunQuiz.Client/Components/Pages/Results.razor

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,10 @@ else
138138
</RadzenRow>
139139

140140
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="2" class="rz-mt-4 rz-flex-wrap">
141-
<RadzenButton ButtonStyle="ButtonStyle.Primary"
142-
Size="ButtonSize.Small"
143-
Click="@PlayAgain"
144-
Text="PLAY AGAIN" />
145-
<RadzenButton ButtonStyle="ButtonStyle.Light"
146-
Shade="Shade.Lighter"
147-
Size="ButtonSize.Small"
148-
Path="/leaderboard"
149-
Text="VIEW LEADERBOARD" />
150141
<RadzenButton Variant="Variant.Text"
151142
Shade="Shade.Lighter"
152143
Size="ButtonSize.Small"
153-
Path="/"
144+
Click="@GoToMainMenu"
154145
Text="MAIN MENU" />
155146
</RadzenStack>
156147
</RadzenCard>
@@ -253,6 +244,12 @@ else
253244
return "00:00";
254245
}
255246

247+
private void GoToMainMenu()
248+
{
249+
GameState.CurrentGame = null;
250+
Navigation.NavigateTo("/", forceLoad: true);
251+
}
252+
256253
private void PlayAgain()
257254
{
258255
if (GameState.CurrentGame?.Player1 == null || GameState.CurrentGame?.Player2 == null)

PoFunQuiz.Client/Program.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
// Register the client-side question generator service
2424
builder.Services.AddScoped<IQuestionGeneratorService, ClientQuestionGeneratorService>();
2525

26-
// Register client-side logging service
27-
builder.Services.AddScoped<IClientLogger, ClientLogger>();
28-
2926
// Add application state services
3027
builder.Services.AddSingleton<GameState>();
3128
builder.Services.AddSingleton<ConnectionState>();

PoFunQuiz.Client/Services/ClientLogger.cs

Lines changed: 0 additions & 92 deletions
This file was deleted.

PoFunQuiz.Client/wwwroot/index.html

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
<meta name="theme-color" content="#6a11cb" />
99
<title>PoFunQuiz</title>
1010
<base href="/" />
11-
<link rel="manifest" href="manifest.webmanifest" />
12-
<link rel="apple-touch-icon" href="images/icon-192.png" />
1311
<link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.min.css" />
1412
<link rel="stylesheet" href="css/app.css" />
1513
<link rel="icon" type="image/png" href="favicon.png" />
@@ -31,20 +29,9 @@
3129
<a href="." class="reload">Reload</a>
3230
<span class="dismiss">🗙</span>
3331
</div>
32+
<script src="js/unregister-sw.js"></script>
3433
<script src="js/app.js"></script>
35-
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
36-
<script>
37-
if ('serviceWorker' in navigator) {
38-
navigator.serviceWorker.register('service-worker.js')
39-
.then(function(registration) {
40-
console.log('Service Worker registered with scope:', registration.scope);
41-
})
42-
.catch(function(error) {
43-
console.log('Service Worker registration failed:', error);
44-
});
45-
}
46-
Blazor.start();
47-
</script>
34+
<script src="_framework/blazor.webassembly.js"></script>
4835
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
4936
</body>
5037

0 commit comments

Comments
 (0)