Добавил мемы
All checks were successful
Build and deploy / Publish image (push) Successful in 10m51s

This commit is contained in:
2025-03-09 22:57:01 +03:00
parent 613334e2d2
commit a5426faa2e
6 changed files with 93 additions and 40 deletions

4
.gitignore vendored
View File

@@ -501,3 +501,7 @@ src/Otchinslator/appsettings.Development.json
src/.idea/.idea.Otchinslator/.idea/ src/.idea/.idea.Otchinslator/.idea/
src/.vscode/ src/.vscode/
src/Otchinslator/wwwroot/img/memes/
src/Otchinslator/wwwroot/img/notifications/

View File

@@ -1,4 +1,4 @@
@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Authorization
@inject AuthenticationStateProvider AuthenticationStateProvider @inject AuthenticationStateProvider AuthenticationStateProvider
@page "/" @page "/"
@attribute [DiscoverCollocatedJS] @attribute [DiscoverCollocatedJS]
@@ -20,13 +20,32 @@
</div> </div>
</div> </div>
</dialog> </dialog>
<dialog id="meme_modal" class="modal modal-middle sm:modal-middle">
<div class="modal-box">
<h3 class="text-lg font-bold text-center">Мемная поддержка</h3>
<img id="memeImg" src="/img/memes/1.jpg" alt="meme" class="h-96 mt-2 mx-auto rounded-lg">
<div class="flex items-center mt-4">
<span class="text-gray-400 text-sm">Может содержаться ненормативная лексика!</span>
<div class="modal-action mt-0 ml-auto mr-0">
<form method="dialog">
<button class="btn btn-error">Закрыть</button>
</form>
<button id="nextmeme" class="btn btn-success">Дальше</button>
</div>
</div>
</div>
</dialog>
@* TODO: Исправить расположение названия *@ @* TODO: Исправить расположение названия *@
<div class="text-center font-bold text-4xl md:text-5xl w-max absolute left-1/2 -top-1/3 transform -translate-x-1/2 italic"><br>Отчислятор 3000<br><p class="text-2xl text-red-500">alpha</p></div> <div
class="text-center font-bold text-4xl md:text-5xl w-max absolute left-1/2 -top-1/2 transform -translate-x-1/2 italic">
<br>Отчислятор 3000<br>
<p class="text-2xl text-red-500">alpha</p></div>
<div class="flex flex-col space-y-4 w-96"> <div class="flex flex-col space-y-4 w-96">
<div class="card rounded-badge bg-base-200 p-4"> <div class="card rounded-badge bg-base-200 p-4">
<h2 class="card-title text-center text-3xl justify-center my-4">Мне нужно...</h2> @* <h2 class="card-title text-center text-3xl justify-center my-4">Мне нужно...</h2> *@
<div class="flex flex-col space-y-4 mt-1"> <div class="flex flex-col space-y-4 mt-1">
<button id="otchislenie" class="action-button btn h-16 btn-primary rounded-full text-2xl relative"> <button id="otchislenie"
class="action-button btn h-16 btn-primary bg-green-300 hover:bg-green-400 border-none rounded-full text-2xl relative">
Отчислиться Отчислиться
<div class="absolute bg-base-200 rounded-full right-1 w-14 h-14"> <div class="absolute bg-base-200 rounded-full right-1 w-14 h-14">
@{ @{
@@ -41,40 +60,59 @@
} }
</div> </div>
</button> </button>
<button id="downgrade" class="btn h-16 btn-primary rounded-full text-2xl relative"> <div class="divider" style="margin-top: 0.25rem;"></div>
Понизить курс <a href="/Achievements" class="btn h-12 btn-primary rounded-full text-xl relative"
<div class="absolute bg-base-200 rounded-full right-1 w-14 h-14"> style="margin-top: 0.25rem;">
Наши достижения
<div class="absolute bg-base-200 rounded-full right-1 w-10 h-10">
<img class="p-2" src="img/down.svg" alt=""/> <img class="p-2" src="img/down.svg" alt=""/>
</div> </div>
<i class="absolute text-sm bottom-0 text-base-200 font-medium">временно недоступно</i> </a>
</button> <button onclick="meme_modal.showModal()" class="btn h-12 btn-primary rounded-full text-xl relative">
<button id="akadem" class="btn h-16 btn-primary p-0 rounded-full text-2xl relative"> Мемная помощь
Уйти в академ <div class="absolute bg-base-200 rounded-full right-1 w-10 h-10">
<div class="absolute bg-base-200 rounded-full right-1 w-14 h-14">
<img class="p-2" src="img/akadem.svg" alt=""/> <img class="p-2" src="img/akadem.svg" alt=""/>
</div> </div>
<i class="absolute text-sm bottom-0 text-base-200 font-medium">временно недоступно</i>
</button> </button>
<div class="divider"></div> <div class="divider" style="margin-top: 0.25rem;"></div>
@* <button id="downgrade" class="btn h-16 btn-primary rounded-full text-2xl relative"> *@
@* Понизить курс *@
@* <div class="absolute bg-base-200 rounded-full right-1 w-14 h-14"> *@
@* <img class="p-2" src="img/down.svg" alt=""/> *@
@* </div> *@
@* <i class="absolute text-sm bottom-0 text-base-200 font-medium">временно недоступно</i> *@
@* </button> *@
@* <button id="akadem" class="btn h-16 btn-primary p-0 rounded-full text-2xl relative"> *@
@* Уйти в академ *@
@* <div class="absolute bg-base-200 rounded-full right-1 w-14 h-14"> *@
@* <img class="p-2" src="img/akadem.svg" alt=""/> *@
@* </div> *@
@* <i class="absolute text-sm bottom-0 text-base-200 font-medium">временно недоступно</i> *@
@* </button> *@
<CascadingAuthenticationState> <CascadingAuthenticationState>
<AuthorizeView> <AuthorizeView>
<Authorized> <Authorized>
<a href="MicrosoftIdentity/Account/SignOut" class="btn btn-lg btn-primary rounded-full text-2xl relative"> <a href="MicrosoftIdentity/Account/SignOut"
class="btn btn-md btn-primary rounded-full text-2xl relative"
style="margin-top: 0.25rem;">
@context.User.Identity?.Name!.Split("@")[0] @context.User.Identity?.Name!.Split("@")[0]
<div class="absolute bg-base-200 rounded-full right-1 w-14 h-14"> <div class="absolute bg-base-200 rounded-full right-1 w-10 h-10">
<img class="p-3" src="img/exit.svg" alt=""/> <img class="p-3" src="img/exit.svg" alt=""/>
</div> </div>
</a> </a>
</Authorized> </Authorized>
<NotAuthorized> <NotAuthorized>
<a class="btn btn-lg bg-green-300 rounded-full text-2xl" href="MicrosoftIdentity/Account/SignIn">Начать</a> <a class="btn btn-md btn-primary rounded-full text-base"
href="MicrosoftIdentity/Account/SignIn">Авторизоваться</a>
</NotAuthorized> </NotAuthorized>
</AuthorizeView> </AuthorizeView>
</CascadingAuthenticationState> </CascadingAuthenticationState>
</div> </div>
</div> </div>
<div class="text-center"> <div class="text-center">
<button onclick="info_modal.showModal()" class="btn btn-sm btn-primary bg-base-200 rounded-full text-1xl">?</button> <button onclick="info_modal.showModal()" class="btn btn-sm btn-primary bg-base-200 rounded-full text-1xl">
?
</button>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,7 +1,6 @@
export default class extends BlazorJSComponents.Component { export default class extends BlazorJSComponents.Component {
setParameters(IsAuthenticated) { setParameters(IsAuthenticated) {
const buttons = document.querySelectorAll('.action-button'); const button = document.querySelector('.action-button');
buttons.forEach(button => {
button.addEventListener('click', () => { button.addEventListener('click', () => {
localStorage.setItem('action', button.id); localStorage.setItem('action', button.id);
if (IsAuthenticated) { if (IsAuthenticated) {
@@ -11,7 +10,15 @@ export default class extends BlazorJSComponents.Component {
} }
} }
) )
}); const nextMemeButton = document.getElementById('nextmeme');
this.render(); const nextMemeImg = document.getElementById('memeImg');
var random = Math.floor(Math.random() * 100) + 1;
nextMemeImg.src = "/img/memes/" + random + ".jpg";
nextMemeButton.addEventListener('click', () => {
random = Math.floor(Math.random() * 100) + 1;
nextMemeImg.src = "/img/memes/" + random + ".jpg";
})
} }
} }

View File

@@ -38,7 +38,13 @@ public class DatabaseContext : DbContext
new Specialty() { Id = 7, Name = "Применение и эксплуатация автоматизированных систем специального назначения", Code = "09.05.01", InstitutId = 1 }, new Specialty() { Id = 7, Name = "Применение и эксплуатация автоматизированных систем специального назначения", Code = "09.05.01", InstitutId = 1 },
new Specialty() { Id = 8, Name = "Информационная безопасность телекоммуникационных систем", Code = "10.05.02", InstitutId = 1 }, new Specialty() { Id = 8, Name = "Информационная безопасность телекоммуникационных систем", Code = "10.05.02", InstitutId = 1 },
new Specialty() { Id = 9, Name = "Информационная безопасность автоматизированных систем", Code = "10.05.03", InstitutId = 1 }, new Specialty() { Id = 9, Name = "Информационная безопасность автоматизированных систем", Code = "10.05.03", InstitutId = 1 },
new Specialty() { Id = 10, Name = "Безопасность информационных технологий в правоохранительной сфере", Code = "10.05.05", InstitutId = 1 } new Specialty() { Id = 10, Name = "Безопасность информационных технологий в правоохранительной сфере", Code = "10.05.05", InstitutId = 1 },
// ИРТСУ
new Specialty() { Id = 10, Name = "НЕ ЗАПОЛНЕНО", Code = "0.0.0", InstitutId = 2 },
// ИУЭС
new Specialty() { Id = 11, Name = "НЕ ЗАПОЛНЕНО", Code = "0.0.0", InstitutId = 3 },
// ИНЭП
new Specialty() { Id = 12, Name = "НЕ ЗАПОЛНЕНО", Code = "0.0.0", InstitutId = 4 }
); );
} }
} }

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0.1-alpine3.21 AS base FROM mcr.microsoft.com/dotnet/aspnet:9.0.2-alpine3.21 AS base
USER root USER root
RUN apk update && apk add --no-cache curl icu tzdata musl-locales musl-locales-lang RUN apk update && apk add --no-cache curl icu tzdata musl-locales musl-locales-lang
USER $APP_UID USER $APP_UID

View File

@@ -28,17 +28,15 @@
<PackageReference Include="BlazorJSComponents" Version="1.0.0" /> <PackageReference Include="BlazorJSComponents" Version="1.0.0" />
<PackageReference Include="BlazorPageScript" <PackageReference Include="BlazorPageScript"
Version="1.0.0" /> Version="1.0.0" />
<PackageReference Include="DocumentFormat.OpenXml" <PackageReference Include="DocumentFormat.OpenXml" Version="3.3.0" />
Version="3.2.0" /> <PackageReference Include="Gotenberg.Sharp.API.Client" Version="2.5.0" />
<PackageReference Include="Gotenberg.Sharp.API.Client" <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.2">
Version="2.4.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.2" />
<PackageReference Include="Microsoft.Identity.Web" Version="3.6.0" /> <PackageReference Include="Microsoft.Identity.Web" Version="3.8.0" />
<PackageReference Include="Microsoft.Identity.Web.UI" Version="3.6.0" /> <PackageReference Include="Microsoft.Identity.Web.UI" Version="3.8.0" />
<PackageReference Include="NPetrovich" <PackageReference Include="NPetrovich"
Version="2.0.1" /> Version="2.0.1" />
</ItemGroup> </ItemGroup>