Files
nexium-web/app/pages/home/home.html
T
2026-08-03 17:38:38 -04:00

142 lines
7.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends '__layout__.html' %}
{% block title %}Home{% endblock %}
{% block head %}
<link href="/static/css/home.css" rel="stylesheet"/> <!-- Its just easier to resuse this-->
{% endblock %}
{% block content %}
<div id="main" class="home-page-shell">
<div class="home-page-container">
<!-- {% if not isEmailVerified: %}
<div class="alert p-2 alert-warning d-flex align-items-center">
<i class="bi bi-envelope-plus ms-2" style="font-size: 30px;"></i>
<div class="m-2">
Verify your email to secure your account and get a free item!
</div>
<a href="/settings/update-email" class="ms-auto text-decoration-none me-2"><button class="btn btn-warning btn-sm">Verify Email</button></a>
</div>
{%endif%} -->
{% if not isDiscordLinked: %}
<div class="alert p-2 alert-primary d-flex align-items-center">
<i class="bi bi-discord ms-2" style="font-size: 30px;"></i>
<div class="m-2">
Link your Discord Account and you will get a lifetime builders club membership for free
</div>
<a href="/settings/discord_link" class="ms-auto text-decoration-none me-2"><button class="btn btn-primary btn-sm">Link Discord</button></a>
</div>
{%endif%}
<section class="home-hero card-container">
<div class="home-hero-avatar-wrap">
<img class="home-hero-avatar" src="/Thumbs/Head.ashx?x=150&y=150&userId={{currentuser.id}}" alt="{{currentuser.username}}" />
</div>
<div class="home-hero-copy">
<p class="home-kicker mb-1">Welcome back</p>
<h1 class="home-greeting mb-2"><span id="greetings"></span>, {{currentuser.username}}!</h1>
<div class="home-status-row">
{% if membershipValue == 1: %}
<span class="rbx-icon-bc"></span>
{%endif%}
{% if membershipValue == 2: %}
<span class="rbx-icon-tbc"></span>
{%endif%}
{% if membershipValue == 3: %}
<span class="rbx-icon-negative-obc"></span>
{%endif%}
<span class="home-status-text">Your account and friends are the quickest places to jump back into the site.</span>
</div>
</div>
</section>
<section class="home-section card-container">
<div class="home-section-header">
<div>
<h4 class="home-section-title mb-1">Friends ({{friendcount}})</h4>
<p class="home-section-meta mb-0">People online and worth checking in on.</p>
</div>
<a class="home-section-link" href="/users/{{currentuser.id}}/friends">View all</a>
</div>
<div class="home-friends-strip friends-scroll">
{% for friend in friends %}
<a href="/users/{{friend.id}}/profile" class="home-friend-card">
<div class="image-container home-friend-avatar-frame">
<img class="home-friend-avatar" src="/Thumbs/Head.ashx?x=100&y=100&userId={{friend.id}}" alt="{{friend.username}}"/>
{% if friend.isonline: %}<div class="status-icon {% if friend.ingame: %}status-icon-green{% endif %}"></div>{% endif %}
</div>
<p class="text-body w-100 text-center d-inline-block m-0 text-truncate home-friend-name">{{friend.username}}</p>
</a>
{% endfor %}
{% if friendcount == 0: %}
<div class="home-empty-state">
<p class="mb-0">You have no friends yet.</p>
<a href="/games" class="btn btn-sm btn-primary mt-2">Explore games</a>
</div>
{% endif %}
</div>
</section>
<section class="home-section card-container">
<div class="home-section-header">
<div>
<h4 class="home-section-title mb-1">Recently Played</h4>
<p class="home-section-meta mb-0">Pick up where you left off or try something new.</p>
</div>
<a class="home-section-link" href="/games">Browse games</a>
</div>
<div class="home-places-strip">
{% for place in recentlyplayed %}
<a class="text-decoration-none" href="/games/{{place.id}}/">
<div class="me-3 overflow-hidden rounded place-card home-place-card">
<div class="position-relative home-place-thumb-wrap">
<img class="home-place-thumb" src="/Thumbs/PlaceIcon.ashx?assetId={{place.id}}&x=150&y=150" alt="{{place.name}}">
<div class="position-absolute" style="bottom: 0px;left: 0px;">
<div class="fw-bold bg-surface text-body home-place-year">{{place.placeyear.value}}</div>
</div>
</div>
<div class="p-2 home-place-copy">
<h5 class="mb-1 home-place-name" title="{{place.name}}">{{place.name}}</h5>
<div class="d-flex align-items-center">
<p class="mb-2 text-secondary home-place-playing"><i class="bi bi-people"></i> {{place.playercount}} <span>Playing</span></p>
</div>
<div class="w-100 votePercentageBackground home-place-votes">
<div class="votePercentageFill home-place-vote-fill" data-like-percentage="{{place.likePercentage}}"></div>
<div>
<div class="segment" style="left: 18%;"></div>
<div class="segment" style="left: 38%;"></div>
<div class="segment" style="left: 58%;"></div>
<div class="segment" style="left: 78%;"></div>
</div>
</div>
</div>
</div>
</a>
{% endfor %}
{% if recentlyplayedcount == 0: %}
<div class="home-empty-state home-empty-wide">
<p class="mb-0">Looks like you havent played any games yet.</p>
<a class="btn btn-sm btn-primary mt-2" href="/games">Play something now</a>
</div>
{% endif %}
</div>
</section>
</div>
</div>
<script>
const hour = new Date().getHours();
let greeting;
if (hour >= 5 && hour < 12) {
greeting = "Good Morning";
} else if (hour >= 12 && hour < 18) {
greeting = "Good Afternoon";
} else if (hour >= 18 && hour < 22) {
greeting = "Good Evening";
} else {
greeting = "Good Night";
}
document.getElementById("greetings").textContent = greeting;
document.querySelectorAll(".home-place-vote-fill").forEach((fill) => {
const percentage = fill.dataset.likePercentage || 0;
fill.style.width = `${percentage}%`;
});
</script>
{% endblock %}