Finished the wewbsite!!!

This commit is contained in:
BOT Alex 2023-05-29 04:00:49 +02:00
parent 4e2158aea4
commit ee3c1c0b0a
6 changed files with 87 additions and 11 deletions

View File

@ -5,10 +5,11 @@
@inject Blazored.LocalStorage.ILocalStorageService localStorage @inject Blazored.LocalStorage.ILocalStorageService localStorage
@inject NavigationManager NavManager @inject NavigationManager NavManager
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IDialogService DialogService
<MudLayout Class="overflow-hidden"> <MudLayout Class="overflow-hidden">
<MudAppBar Elevation="1"> <MudAppBar Elevation="1">
<MudButton Variant="Variant.Filled" Color="Color.Primary" Disabled=false OnClick="DebugButton">Debug button</MudButton> <MudButton Variant="Variant.Filled" Color="Color.Primary" Disabled=true OnClick="DebugButton">Debug button</MudButton>
<MudSpacer /> <MudSpacer />
@if (!isLoggedIn) @if (!isLoggedIn)
{ {
@ -24,10 +25,11 @@
} }
</MudAppBar> </MudAppBar>
<MudDrawer @bind-Open="@openContentDrawer" ClipMode="DrawerClipMode.Always" Breakpoint="Breakpoint.Lg" PreserveOpenState="false" Elevation="1" Variant="@DrawerVariant.Mini" OpenMiniOnHover="true"> <MudDrawer @bind-Open="@openContentDrawer" Class="overflow-hidden" ClipMode="DrawerClipMode.Always" Breakpoint="Breakpoint.Lg" PreserveOpenState="false" Elevation="1" Variant="@DrawerVariant.Mini" OpenMiniOnHover="true">
<MudNavMenu> <MudNavMenu>
<MudNavLink Match="NavLinkMatch.All" Href="/Posts" Icon="@Icons.Material.Filled.Image">Posts</MudNavLink> <MudNavLink Match="NavLinkMatch.All" Href="/Posts" Icon="@Icons.Material.Filled.Image">Posts</MudNavLink>
<MudNavLink Match="NavLinkMatch.All" Href="/Chatting" Icon="@Icons.Material.Filled.Chat">Chat</MudNavLink> <MudNavLink Match="NavLinkMatch.All" Href="/Chatting" Icon="@Icons.Material.Filled.Chat">Chat</MudNavLink>
<MudNavLink Match="NavLinkMatch.All" Href="/FAQ" Icon="@Icons.Material.Filled.QuestionMark">FAQ</MudNavLink>
</MudNavMenu> </MudNavMenu>
</MudDrawer> </MudDrawer>
@ -49,9 +51,25 @@
</MudStack> </MudStack>
</MudPaper> </MudPaper>
} }
<MudSpacer />
<MudContainer Class="overflow-hidden ml-5 justify-center mb-4" Style="width: 200px;">
<MudIconButton Icon="@Icons.Custom.Brands.LinkedIn" Color="Color.Secondary" OnClick='()=>NavManager.NavigateTo("https://www.linkedin.com/in/zhentao-wei-3a3a0a182/", replace: true)' aria-label="github"></MudIconButton>
<MudIconButton Icon="@Icons.Material.Filled.VideogameAsset" Color="Color.Secondary" OnClick='()=>NavManager.NavigateTo("https://botalex.itch.io/", replace: true)' aria-label="itch.io"></MudIconButton>
<MudIconButton Icon="@Icons.Custom.Brands.GitHub" Color="Color.Secondary" OnClick='()=>NavManager.NavigateTo("https://stackoverflow.com/users/14683392/bot-alex", replace: true)' aria-label="stack overflow"></MudIconButton>
<MudIconButton Icon="@Icons.Custom.Brands.StackOverflow" Color="Color.Secondary" OnClick='()=>NavManager.NavigateTo("https://github.com/MagicBOTAlex", replace: true)' aria-label="github"></MudIconButton>
<MudIconButton Icon="@Icons.Custom.Brands.Discord" Color="Color.Secondary" @onclick="@(() =>
Snackbar.Add("BOT Alex#2733", Severity.Info, config =>
{
config.Icon = Icons.Custom.Brands.Discord;
config.IconSize = Size.Large;
}))" aria-label="discord">
</MudIconButton>
<MudIconButton Icon="@Icons.Custom.Brands.Reddit" Color="Color.Secondary" OnClick='()=>NavManager.NavigateTo("https://www.reddit.com/r/ProgrammerHumor/", replace: true)' aria-label="reddit"></MudIconButton>
</MudContainer>
</MudDrawer> </MudDrawer>
<MudMainContent Class="overflow-hidden" Style="min-height: 100vh"> <MudMainContent Style="min-height: 100vh">
@Body @Body
</MudMainContent> </MudMainContent>
</MudLayout> </MudLayout>
@ -212,7 +230,7 @@
{ {
var allUsers = await httpClient.GetFromJsonAsync<Dictionary<string, User>>("https://globalchat-4a89f-default-rtdb.europe-west1.firebasedatabase.app/Database/Users.json"); var allUsers = await httpClient.GetFromJsonAsync<Dictionary<string, User>>("https://globalchat-4a89f-default-rtdb.europe-west1.firebasedatabase.app/Database/Users.json");
if (allUsers == null) if (allUsers == null)
return null; return null;
User[] users = allUsers.Values.ToArray(); User[] users = allUsers.Values.ToArray();

View File

@ -1,6 +1,8 @@
@page "/Cookies" @page "/Cookies"
@inject NavigationManager NavManager @inject NavigationManager NavManager
@inject Blazored.LocalStorage.ILocalStorageService localStorage @inject Blazored.LocalStorage.ILocalStorageService localStorage
@inject DataCollectorService DCollector
<MudOverlay ZIndex="1400" DarkBackground="true" Visible=true Style="backdrop-filter:blur(5px)"> <MudOverlay ZIndex="1400" DarkBackground="true" Visible=true Style="backdrop-filter:blur(5px)">
<MudCard> <MudCard>
@ -35,5 +37,6 @@
{ {
await localStorage.SetItemAsync<bool>("AcceptedCookies", true); await localStorage.SetItemAsync<bool>("AcceptedCookies", true);
NavManager.NavigateTo("/Posts"); NavManager.NavigateTo("/Posts");
await DCollector.PushDataToAnalytics();
} }
} }

