mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 01:58:40 +00:00
Rename slotCard to Card and use in UserCardPartial
This commit is contained in:
parent
e0cc1da084
commit
b13dea6306
6 changed files with 62 additions and 31 deletions
|
@ -28,13 +28,13 @@
|
||||||
string iconHash = Model.IconHash;
|
string iconHash = Model.IconHash;
|
||||||
if (string.IsNullOrWhiteSpace(iconHash) || iconHash.StartsWith('g')) iconHash = ServerSettings.Instance.MissingIconHash;
|
if (string.IsNullOrWhiteSpace(iconHash) || iconHash.StartsWith('g')) iconHash = ServerSettings.Instance.MissingIconHash;
|
||||||
}
|
}
|
||||||
<div class="slotCard">
|
<div class="card">
|
||||||
@{
|
@{
|
||||||
int size = isMobile ? 50 : 100;
|
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 class="cardIcon slotCardIcon" style="background-image: url('/gameAssets/@iconHash'); min-width: @(size)px; width: @(size)px; height: @(size)px">
|
||||||
</div>
|
</div>
|
||||||
<div class="slotCardStats">
|
<div class="cardStats">
|
||||||
@if (showLink)
|
@if (showLink)
|
||||||
{
|
{
|
||||||
<h2>
|
<h2>
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
@slotName
|
@slotName
|
||||||
</h1>
|
</h1>
|
||||||
}
|
}
|
||||||
<div class="statsUnderTitle">
|
<div class="cardStatsUnderTitle">
|
||||||
<i class="pink heart icon" title="Hearts"></i> <span>@Model.Hearts</span>
|
<i class="pink heart icon" title="Hearts"></i> <span>@Model.Hearts</span>
|
||||||
<i class="blue play icon" title="Plays"></i> <span>@Model.Plays</span>
|
<i class="blue play icon" title="Plays"></i> <span>@Model.Plays</span>
|
||||||
<i class="green thumbs up icon" title="Yays"></i> <span>@Model.Thumbsup</span>
|
<i class="green thumbs up icon" title="Yays"></i> <span>@Model.Thumbsup</span>
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
<i>Created by <a href="/user/@Model.Creator?.UserId">@Model.Creator?.Username</a> for @Model.GameVersion.ToPrettyString()</i>
|
<i>Created by <a href="/user/@Model.Creator?.UserId">@Model.Creator?.Username</a> for @Model.GameVersion.ToPrettyString()</i>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="slotCardButtons">
|
<div class="cardButtons">
|
||||||
<br>
|
<br>
|
||||||
@if (user != null)
|
@if (user != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,12 +3,16 @@
|
||||||
|
|
||||||
@{
|
@{
|
||||||
bool showLink = (bool?)ViewData["ShowLink"] ?? false;
|
bool showLink = (bool?)ViewData["ShowLink"] ?? false;
|
||||||
|
bool isMobile = (bool?)ViewData["IsMobile"] ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
<div style="display: flex;">
|
<div class="card">
|
||||||
<div style="margin-right: 10px; background-image: url('/gameAssets/@Model.WebsiteAvatarHash'); height: 100px; width: 100px; background-size: cover; background-position: center; border-radius: .28571429rem;">
|
@{
|
||||||
|
int size = isMobile ? 50 : 100;
|
||||||
|
}
|
||||||
|
<div class="cardIcon userCardIcon" style="background-image: url('/gameAssets/@Model.WebsiteAvatarHash'); min-width: @(size)px; width: @(size)px; height: @(size)px">
|
||||||
</div>
|
</div>
|
||||||
<div style="height: fit-content; vertical-align: center; align-self: center">
|
<div class="cardStats">
|
||||||
@if (showLink)
|
@if (showLink)
|
||||||
{
|
{
|
||||||
<h2 style="margin-bottom: 2px;">
|
<h2 style="margin-bottom: 2px;">
|
||||||
|
@ -24,7 +28,7 @@
|
||||||
<p>
|
<p>
|
||||||
<i>@Model.Status</i>
|
<i>@Model.Status</i>
|
||||||
</p>
|
</p>
|
||||||
<div class="statsUnderTitle">
|
<div class="cardStatsUnderTitle">
|
||||||
<i class="pink heart icon" title="Hearts"></i> <span>@Model.Hearts</span>
|
<i class="pink heart icon" title="Hearts"></i> <span>@Model.Hearts</span>
|
||||||
<i class="blue comment icon" title="Comments"></i> <span>@Model.Comments</span>
|
<i class="blue comment icon" title="Comments"></i> <span>@Model.Comments</span>
|
||||||
<i class="green upload icon" title="Uploaded Levels"></i><span>@Model.UsedSlots / @ServerSettings.Instance.EntitledSlots</span>
|
<i class="green upload icon" title="Uploaded Levels"></i><span>@Model.UsedSlots / @ServerSettings.Instance.EntitledSlots</span>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
@foreach (Slot slot in Model.Slots)
|
@foreach (Slot slot in Model.Slots)
|
||||||
{
|
{
|
||||||
|
bool isMobile = Model.Request.IsMobile();
|
||||||
<div class="ui segment">
|
<div class="ui segment">
|
||||||
@await Html.PartialAsync("Partials/SlotCardPartial", slot, new ViewDataDictionary(ViewData)
|
@await Html.PartialAsync("Partials/SlotCardPartial", slot, new ViewDataDictionary(ViewData)
|
||||||
{
|
{
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
"ShowLink", true
|
"ShowLink", true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"IsMobile", Model.Request.IsMobile()
|
"IsMobile", isMobile
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
@page "/user/{userId:int}"
|
@page "/user/{userId:int}"
|
||||||
@using System.IO
|
@using System.IO
|
||||||
@using System.Web
|
@using System.Web
|
||||||
|
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
|
||||||
@using LBPUnion.ProjectLighthouse.Types
|
@using LBPUnion.ProjectLighthouse.Types
|
||||||
@using LBPUnion.ProjectLighthouse.Types.Profiles
|
@using LBPUnion.ProjectLighthouse.Types.Profiles
|
||||||
@model LBPUnion.ProjectLighthouse.Pages.UserPage
|
@model LBPUnion.ProjectLighthouse.Pages.UserPage
|
||||||
|
@ -43,6 +44,9 @@
|
||||||
{
|
{
|
||||||
"ShowLink", false
|
"ShowLink", false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"IsMobile", Model.Request.IsMobile()
|
||||||
|
},
|
||||||
})
|
})
|
||||||
</div>
|
</div>
|
||||||
<div class="eight wide right aligned column">
|
<div class="eight wide right aligned column">
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
@page "/users/{pageNumber:int}"
|
@page "/users/{pageNumber:int}"
|
||||||
|
@using LBPUnion.ProjectLighthouse.Helpers.Extensions
|
||||||
@using LBPUnion.ProjectLighthouse.Types
|
@using LBPUnion.ProjectLighthouse.Types
|
||||||
@model LBPUnion.ProjectLighthouse.Pages.UsersPage
|
@model LBPUnion.ProjectLighthouse.Pages.UsersPage
|
||||||
|
|
||||||
|
@ -11,12 +12,16 @@
|
||||||
|
|
||||||
@foreach (User user in Model.Users)
|
@foreach (User user in Model.Users)
|
||||||
{
|
{
|
||||||
|
bool isMobile = Model.Request.IsMobile();
|
||||||
<div class="ui segment">
|
<div class="ui segment">
|
||||||
@await Html.PartialAsync("Partials/UserCardPartial", user, new ViewDataDictionary(ViewData)
|
@await Html.PartialAsync("Partials/UserCardPartial", user, new ViewDataDictionary(ViewData)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"ShowLink", true
|
"ShowLink", true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"IsMobile", isMobile
|
||||||
|
},
|
||||||
})
|
})
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,48 +8,36 @@ div.main {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.statsUnderTitle > i {
|
|
||||||
margin-right: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.statsUnderTitle > span {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#lighthouse-debug-info > p {
|
#lighthouse-debug-info > p {
|
||||||
margin-bottom: 1px;
|
margin-bottom: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*#region Slot cards*/
|
/*#region Cards*/
|
||||||
|
|
||||||
.slotCard {
|
.card {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slotCardIcon {
|
.cardIcon {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slotCardStats {
|
.cardStats {
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
vertical-align: center;
|
vertical-align: center;
|
||||||
align-self: center
|
align-self: center
|
||||||
}
|
}
|
||||||
|
|
||||||
.slotCardStats > .statsUnderTitle {
|
.cardStats > h1,
|
||||||
margin-bottom: 10px;
|
.cardStats > h2 {
|
||||||
}
|
|
||||||
|
|
||||||
.slotCardStats > h1,
|
|
||||||
.slotCardStats > h2 {
|
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slotCardButtons {
|
.cardButtons {
|
||||||
height: 100px;
|
height: 100px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -57,9 +45,38 @@ div.statsUnderTitle > span {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slotCardButtons > a {
|
.cardButtons > a {
|
||||||
margin-bottom: 5px !important;
|
margin-bottom: 5px !important;
|
||||||
vertical-align: center;
|
vertical-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*#endregion Slot cards*/
|
.cardStatsUnderTitle {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.cardStatsUnderTitle > i {
|
||||||
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.cardStatsUnderTitle > span {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#region Slot cards*/
|
||||||
|
|
||||||
|
.slotCardIcon {
|
||||||
|
border-radius: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#endregion Slot cards*/
|
||||||
|
|
||||||
|
/*#region User cards*/
|
||||||
|
|
||||||
|
.userCardIcon {
|
||||||
|
border-radius: .28571429rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*#endregion User cards*/
|
||||||
|
|
||||||
|
/*#endregion Cards*/
|
Loading…
Add table
Add a link
Reference in a new issue