|
2 | 2 | @using TomAndJerry.Services |
3 | 3 | @using TomAndJerry.Model |
4 | 4 | @using TomAndJerry.Component |
| 5 | +@using TomAndJerry.Utils |
5 | 6 | @inject NavigationManager nav |
6 | 7 | @inject IVideoService VideoService |
7 | 8 | @inject IStateService StateService |
8 | 9 | @inject IJSRuntime JSRuntime |
9 | 10 | @inject IStickerService StickerService |
| 11 | +@inject IRandomFactsService RandomFactsService |
10 | 12 | <PageTitle>Home - Tom & Jerry</PageTitle> |
11 | 13 |
|
12 | 14 | <div class="min-h-screen cartoon-bg"> |
|
130 | 132 | class="px-6 sm:px-8 py-3 sm:py-4 bg-soft-blue text-amber-800 rounded-2xl hover:bg-cartoon-yellow transition-colors font-bold font-comic text-base sm:text-lg border-2 border-amber-800 shadow-lg hover:shadow-xl transform hover:-translate-y-1"> |
131 | 133 | 📺 View All |
132 | 134 | </button> |
| 135 | + <button @onclick="GoToQuiz" |
| 136 | + class="px-6 sm:px-8 py-3 sm:py-4 bg-cartoon-pink text-white rounded-2xl hover:bg-cartoon-red transition-colors font-bold font-comic text-base sm:text-lg border-2 border-white/30 shadow-lg hover:shadow-xl transform hover:-translate-y-1"> |
| 137 | + 🧠 Take Quiz |
| 138 | + </button> |
133 | 139 | <button @onclick="ShowRandomFact" |
134 | 140 | class="px-6 py-4 bg-cartoon-yellow/20 backdrop-blur-sm text-white rounded-2xl hover:bg-cartoon-yellow/30 transition-all font-bold font-comic text-lg border-2 border-cartoon-yellow/30"> |
135 | 141 | 💡 Random Fact |
|
427 | 433 | await ScrollToSection("sticker-gallery"); |
428 | 434 | } |
429 | 435 |
|
| 436 | + private void GoToQuiz() |
| 437 | + { |
| 438 | + nav.NavigateTo("quiz"); |
| 439 | + } |
| 440 | + |
430 | 441 | private void RefreshStickers() |
431 | 442 | { |
432 | 443 | // This will trigger a refresh of the sticker gallery |
|
457 | 468 |
|
458 | 469 | private async Task ShowRandomFact() |
459 | 470 | { |
460 | | - string[] facts = { |
461 | | - "Tom & Jerry won 7 Academy Awards for Best Animated Short Film!", |
462 | | - "The original creators were William Hanna and Joseph Barbera, who later founded Hanna-Barbera.", |
463 | | - "Tom's full name is Thomas Cat, and Jerry's full name is Gerald Mouse.", |
464 | | - "The show was originally called 'Puss Gets the Boot' before becoming Tom & Jerry.", |
465 | | - "Over 160 episodes were produced between 1940 and 1958.", |
466 | | - "Tom & Jerry has been translated into over 30 languages worldwide.", |
467 | | - "The characters rarely speak - most communication is through actions and expressions.", |
468 | | - "Tom & Jerry was one of the first cartoons to use limited animation techniques.", |
469 | | - "The show has been rebooted multiple times with different animation styles.", |
470 | | - "Tom & Jerry merchandise has generated billions in revenue over the decades." |
471 | | - }; |
472 | | - |
473 | | - var random = new Random(); |
474 | | - var fact = facts[random.Next(facts.Length)]; |
475 | | - |
| 471 | + var fact = RandomFactsService.GetRandomFact(); |
476 | 472 | await snackbar.ShowAsync("🎭 Fun Fact", fact, "💡", SnackbarType.Info, 6000); |
477 | 473 | } |
478 | 474 |
|
|
0 commit comments