38
Otakians/Pages/FAQ.razor Normal file
View File

@ -0,0 +1,38 @@
@page "/FAQ"
<MudContainer>
<MudText Typo="Typo.h1" Class="my-10" Align="Align.Center">Fequently Asked Questions</MudText>
</MudContainer>
<MudContainer Class="justify-center overflow-scroll">
<MudContainer Style="max-width: 700px; width: 80vw; height: 100%;">
<MudPaper Elevation="2">
<MudStack Class="pa-4">
<MudPaper Class="pa-4" Elevation="6">
<MudText Typo="Typo.h5">How do i sign up for Otakians+?</MudText>
<MudDivider />
<MudText Typo="Typo.body1">This role has been temporarly been restricted to alpha testers of the site.</MudText>
</MudPaper>
@for (int i = 1; i < 1000; i++)
{
int temp = i;
@if (temp != 420)
{
<MudPaper Class="pa-4" Elevation="6">
<MudText Typo="Typo.h5">[Question @temp here]</MudText>
<MudDivider />
<MudText Typo="Typo.body1">[Answer @temp here]</MudText>
</MudPaper>
}
else
{
<MudPaper Class="pa-4" Elevation="6">
<MudImage ObjectFit=ObjectFit.Cover Style="max-width: 100%; max-height: 100%; filter: brightness(25%)" Src="/images/LookAtMeHector.jpg" />
</MudPaper>
}
}
</MudStack>
</MudPaper>
</MudContainer>
</MudContainer>

