...dialog
This commit is contained in:
@@ -1,31 +1,30 @@
|
||||
@implements IDisposable;
|
||||
@inject IEntityDialogService entityDialogService
|
||||
|
||||
<div class="dialogBackground" onclick="@CloseDialog">
|
||||
|
||||
<div class="dialogContainer"
|
||||
<div class="dialogOverlay" onclick="@CloseDialog">
|
||||
<div class="dialogContainer entityDialog"
|
||||
@onclick:preventDefault="true"
|
||||
@onclick:stopPropagation="true">
|
||||
@if (entity == null)
|
||||
{
|
||||
<div>Entity is null</div>
|
||||
<div class="dialogBody">Entity is null</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="dialogHeader">
|
||||
@if (entityDialogService.HasHistory())
|
||||
{
|
||||
<button class="backButton" @onclick="entityDialogService.BackDialog">
|
||||
<div class="backButtonIcon"></div>
|
||||
</button>
|
||||
}
|
||||
|
||||
<div class="dialogTitle">
|
||||
@entity.Info().Name
|
||||
<div class="dialogHeaderLeft">
|
||||
@if (entityDialogService.HasHistory())
|
||||
{
|
||||
<button class="dialogBackBtn" @onclick="entityDialogService.BackDialog" title="Back">
|
||||
←
|
||||
</button>
|
||||
}
|
||||
<div class="dialogTitle">@entity.Info().Name</div>
|
||||
</div>
|
||||
|
||||
<button class="dialogCloseBtn" @onclick="CloseDialog">×</button>
|
||||
</div>
|
||||
<div class="dialogContent">
|
||||
|
||||
<div class="dialogBody">
|
||||
<CascadingValue Value="@entity">
|
||||
<EntityVanguardAddedComponent/>
|
||||
<EntityInfoComponent/>
|
||||
@@ -39,105 +38,117 @@
|
||||
<EntityWeaponsComponent/>
|
||||
<EntityAbilitiesComponent/>
|
||||
</CascadingValue>
|
||||
|
||||
</div>
|
||||
<div class="dialogFooter"></div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
.pageContents * {
|
||||
filter: blur(2px);
|
||||
}
|
||||
|
||||
|
||||
.dialogBackground {
|
||||
.dialogOverlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
padding-top: 64px;
|
||||
}
|
||||
|
||||
.dialogContainer {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 64px;
|
||||
width: 800px;
|
||||
height: 600px;
|
||||
|
||||
background-color: var(--background);
|
||||
border-width: var(--dialog-border-width);
|
||||
border-style: solid;
|
||||
border-color: var(--dialog-border-color);
|
||||
background-color: var(--paper);
|
||||
border-radius: var(--dialog-radius);
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: calc(100vh - 128px);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
box-shadow: 1px 2px 2px black;
|
||||
|
||||
.entityDialog {
|
||||
width: 800px;
|
||||
max-width: calc(100% - 32px);
|
||||
}
|
||||
|
||||
.dialogHeader {
|
||||
width: 100%;
|
||||
background-color: var(--accent);
|
||||
border-top-left-radius: var(--dialog-radius);
|
||||
border-top-right-radius: var(--dialog-radius);
|
||||
border-bottom: 4px solid black;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
justify-content: space-between;
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid var(--paper-border);
|
||||
background-color: var(--accent);
|
||||
border-radius: var(--dialog-radius) var(--dialog-radius) 0 0;
|
||||
min-height: 52px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.backButton {
|
||||
margin-left: 16px;
|
||||
padding: 12px;
|
||||
|
||||
border: 1px solid var(--accent);
|
||||
.dialogHeaderLeft {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.backButton:hover {
|
||||
background-color: var(--primary-hover);
|
||||
border: 1px solid var(--primary-border-hover);
|
||||
.dialogBackBtn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
font-size: 1.4rem;
|
||||
cursor: pointer;
|
||||
padding: 4px 8px;
|
||||
line-height: 1;
|
||||
border-radius: 6px;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
}
|
||||
|
||||
.backButtonIcon {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
border: solid white;
|
||||
border-width: 0 9px 9px 0;
|
||||
transform: rotate(135deg);
|
||||
.dialogBackBtn:hover {
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.dialogTitle {
|
||||
padding: 16px;
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: white;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.dialogContent {
|
||||
flex-grow: 1;
|
||||
padding: 6px;
|
||||
.dialogCloseBtn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
font-size: 1.5rem;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
line-height: 1;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 6px;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
}
|
||||
|
||||
.dialogCloseBtn:hover {
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.dialogBody {
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
|
||||
height: 800px;
|
||||
}
|
||||
|
||||
.dialogFooter {
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
background-color: var(--paper);
|
||||
flex: 1;
|
||||
color: var(--text-primary, #ddd);
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
EntityModel entity = default!;
|
||||
|
||||
private int refresh;
|
||||
@@ -146,7 +157,6 @@
|
||||
{
|
||||
base.OnInitialized();
|
||||
entity = EntityData.Get()[entityDialogService.GetEntityId() ?? string.Empty];
|
||||
|
||||
entityDialogService.Subscribe(OnUpdate);
|
||||
}
|
||||
|
||||
@@ -159,7 +169,6 @@
|
||||
{
|
||||
entity = EntityData.Get()[entityDialogService.GetEntityId() ?? string.Empty];
|
||||
refresh++;
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
@@ -167,5 +176,4 @@
|
||||
{
|
||||
entityDialogService.CloseDialog();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user