Initial commit

This commit is contained in:
2024-10-11 11:06:37 +02:00
commit 04e52b67ec
183 changed files with 10760 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
@inherits LayoutComponentBase
<div class="page">
@*<div class="sidebar">
<NavMenu />
</div>*@
<NavMenu/>
<main>
<article class="content px-4">
@Body
</article>
</main>
</div>

View File

@@ -0,0 +1,77 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}
.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 640.98px) {
.top-row {
justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}
@media (min-width: 641px) {
.page {
flex-direction: row;
}
.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}

View File

@@ -0,0 +1,40 @@
<div class="container">
<nav>
<ul>
<li>
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span>Home</span>
<i class="ri-home-5-line"/>
</NavLink>
</li>
</ul>
<ul>
<li>
<a href="#" id="workout">
<span>Workout</span>
<i class="ri-empathize-line"/>
</a>
</li>
</ul>
<ul>
<li>
<a href="#" id="logbook">
<span>Logbook</span>
<i class="ri-health-book-line"></i>
</a>
</li>
</ul>
<ul>
<li>
<a href="#" id="settings">
<span>Impostazioni</span>
<i class="ri-settings-5-line"/>
</a>
</li>
</ul>
</nav>
</div>
@code {
}

View File

@@ -0,0 +1,81 @@
a {
text-decoration: none;
color: inherit;
}
ul {
list-style-type: none;
}
.container {
max-width: 100%;
margin: 0 auto;
padding: 0;
}
nav {
position: fixed;
bottom: 0;
width: 100%;
background-color: var(--ligther-color);
margin: 0;
display: flex;
border-radius: 40px 40px 0px 0px;
box-shadow: rgb(50 50 93 / 25%) 0 50px 100px 10px,
rgb(0 0 0 / 30%) 0 30px 60px -30px;
}
nav ul {
display: inline-flex;
align-items: center;
padding: 0;
flex: 0 0 25%;
justify-content: center;
}
nav :where(li a) {
position: relative;
}
nav ul li a {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column-reverse;
padding: 1em;
line-height: 1.4;
-webkit-transition: all .3s ease-out;
transition: all .3s ease-out;
}
nav ul li a:hover {
color: var(--primary-color);
}
nav ul li a i {
font-size: 1.5rem;
}
nav ul li a span {
font-size: 0.9rem;
}
/* animations */
nav li.active a::before, nav li.active a::after {
content: "";
position: absolute;
background-color: var(--primary-color);
z-index: -1;
}
nav li.active a::before {
top: 5%;
width: calc(100% - 0px);
height: 100%;
border-radius: 25px;
}
nav li.active a {
color: var(--ligther-color);
}

View File

@@ -0,0 +1,38 @@
<nav class="navbar navbar-expand justify-content-center">
<div class="container-fluid">
<ul class="navbar-nav nav-justified w-100 text-center">
<li class="nav-item">
<NavLink class="nav-link " href="workout" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-empathize-line"/>
@* <span>Workout</span> *@
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-home-5-line"/>
@* <span>Home</span> *@
</div>
</NavLink>
</li>
<li class="nav-item">
<NavLink class="nav-link" href="logbook" Match="NavLinkMatch.All">
<div class="d-flex flex-column">
<i class="ri-health-book-line"></i>
@* <span>Log Book</span> *@
</div>
</NavLink>
</li>
@* <li class="nav-item"> *@
@* <NavLink class="nav-link d-flex flex-column" href="settings" Match="NavLinkMatch.All"> *@
@* <i class="ri-settings-5-line"/> *@
@* <span>Impostazioni</span> *@
@* </NavLink> *@
@* </li> *@
</ul>
</div>
</nav>

View File

@@ -0,0 +1,50 @@
.navbar {
background-color: var(--ligther-color);
border-radius: 50px 50px 0 0;
border: #eceff2 solid 1px;
position: fixed;
bottom: 0;
width: 100%;
}
.nav-item {
font-size: 0.9rem;
padding-bottom: 0.5rem;
}
.nav-item ::deep a {
color: var(--darker-color);
display: flex;
align-items: center;
line-height: 1.4;
justify-content: center;
}
.nav-item ::deep a > div {
width: 4.3rem;
height: 4.3rem;
border-radius: 100px;
justify-content: center;
padding-bottom: 0.1rem;
-webkit-transition: all .3s ease-out;
transition: all .3s ease-out;
}
.nav-item ::deep a.active > div {
background-color: var(--primary-color);
color: white;
}
/*.nav-item a:hover :not(.active) {*/
/* background-color: rgba(255, 255, 255, 0.1);*/
/* color: var(--primary-color);*/
/*}*/
.nav-item ::deep a i {
font-size: 2rem;
}
.nav-item ::deep a span {
font-size: 0.9rem;
}

View File

@@ -0,0 +1,16 @@
@page "/counter"
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}

View File

@@ -0,0 +1,23 @@
@page "/device-form-factor"
@using Template.Shared.Interfaces
@inject IFormFactor FormFactor
<PageTitle>Form Factor</PageTitle>
<h1>Device Form Factor</h1>
<p>You are running on:</p>
<ul>
<li>Form Factor: @factor</li>
<li>Platform: @platform</li>
</ul>
<p>
<em>This component is defined in the Template.Shared library.</em>
</p>
@code {
private string factor => FormFactor.GetFormFactor();
private string platform => FormFactor.GetPlatform();
}

View File

@@ -0,0 +1,15 @@
@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
<Modal @ref="modal" title="Full screen" Fullscreen="ModalFullscreen.Always">
<BodyTemplate>...</BodyTemplate>
</Modal>
<Button Color="ButtonColor.Primary" @onclick="() => modal.ShowAsync()">Full screen</Button>
@code {
private Modal modal = default!;
}

View File

@@ -0,0 +1,6 @@
@page "/settings"
<h3>Impostazioni</h3>
@code {
}

View File

@@ -0,0 +1,10 @@
@page "/logbook"
@using Template.Shared.Components.SingleElements
<h3 class="page-title">Log book</h3>
<NoDataAvailable ImageSource="_content/Template.Shared/images/log-book.svg"
Text="Nessun log book memorizzato"/>
@code {
}

View File

@@ -0,0 +1,61 @@
@page "/weather"
<h1>Weather</h1>
<p>This component demonstrates showing data.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate a loading indicator
await Task.Delay(500);
var startDate = DateOnly.FromDateTime(DateTime.Now);
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = summaries[Random.Shared.Next(summaries.Length)]
}).ToArray();
}
private class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}

View File

@@ -0,0 +1,12 @@
@page "/workout"
@using Template.Shared.Components.SingleElements
<h3 class="page-title">Workout</h3>
<NoDataAvailable ImageSource="_content/Template.Shared/images/man-doing-squats.svg"
Text="Nessun workout disponibile"/>
@code {
}

View File

@@ -0,0 +1,6 @@
<Router AppAssembly="@typeof(Routes).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
</Router>

View File

@@ -0,0 +1,11 @@
<div class="no-data opacity-75 d-flex flex-column align-items-center">
<img
src="@ImageSource"/>
<p class="mt-3">@Text</p>
</div>
@code {
[Parameter] public string ImageSource { get; set; } = string.Empty;
[Parameter] public string Text { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,13 @@
.no-data {
position: fixed;
top: 35%;
width: calc(100% - 3rem); /* remove page padding */
}
.no-data img {
width: 60%;
}
.no-data p {
font-size: 1.2rem;
}