View File

@ -1,7 +1,5 @@
@page "/" @page "/"
@inject NavigationManager NavManager @inject NavigationManager NavManager
@inject DataCollectorService DCollector
<h1>2nd loading... Please wait</h1> <h1>2nd loading... Please wait</h1>

View File

@ -23,22 +23,33 @@
<MudImage Class="rounded-xl" Elevation="4" Src="@selectedPost.ImagePath" Width="500" Height="500"/> <MudImage Class="rounded-xl" Elevation="4" Src="@selectedPost.ImagePath" Width="500" Height="500"/>
<MudContainer Class="pa-5 d-flex align-center justify-content-start"> <MudContainer Class="pa-5 d-flex align-center justify-content-start">
<MudText> <MudText>
Damn [Image description here]
</MudText> </MudText>
<MudSpacer/> <MudSpacer/>
<MudIconButton Class="pa-4" Icon="@Icons.Material.Filled.Star" Variant="Variant.Filled" Color="Color.Primary"> text </MudIconButton> <MudIconButton Class="pa-4" Icon="@Icons.Material.Filled.Star" Variant="Variant.Filled" OnClick=FavoriteImage Color="Color.Primary"></MudIconButton>
</MudContainer> </MudContainer>
</MudPaper> </MudPaper>
</MudOverlay> </MudOverlay>
<MudOverlay ZIndex="1400" @bind-Visible="isShowingFavoriteOverlay" Style="backdrop-filter:blur(5px)" DarkBackground="true" AutoClose="true">
<MudPaper Class="pa-8">
<MudContainer Class="pa-0 d-flex justify-content-end">
<MudText Typo="Typo.h4">I am sorry</MudText>
<MudSpacer/>
<MudIcon Size="Size.Large" Icon="@Icons.Material.Filled.WarningAmber"/>
</MudContainer>
<MudText>Favoriting posts is restricted to Otakians+ users only.</MudText>
</MudPaper>
</MudOverlay>
<MudOverlay ZIndex="1400" @bind-Visible="isCreatePostWarningVisible" Style="backdrop-filter:blur(5px)" DarkBackground="true" AutoClose="true"> <MudOverlay ZIndex="1400" @bind-Visible="isCreatePostWarningVisible" Style="backdrop-filter:blur(5px)" DarkBackground="true" AutoClose="true">
<MudPaper Class="pa-8"> <MudPaper Class="pa-8">
<MudContainer Class="pa-0 d-flex justify-content-end"> <MudContainer Class="pa-0 d-flex justify-content-end">
<MudText Typo="Typo.h4">I am sorry</MudText> <MudText Typo="Typo.h4">I am sorry</MudText>
<MudSpacer/> <MudSpacer />
<MudIcon Size="Size.Large" Icon="@Icons.Material.Filled.WarningAmber"/> <MudIcon Size="Size.Large" Icon="@Icons.Material.Filled.WarningAmber" />
</MudContainer> </MudContainer>
<MudText >Posting is restricted to Otakians+ users only.</MudText> <MudText>Posting is restricted to Otakians+ users only.</MudText>
</MudPaper> </MudPaper>
</MudOverlay> </MudOverlay>
@ -88,6 +99,7 @@
@code { @code {
public bool isOverlayVisible = false; public bool isOverlayVisible = false;
bool isCreatePostWarningVisible = false; bool isCreatePostWarningVisible = false;
bool isShowingFavoriteOverlay = false;
bool isRefreshing = false; bool isRefreshing = false;
@ -103,6 +115,13 @@
StateHasChanged(); StateHasChanged();
} }
void FavoriteImage()
{
isOverlayVisible = false;
isShowingFavoriteOverlay = true;
StateHasChanged();
}
List<int> LoadedImages = new List<int>(); List<int> LoadedImages = new List<int>();
List<Post> posts = new List<Post>(); List<Post> posts = new List<Post>();

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB