|
| 1 | +@inject NavigationManager nav |
| 2 | + |
| 3 | +<nav class="fixed bottom-0 left-0 right-0 z-50 bg-white/95 backdrop-blur-md border-t border-gray-200 shadow-lg"> |
| 4 | + <div class="max-w-7xl mx-auto"> |
| 5 | + <div class="grid grid-cols-4"> |
| 6 | + <button @onclick="GoToHomePage" |
| 7 | + class="flex flex-col items-center justify-center py-2 text-xs font-comic @(IsActive("/") || IsActive("/playmedia/") ? "text-red-600" : "text-gray-600")"> |
| 8 | + <span class="text-lg">🎬</span> |
| 9 | + <span>Episodes</span> |
| 10 | + </button> |
| 11 | + <button @onclick="GoToStickers" |
| 12 | + class="flex flex-col items-center justify-center py-2 text-xs font-comic @(IsActive("/stickers") ? "text-red-600" : "text-gray-600")"> |
| 13 | + <span class="text-lg">🎭</span> |
| 14 | + <span>Stickers</span> |
| 15 | + </button> |
| 16 | + <button @onclick="GoToSearch" |
| 17 | + class="flex flex-col items-center justify-center py-2 text-xs font-comic @(IsActive("/Search") ? "text-red-600" : "text-gray-600")"> |
| 18 | + <span class="text-lg">🔍</span> |
| 19 | + <span>Search</span> |
| 20 | + </button> |
| 21 | + <button @onclick="GoToQuiz" |
| 22 | + class="flex flex-col items-center justify-center py-2 text-xs font-comic @(IsActive("/quiz") ? "text-red-600" : "text-gray-600")"> |
| 23 | + <span class="text-lg">🧠</span> |
| 24 | + <span>Quiz</span> |
| 25 | + </button> |
| 26 | + </div> |
| 27 | + </div> |
| 28 | +</nav> |
| 29 | + |
| 30 | +@code { |
| 31 | + private bool IsActive(string path) |
| 32 | + { |
| 33 | + var uri = nav.Uri; |
| 34 | + if (string.IsNullOrWhiteSpace(uri)) return false; |
| 35 | + // Normalize trailing slashes for comparison |
| 36 | + uri = uri.TrimEnd('/'); |
| 37 | + path = path.TrimEnd('/'); |
| 38 | + return uri.EndsWith(path, StringComparison.OrdinalIgnoreCase); |
| 39 | + } |
| 40 | + |
| 41 | + void GoToHomePage() |
| 42 | + { |
| 43 | + nav.NavigateTo("/"); |
| 44 | + } |
| 45 | + |
| 46 | + void GoToStickers() |
| 47 | + { |
| 48 | + nav.NavigateTo("/stickers"); |
| 49 | + } |
| 50 | + |
| 51 | + void GoToSearch() |
| 52 | + { |
| 53 | + nav.NavigateTo("/Search"); |
| 54 | + } |
| 55 | + |
| 56 | + void GoToQuiz() |
| 57 | + { |
| 58 | + nav.NavigateTo("/quiz"); |
| 59 | + } |
| 60 | +} |
| 61 | + |
| 62 | + |
0 commit comments