diff --git a/Otakians/Pages/Index.razor b/Otakians/Pages/Index.razor index c39ab8f..bfdadd3 100644 --- a/Otakians/Pages/Index.razor +++ b/Otakians/Pages/Index.razor @@ -20,13 +20,15 @@ @for (int i = 0; i < 100; i++) { - - + int postId = (LoadedImages.Count > i) ? LoadedImages[i] : GetRandomImageNumber(); + + + - @("@" + RandomUsernames[random.Next(0, RandomUsernames.Length)]) + @("@" + RandomUsernames[postId]) - + @@ -51,7 +53,7 @@ private Random random = new Random(); const int numImages = 211; - string GetRandomImage() + int GetRandomImageNumber() { int selectedImage; reselect: @@ -60,21 +62,30 @@ goto reselect; LoadedImages.Add(selectedImage); - return $@"\images\AnimeImages\AnimeImage ({selectedImage}).jpeg"; + return selectedImage; + } + + string GetImage(int imageIndex) + { + return $@"\images\AnimeImages\AnimeImage ({imageIndex}).jpeg"; } protected override void OnAfterRender(bool firstRender) { - if (!firstRender) - { - LoadedImages.Clear(); - } + } + // TODO: Add a "save post" button to each post. + string[] RandomUsernames = new string[1000]; protected override async Task OnInitializedAsync() { RandomUsernames = (await Http.GetStringAsync("RandomUsernames.txt")).Split("\n"); } + + void ClickPost(int postImage) + { + Console.WriteLine(postImage); + } } \ No newline at end of file diff --git a/Otakians/Shared/MainLayout.razor b/Otakians/Shared/MainLayout.razor index b07e6d1..0957e67 100644 --- a/Otakians/Shared/MainLayout.razor +++ b/Otakians/Shared/MainLayout.razor @@ -4,16 +4,12 @@ - @* - *@ Primary - - - + BT - + Posts Library @@ -21,7 +17,7 @@ - + Store Library @@ -37,15 +33,13 @@ @code { - bool openStart = false; - bool openEnd = false; + bool openContentDrawer = false; + bool openProfileDrawer = false; - void ToggleDrawer(Anchor anchor) + void ToggleDrawer() { - if (anchor == Anchor.Start) - openStart = !openStart; - if (anchor == Anchor.End) - openEnd = !openEnd; + Console.WriteLine("Open!"); + openProfileDrawer = !openProfileDrawer; } void getPos()