Добавил пару новых страниц

This commit is contained in:
2024-10-28 02:46:07 +03:00
parent cb42b553cf
commit d82e68d9a5
11 changed files with 113 additions and 2098 deletions

2
.gitignore vendored
View File

@@ -491,3 +491,5 @@ FodyWeavers.xsd
# Built Visual Studio Code Extensions # Built Visual Studio Code Extensions
*.vsix *.vsix
src/Otchinslator/wwwroot/css/styles.css

View File

@@ -1,9 +1,17 @@
@inject NavigationManager Navigation @inject NavigationManager Navigation
@code { @code {
private static string _returnClass = "step-primary";
private int _lvl = 0; private int _lvl = 0;
private Dictionary<string, string> _links = new()
{
{ "Анкета", "/otchislenie/questionnaire" },
{ "Заявление", "/otchislenie/statement" },
{ "Отправка", "/otchislenie/result" },
{ "Свобода", "/otchislenie/congratulation" }
};
// TODO: Упростить это
protected override void OnInitialized() protected override void OnInitialized()
{ {
base.OnInitialized(); base.OnInitialized();
@@ -16,9 +24,12 @@
case "otchislenie/statement": case "otchislenie/statement":
_lvl = 2; _lvl = 2;
break; break;
case "otchislenie/congratulation": case "otchislenie/result":
_lvl = 3; _lvl = 3;
break; break;
case "otchislenie/congratulation":
_lvl = 4;
break;
} }
} }
} }
@@ -26,10 +37,28 @@
<footer class="card fixed bottom-0 w-96 h-20 bg-base-200 rounded-badge p-4 mb-3"> <footer class="card fixed bottom-0 w-96 h-20 bg-base-200 rounded-badge p-4 mb-3">
<div class="flex justify-center items-center"> <div class="flex justify-center items-center">
<ul class="steps justify-center center"> <ul class="steps justify-center center">
<a href="/" class="step step-primary">Выбор</a> <a href="/" class="step step-primary text-gray-500">Выбор</a>
<a href="/otchislenie/questionnaire" class="step @((MarkupString)(_lvl >= 1 ? _returnClass : ""))">Анкета</a> @foreach (int i in Enumerable.Range(1, 4))
<a href="/otchislenie/statement" class="step @((MarkupString)(_lvl >= 2 ? _returnClass : ""))">Заявление</a> {
<a href="/otchislenie/congratulation" class="step @((MarkupString)(_lvl >= 3 ? _returnClass : ""))" data-content="♿">Свобода</a> if (_lvl == 4 && i == 4)
{
<a href="/otchislenie/congratulation" class="step step-primary select-none " data-content="♿">Свобода</a>
continue;
}
if (_lvl == i)
{
<i class="step select-none step-primary">@_links.ElementAt(i - 1).Key</i>
}
else if (_lvl > i)
{
<a href="@_links.ElementAt(i - 1).Value" class="step step-primary select-none text-gray-500">@_links.ElementAt(i - 1).Key</a>
}
else
{
<i class="step select-none"> @_links.ElementAt(i - 1).Key</i>
}
}
</ul> </ul>
</div> </div>
</footer> </footer>

View File

@@ -1,6 +1,6 @@
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@inherits LayoutComponentBase @inherits LayoutComponentBase
@attribute [Authorize] // НЕ РАБОТАЕТ @attribute [Authorize]
<div class="flex items-center accent-error justify-center min-h-screen font-roboto text-primary-content"> <div class="flex items-center accent-error justify-center min-h-screen font-roboto text-primary-content">

View File

@@ -6,7 +6,7 @@
<div class="text-center mx-auto mb-4 font-bold text-4xl md:text-5xl w-max justify-center italic">Поздравляем!</div> <div class="text-center mx-auto mb-4 font-bold text-4xl md:text-5xl w-max justify-center italic">Поздравляем!</div>
<img class="w-96 h-96 mx-auto" src="img/party-popper.svg" alt=""/> <img class="w-96 h-96 mx-auto" src="img/party-popper.svg" alt=""/>
<div class="flex flex-col space-y-4 lg:flex-row lg:space-x-4 lg:space-y-0 mt-4"> <div class="flex flex-col space-y-4 lg:flex-row lg:space-x-4 lg:space-y-0 mt-4">
<a href="/otchislenie/statement" class="btn w-full lg:w-48 h-12 btn-primary rounded-full text-2xl"> <a href="/otchislenie/result" class="btn w-full lg:w-48 h-12 btn-primary rounded-full text-2xl">
Назад Назад
</a> </a>
<a href="/" class="btn w-full lg:w-48 h-12 btn-primary rounded-full text-2xl"> <a href="/" class="btn w-full lg:w-48 h-12 btn-primary rounded-full text-2xl">

View File

