Shrink slot icon on mobile

This commit is contained in:
jvyden 2022-01-28 15:43:24 -05:00
commit e0cc1da084
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
4 changed files with 21 additions and 3 deletions

View file

@ -10,6 +10,7 @@
await using Database database = new();
string slotName = string.IsNullOrEmpty(Model.Name) ? "Unnamed Level" : Model.Name;
bool isMobile = (bool?)ViewData["IsMobile"] ?? false;
bool isQueued = false;
bool isHearted = false;
@ -28,7 +29,10 @@
if (string.IsNullOrWhiteSpace(iconHash) || iconHash.StartsWith('g')) iconHash = ServerSettings.Instance.MissingIconHash;
}
<div class="slotCard">
<div class="slotCardIcon" style="background-image: url('/gameAssets/@iconHash');">
@{
int size = isMobile ? 50 : 100;
}
<div class="slotCardIcon" style="background-image: url('/gameAssets/@iconHash'); min-width: @(size)px; width: @(size)px; height: @(size)px">
</div>
<div class="slotCardStats">
@if (showLink)

View file

@ -1,4 +1,5 @@
@page "/slot/{id:int}"
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
@model LBPUnion.ProjectLighthouse.Pages.SlotPage
@{
@ -20,6 +21,9 @@
{
"ShowLink", false
},
{
"IsMobile", Model.Request.IsMobile()
},
})
<br>

View file

@ -1,4 +1,5 @@
@page "/slots/{pageNumber:int}"
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
@using LBPUnion.ProjectLighthouse.Types.Levels
@model LBPUnion.ProjectLighthouse.Pages.SlotsPage
@ -23,6 +24,9 @@
{
"ShowLink", true
},
{
"IsMobile", Model.Request.IsMobile()
},
})
</div>
}

View file

@ -29,8 +29,6 @@ div.statsUnderTitle > span {
.slotCardIcon {
margin-right: 10px;
height: 100px;
width: 100px;
background-size: cover;
background-position: center;
border-radius: 100%;
@ -53,7 +51,15 @@ div.statsUnderTitle > span {
.slotCardButtons {
height: 100px;
display: flex;
flex-direction: column;
align-items: center;
margin-left: auto;
}
.slotCardButtons > a {
margin-bottom: 5px !important;
vertical-align: center;
}
/*#endregion Slot cards*/