Skip to content

Commit

Permalink
Added basic layout to get started more easily on developing the front…
Browse files Browse the repository at this point in the history
…-end.
  • Loading branch information
stijuh committed May 23, 2023
1 parent 76c881d commit 50a7016
Show file tree
Hide file tree
Showing 14 changed files with 150 additions and 41 deletions.
1 change: 1 addition & 0 deletions GainsTracker.ClientNative/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<div id="app">Loading...</div>

<script autostart="false" src="_framework/blazor.webview.js"></script>
<script src="/_framework/aspnetcore-browser-refresh.js"></script>
</body>

</html>
1 change: 1 addition & 0 deletions GainsTracker.ClientWeb/GainsTracker.ClientWeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseRazorSourceGenerator>true</UseRazorSourceGenerator>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion GainsTracker.ClientWeb/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@code {

protected override void OnInitialized()
protected override void OnAfterRender(bool firstRender)
{
NavigationManager.NavigateTo("/login");
}
Expand Down
2 changes: 2 additions & 0 deletions GainsTracker.ClientWeb/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using GainsTracker.UI.Services;
using Microsoft.Extensions.FileProviders;

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddRazorPages();

// Register dependencies for injection and create app.
builder.Services.AddScoped<IGainsTrackerService, GainsTrackerService>();
Expand Down
46 changes: 23 additions & 23 deletions GainsTracker.UI/GainsTracker.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,44 @@


<ItemGroup>
<SupportedPlatform Include="browser"/>
<SupportedPlatform Include="browser" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.15"/>
<PackageReference Include="System.Security.Permissions" Version="6.0.0"/>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.15" />
<PackageReference Include="System.Security.Permissions" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<_ContentIncludedByDefault Remove="wwwroot\background.png"/>
<_ContentIncludedByDefault Remove="wwwroot\exampleJsInterop.js"/>
<_ContentIncludedByDefault Remove="wwwroot\css\app.css"/>
<_ContentIncludedByDefault Remove="wwwroot\css\darkMode.css"/>
<_ContentIncludedByDefault Remove="wwwroot\css\lightMode.css"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\FONT-LICENSE"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\css\open-iconic-bootstrap.min.css"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.eot"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.otf"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.svg"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.ttf"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.woff"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\ICON-LICENSE"/>
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\README.md"/>
<_ContentIncludedByDefault Remove="wwwroot\favicon.ico"/>
<_ContentIncludedByDefault Remove="wwwroot\index.html"/>
<_ContentIncludedByDefault Remove="wwwroot\background.png" />
<_ContentIncludedByDefault Remove="wwwroot\exampleJsInterop.js" />
<_ContentIncludedByDefault Remove="wwwroot\css\app.css" />
<_ContentIncludedByDefault Remove="wwwroot\css\darkMode.css" />
<_ContentIncludedByDefault Remove="wwwroot\css\lightMode.css" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\FONT-LICENSE" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\css\open-iconic-bootstrap.min.css" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.eot" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.otf" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.svg" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.ttf" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.woff" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\ICON-LICENSE" />
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\README.md" />
<_ContentIncludedByDefault Remove="wwwroot\favicon.ico" />
<_ContentIncludedByDefault Remove="wwwroot\index.html" />
</ItemGroup>

<ItemGroup>
<Folder Include="wwwroot\css\"/>
<Folder Include="wwwroot\script\"/>
<Folder Include="wwwroot\css\" />
<Folder Include="wwwroot\script\" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="Components\ElementManipulator.razor"/>
<AdditionalFiles Include="Components\ElementManipulator.razor" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GainsTracker.Common\GainsTracker.Common.csproj"/>
<ProjectReference Include="..\GainsTracker.Common\GainsTracker.Common.csproj" />
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions GainsTracker.UI/Pages/Activity.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@page "/activities"

<h3>Activities</h3>

<ol>
@foreach (var activity in RecentActivities)
{
<li>@activity</li>
}
</ol>

@code {

public List<string> RecentActivities = new List<string>()
{
"@brands hit a new PB! 60kg on the Bench Press.",
"@meneerovereem set a new goal for himself. 0 -> 1 boulder trails"
};
}
4 changes: 3 additions & 1 deletion GainsTracker.UI/Pages/Dashboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

<h1>GainsTracker Dashboard</h1>

Gainer time
<p>Gainer time</p>

hav fun joyo :D
9 changes: 9 additions & 0 deletions GainsTracker.UI/Pages/Popups/LogPopup.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@page "/logging"

<h3>LogPopup</h3>

<p>No clue how popups work yet, so that's something to find out :D</p>

@code {

}
7 changes: 7 additions & 0 deletions GainsTracker.UI/Pages/UserProfile.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@page "/profile"

<h3>UserProfile</h3>

@code {

}
2 changes: 1 addition & 1 deletion GainsTracker.UI/Shared/MainLayout.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
position: absolute;
height: 100%;
width: 100%;
overflow: hidden;
}

main {
Expand All @@ -14,7 +15,6 @@ main {
display: flex;
flex-direction: column-reverse;
background-color: #0b6200;
margin-top: 5px;
bottom: 0;
width: 100%;
}
Expand Down
28 changes: 24 additions & 4 deletions GainsTracker.UI/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
<nav class="flex-column">
<nav class="nav-bar">
@* Dashboard *@
<div class="nav-item">
<NavLink class="nav-link" href="dashboard" Match="NavLinkMatch.All">
Dashboard
<p class="nav-icon">|^|</p>
<p class="nav-description">Dashboard</p>
</NavLink>
</div>

@* Log *@
<div class="nav-item">
<NavLink class="nav-link" href="login">
Login page
<NavLink class="nav-link" href="logging">
<p class="nav-icon">[|</p>
<p class="nav-description">Logging</p>
</NavLink>
</div>

@* Activity *@
<div class="nav-item">
<NavLink class="nav-link" href="activities">
<p class="nav-icon">^</p>
<p class="nav-description">Activities</p>
</NavLink>
</div>

@* Profile *@
<div class="nav-item">
<NavLink class="nav-link" href="profile">
<p class="nav-icon">O</p>
<p class="nav-description">Profile</p>
</NavLink>
</div>
</nav>
34 changes: 32 additions & 2 deletions GainsTracker.UI/Shared/NavMenu.razor.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
.nav-bar {
display: flex;
justify-content: space-evenly;
}

.nav-item {
display: inline-block;
font-size: 0.9rem;
background-color: var(--primary-color);
padding: 1.5rem;
cursor: pointer;
}

::deep .nav-link {
display: block;
font-size: 1.5rem;
text-decoration: none;
padding: 2.5rem;
}

.nav-item:hover {
background-color: lightgreen;
}

.nav-description {
display: none;
}

/* For tablet up to desktop */
@media only screen and (min-width: 600px) {
.nav-icon {
display: none;
}

.nav-description {
display: block;
}
}
11 changes: 10 additions & 1 deletion GainsTracker.UI/wwwroot/css/site.css
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
/* The global styling that applies throughout the whole UI. */
/* The global styling that applies throughout the whole UI. */

body {
margin: 0;
}

/* unclicked -> hover -> clicked -> visited link style */
a:link, a:hover, a:active, a:visited {
text-decoration: none;
}
25 changes: 17 additions & 8 deletions GainsTracker.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GainsTracker.CoreAPI", "GainsTracker.CoreAPI\GainsTracker.CoreAPI.csproj", "{9210CFA0-2BDD-46DE-8FD4-3767BF660473}"
# Visual Studio Version 17
VisualStudioVersion = 17.5.33530.505
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GainsTracker.CoreAPI", "GainsTracker.CoreAPI\GainsTracker.CoreAPI.csproj", "{9210CFA0-2BDD-46DE-8FD4-3767BF660473}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GainsTracker.UI", "GainsTracker.UI\GainsTracker.UI.csproj", "{4354990B-2912-4953-B842-B126AD299B1E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GainsTracker.UI", "GainsTracker.UI\GainsTracker.UI.csproj", "{4354990B-2912-4953-B842-B126AD299B1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GainsTracker.ClientNative", "GainsTracker.ClientNative\GainsTracker.ClientNative.csproj", "{4ACB81DD-CFCF-4D81-88E0-B860BE5F8B5B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GainsTracker.ClientNative", "GainsTracker.ClientNative\GainsTracker.ClientNative.csproj", "{4ACB81DD-CFCF-4D81-88E0-B860BE5F8B5B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GainsTracker.Common", "GainsTracker.Common\GainsTracker.Common.csproj", "{412D30DA-7B16-4D3C-8ED0-DFF544305178}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GainsTracker.Common", "GainsTracker.Common\GainsTracker.Common.csproj", "{412D30DA-7B16-4D3C-8ED0-DFF544305178}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GainsTracker.Testing.ClientNative", "GainsTracker.Testing.ClientNative\GainsTracker.Testing.ClientNative.csproj", "{3CCA4E21-F530-49A0-8EA0-17EB43D901E1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GainsTracker.Testing.ClientNative", "GainsTracker.Testing.ClientNative\GainsTracker.Testing.ClientNative.csproj", "{3CCA4E21-F530-49A0-8EA0-17EB43D901E1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GainsTracker.Testing.CoreAPI", "GainsTracker.Testing.CoreAPI\GainsTracker.Testing.CoreAPI.csproj", "{5196C9DD-7FFE-4729-8A63-7BC7046A907C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GainsTracker.Testing.CoreAPI", "GainsTracker.Testing.CoreAPI\GainsTracker.Testing.CoreAPI.csproj", "{5196C9DD-7FFE-4729-8A63-7BC7046A907C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GainsTracker.Testing.UI", "GainsTracker.Testing.UI\GainsTracker.Testing.UI.csproj", "{75BFFEC2-C80D-43D0-8FD4-FAEDA0FF4F9F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GainsTracker.Testing.UI", "GainsTracker.Testing.UI\GainsTracker.Testing.UI.csproj", "{75BFFEC2-C80D-43D0-8FD4-FAEDA0FF4F9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GainsTracker.ClientWeb", "GainsTracker.ClientWeb\GainsTracker.ClientWeb.csproj", "{B1508A96-07FE-44C3-B4F8-68AC203AEBB3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GainsTracker.ClientWeb", "GainsTracker.ClientWeb\GainsTracker.ClientWeb.csproj", "{B1508A96-07FE-44C3-B4F8-68AC203AEBB3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -55,4 +58,10 @@ Global
{B1508A96-07FE-44C3-B4F8-68AC203AEBB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1508A96-07FE-44C3-B4F8-68AC203AEBB3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A3ED42A1-9AF6-4B41-B6C6-765DF2424467}
EndGlobalSection
EndGlobal

0 comments on commit 50a7016

Please sign in to comment.