@@ -2,7 +2,7 @@
@page "/otchislenie/questionnaire" @page "/otchislenie/questionnaire"
@using Otchinslator.Components.Layout @using Otchinslator.Components.Layout
@layout OtchislenieLayout @layout OtchislenieLayout
<h3>questionnaire</h3> <a href="/otchislenie/statement">questionnaire</a>
@code { @code {

View File

@@ -0,0 +1,42 @@
@page "/otchislenie/result"
@using Otchinslator.Components.Layout
@layout OtchislenieLayout
<script>
function showCongratulation() {
document.getElementById('congratulation').classList.remove('hidden');
}
</script>
<div class="w-full">
<div class="flex flex-col space-y-4 w-96 mx-auto">
<div class="card rounded-badge bg-base-200 p-4">
<div class="flex flex-col space-y-4 mt-1">
<button class="btn h-16 btn-primary rounded-full text-2xl relative">
Отправить директору
</button>
<button id="downloadPDF" onclick="showCongratulation()" class="btn h-16 btn-primary rounded-full text-2xl relative">
Скачать PDF
<div class="absolute bg-base-200 rounded-full right-1 w-14 h-14">
<img class="p-3" src="img/pdf.svg" alt=""/>
</div>
</button>
</div>
</div>
</div>
@* TODO: Сделать адаптив *@
@* <div class="mt-9 flex flex-col space-y-4 lg:flex-row lg:space-x-4 lg:space-y-0 w-96 mx-auto" > *@
<div class="mt-9 flex flex-col space-y-4 w-96 mx-auto" >
<a href="/otchislenie/statement" class="btn w-96 h-14 btn-primary rounded-full text-2xl">
Назад
</a>
<a href="/" class="btn w-96 h-14 btn-primary rounded-full text-2xl">
Выход
</a>
</div>
<div class="w-96 mx-auto mt-6">
<a id="congratulation" href="/otchislenie/congratulation" class="btn w-full h-16 btn-primary rounded-full text-2xl hidden">
Страница поздравления
</a>
</div>
</div>

View File

@@ -1,7 +1,7 @@
@page "/otchislenie/statement" @page "/otchislenie/statement"
@using Otchinslator.Components.Layout @using Otchinslator.Components.Layout
@layout OtchislenieLayout @layout OtchislenieLayout
<h3>Statement</h3> <a href="/otchislenie/result">Statement</a>
@code { @code {

View File

@@ -1,67 +0,0 @@
@page "/weather"
@attribute [StreamRendering]
<PageTitle>Weather</PageTitle>
<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 streaming rendering
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

@@ -2,21 +2,14 @@
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
a.active {
@apply step-primary;
}
a.active + a.active:before {
--tw-bg-opacity: 1;
background-color: var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)));
--tw-text-opacity: 1;
color: var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)));
}
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
} }
html { html {
scrollbar-width: none; /* Firefox */ scrollbar-width: none; /* Firefox */
}
.w-192 {
width: 48rem;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="_x32_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 512 512" xml:space="preserve">
<style type="text/css">
.st0{fill:#000000;}
</style>
<g>
<path class="st0" d="M378.413,0H208.297h-13.182L185.8,9.314L57.02,138.102l-9.314,9.314v13.176v265.514
c0,47.36,38.528,85.895,85.896,85.895h244.811c47.353,0,85.881-38.535,85.881-85.895V85.896C464.294,38.528,425.766,0,378.413,0z
M432.497,426.105c0,29.877-24.214,54.091-54.084,54.091H133.602c-29.884,0-54.098-24.214-54.098-54.091V160.591h83.716
c24.885,0,45.077-20.178,45.077-45.07V31.804h170.116c29.87,0,54.084,24.214,54.084,54.092V426.105z"/>
<path class="st0" d="M171.947,252.785h-28.529c-5.432,0-8.686,3.533-8.686,8.825v73.754c0,6.388,4.204,10.599,10.041,10.599
c5.711,0,9.914-4.21,9.914-10.599v-22.406c0-0.545,0.279-0.817,0.824-0.817h16.436c20.095,0,32.188-12.226,32.188-29.612
C204.136,264.871,192.182,252.785,171.947,252.785z M170.719,294.888h-15.208c-0.545,0-0.824-0.272-0.824-0.81v-23.23
c0-0.545,0.279-0.816,0.824-0.816h15.208c8.42,0,13.447,5.027,13.447,12.498C184.167,290,179.139,294.888,170.719,294.888z"/>
<path class="st0" d="M250.191,252.785h-21.868c-5.432,0-8.686,3.533-8.686,8.825v74.843c0,5.3,3.253,8.693,8.686,8.693h21.868
c19.69,0,31.923-6.249,36.81-21.324c1.76-5.3,2.723-11.681,2.723-24.857c0-13.175-0.964-19.557-2.723-24.856
C282.113,259.034,269.881,252.785,250.191,252.785z M267.856,316.896c-2.318,7.331-8.965,10.459-18.21,10.459h-9.23
c-0.545,0-0.824-0.272-0.824-0.816v-55.146c0-0.545,0.279-0.817,0.824-0.817h9.23c9.245,0,15.892,3.128,18.21,10.46
c0.95,3.128,1.62,8.56,1.62,17.93C269.476,308.336,268.805,313.768,267.856,316.896z"/>
<path class="st0" d="M361.167,252.785h-44.812c-5.432,0-8.7,3.533-8.7,8.825v73.754c0,6.388,4.218,10.599,10.055,10.599
c5.697,0,9.914-4.21,9.914-10.599v-26.351c0-0.538,0.265-0.81,0.81-0.81h26.086c5.837,0,9.23-3.532,9.23-8.56
c0-5.028-3.393-8.553-9.23-8.553h-26.086c-0.545,0-0.81-0.272-0.81-0.817v-19.425c0-0.545,0.265-0.816,0.81-0.816h32.733
c5.572,0,9.245-3.666,9.245-8.553C370.411,256.45,366.738,252.785,361.167,252.785z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB