mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 14:38:13 -05:00
Store hero
This commit is contained in:
27
game/addons/menu/Code/MenuUI/Front/StoreHero.razor
Normal file
27
game/addons/menu/Code/MenuUI/Front/StoreHero.razor
Normal file
@@ -0,0 +1,27 @@
|
||||
@using Sandbox;
|
||||
@using Sandbox.UI;
|
||||
@using Sandbox.UI.Navigation;
|
||||
@inherits Panel
|
||||
@namespace Menu
|
||||
|
||||
@if ( DateTimeOffset.UtcNow >= EndTime )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
<root onclick=@OpenStore class="active">
|
||||
<div class="time-left">
|
||||
<span class="number">@DaysLeft</span>
|
||||
<span class="text">days left</span>
|
||||
</div>
|
||||
</root>
|
||||
|
||||
@code {
|
||||
public DateTimeOffset EndTime { get; set; } = DateTimeOffset.FromUnixTimeSeconds(1767258000);
|
||||
public int DaysLeft => (int)Math.Floor((EndTime - DateTimeOffset.UtcNow).TotalDays);
|
||||
|
||||
void OpenStore()
|
||||
{
|
||||
this.Navigate( "/itemstore" );
|
||||
}
|
||||
}
|
||||
51
game/addons/menu/Code/MenuUI/Front/StoreHero.razor.scss
Normal file
51
game/addons/menu/Code/MenuUI/Front/StoreHero.razor.scss
Normal file
@@ -0,0 +1,51 @@
|
||||
StoreHero {
|
||||
&:not(.active) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
width: 450px;
|
||||
height: 300px;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
pointer-events: all;
|
||||
cursor: pointer;
|
||||
border: 1px solid #2e344b44;
|
||||
border-radius: 16px;
|
||||
padding: 16px 32px;
|
||||
transition: all 0.1s linear;
|
||||
color: #aab3cc;
|
||||
background-image: url( 'ui/mainmenu/xmas-store-hero.png' );
|
||||
background-size: cover;
|
||||
margin-top: 50px;
|
||||
position: relative;
|
||||
|
||||
.time-left {
|
||||
position: absolute;
|
||||
top: 116px;
|
||||
left: 10px;
|
||||
font-weight: 900;
|
||||
font-size: 4rem;
|
||||
text-transform: uppercase;
|
||||
transform: rotate(-2deg);
|
||||
font-family: Poppins;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
text-shadow: 1px 1px 10px #000000;
|
||||
text-stroke: 5px #fff;
|
||||
|
||||
.number {
|
||||
font-size: 5rem;
|
||||
color: #a51c1f;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #1da43d;
|
||||
font-size: 3.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: scale( 1.05 );
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<StoreHero></StoreHero>
|
||||
<div class="spacer"></div>
|
||||
<Button class="clicky" Icon="checkroom" Help="Change your avatar's clothes and stuff" Text="#avatar.change" @onmousedown=@OpenAvatarScene></Button>
|
||||
<Button class="clicky" icon="@CurrentModelIcon" Text="@CurrentModelMode" @onmousedown=@ToggleHuman></Button>
|
||||
</div>
|
||||
|
||||
@@ -39,6 +39,10 @@ FrontPage .right
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
FrontPage button.button
|
||||
{
|
||||
border: 1px solid #2e344b44;
|
||||
|
||||
Reference in New Issue
Block a user