Refactor styles and components for improved UI consistency

- Updated login page layout by removing unnecessary classes.
- Redesigned 404 not found page with new layout and styles.
- Enhanced public pages with consistent font styling and hover effects.
- Improved ranking page header styling for better readability.
- Updated rules page with consistent font and link styles.
- Enhanced statistics page header styling.
- Refined global CSS variables for better theme consistency.
- Updated button styles for improved interaction feedback.
- Enhanced table styles for better readability and interaction.
- Updated Tailwind configuration to include new font families.
This commit is contained in:
2026-03-28 15:56:32 +01:00
parent f612b15b06
commit d2ee422d6d
31 changed files with 1028 additions and 372 deletions

View File

@@ -3,9 +3,7 @@ import dayjs from "dayjs";
import NavbarLayout from "@layouts/NavbarLayout.astro";
import { getCollection } from "astro:content";
import { astroI18n } from "astro-i18n";
import { Image } from "astro:assets";
import Card from "@components/Card.svelte";
import { CaretRight, Pause, Rocket, Crosshair1 } from "@astropub/icons";
import { t } from "astro-i18n";
import { l } from "@utils/util";
@@ -31,194 +29,544 @@ germanPosts.forEach((value) => {
const latestPost = posts.sort((a, b) => dayjs(b.data.created).unix() - dayjs(a.data.created).unix()).at(0);
const prefixColorMap: {
[key: string]: string;
} = {
Admin: "border-red-600 dark:border-red-800 shadow-red-600 dark:shadow-red-800",
Dev: "border-sky-600 dark:border-sky-800 shadow-sky-600 dark:shadow-sky-800",
Mod: "border-amber-600 dark:border-amber-800 shadow-amber-600 dark:shadow-amber-800",
Sup: "border-blue-700 dark:border-blue-900 shadow-blue-700 dark:shadow-blue-900",
Arch: "border-green-500 dark:border-green-700 shadow-green-500 dark:shadow-green-700",
const prefixColors: { [key: string]: string } = {
Admin: "#dc2626",
Dev: "#0284c7",
Mod: "#d97706",
Sup: "#1d4ed8",
Arch: "#22c55e",
};
---
<NavbarLayout title={t("home.page")} description="SteamWar.de Homepage" transparentFooter={false}>
<div class="w-full h-screen relative mb-4 z-10">
<div style="height: calc(100vh + 1rem)">
<!-- ═══════════ HERO ═══════════ -->
<section class="hero">
<div class="hero-bg">
<BackgroundImage />
</div>
<drop-in class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col items-center">
<h1
class="text-4xl sm:text-6xl md:text-8xl font-extrabold text-white -translate-y-16 opacity-0 barlow tracking-wider"
style="transition: transform .7s ease-out, opacity .7s linear; filter: drop-shadow(2px 2px 5px black);"
>
<span class="bg-gradient-to-tr from-yellow-400 to-yellow-300 bg-clip-text text-transparent">{t("home.title.first")}</span><span class="text-neutral-600">{t("home.title.second")}</span>
<div class="hero-gradient"></div>
<div class="hero-scanlines"></div>
<div class="hero-content">
<span class="hero-label">Minecraft PvP Server</span>
<h1 class="hero-title">
<span class="hero-steam">{t("home.title.first")}</span><span class="hero-war">{t("home.title.second")}</span>
</h1>
<text-carousel class="h-20 w-full relative select-none">
<h2 class="-translate-y-16">{t("home.subtitle.1")}</h2>
<div class="hero-rule"></div>
<text-carousel class="hero-carousel">
<h2>{t("home.subtitle.1")}</h2>
<h2>
{t("home.subtitle.2")}
<PlayerCount client:idle />
</h2>
<h2>{t("home.subtitle.3")}</h2>
</text-carousel>
<a href={l("join")} class="btn btn-ghost mt-32 px-8 flex" style="animation: normal flyIn forwards 1.2s ease-out"
>{t("home.join")}
<CaretRight width="24" height="24" />
<a href={l("join")} class="hero-cta">
<span>{t("home.join")}</span>
<CaretRight width="18" height="18" />
</a>
<style>
@keyframes flyIn {
0% {
translate: 0 16px;
opacity: 0;
}
</div>
20% {
translate: 0 16px;
opacity: 0;
}
100% {
translate: 0;
opacity: 1;
}
}
</style>
<script>
class TextCarousel extends HTMLElement {
current = 0;
connectedCallback() {
this._current.classList.add("!opacity-100");
for (let i = 0; i < this.children.length; i++) {
if (i !== this.current) {
this.children[i].classList.add("translate-y-8");
}
}
setInterval(() => {
this.next();
}, 5000);
}
get _current() {
return this.children[this.current];
}
next() {
this._current.classList.remove("!opacity-100");
this._current.classList.add("translate-y-8");
this._current.classList.remove("!delay-500");
this.current = (this.current + 1) % this.children.length;
this._current.classList.add("!opacity-100");
this._current.classList.remove("translate-y-8");
this._current.classList.add("!delay-500");
}
}
class DropIn extends HTMLElement {
connectedCallback() {
for (let child of this.children) {
if (child.classList.contains("opacity-0")) {
child.classList.remove("opacity-0");
child.classList.remove("-translate-y-16");
} else {
child.children[0].classList.remove("opacity-0");
child.children[0].classList.remove("-translate-y-16");
}
}
}
}
customElements.define("text-carousel", TextCarousel);
customElements.define("drop-in", DropIn);
</script>
</drop-in>
<div class="absolute left-1/2 bottom-6 -translate-x-1/2">
<div class="hero-announcement">
<PostComponent post={latestPost} slim={true} />
</div>
</div>
<section class="w-full flex flex-col items-center justify-center shadow-2xl rounded-b-2xl pb-8">
<div class="py-10 flex flex-col lg:flex-row">
<Card client:idle>
<Crosshair1 height="64" width="64" />
<h1>{t("home.benefits.fights.title")}</h1>
<p class="mt-4">{t("home.benefits.fights.description.1")}</p>
<p class="mt-4">{t("home.benefits.fights.description.2")}</p>
</Card>
<Card client:idle>
<Rocket height="64" width="64" />
<h1>{t("home.benefits.bau.title")}</h1>
<p class="mt-4">{t("home.benefits.bau.description")}</p>
</Card>
<Card client:idle>
<Pause height="64" width="64" />
<h1>{t("home.benefits.minigames.title")}</h1>
<p class="mt-4">{t("home.benefits.minigames.description.1")}</p>
<p class="mt-4">{t("home.benefits.minigames.description.2")}</p>
</Card>
</section>
<!-- ═══════════ FEATURES ═══════════ -->
<section class="features">
<div class="features-glow"></div>
<div class="features-inner">
<div class="features-grid">
<article class="feat">
<span class="feat-num">01</span>
<Crosshair1 height="36" width="36" />
<h3>{t("home.benefits.fights.title")}</h3>
<p>{t("home.benefits.fights.description.1")}</p>
<p>{t("home.benefits.fights.description.2")}</p>
</article>
<article class="feat">
<span class="feat-num">02</span>
<Rocket height="36" width="36" />
<h3>{t("home.benefits.bau.title")}</h3>
<p>{t("home.benefits.bau.description")}</p>
</article>
<article class="feat">
<span class="feat-num">03</span>
<Pause height="36" width="36" />
<h3>{t("home.benefits.minigames.title")}</h3>
<p>{t("home.benefits.minigames.description.1")}</p>
<p>{t("home.benefits.minigames.description.2")}</p>
</article>
</div>
</div>
</section>
<section class="w-full py-12 flex flex-wrap justify-center">
{
Object.entries(teamMember).map(([prefix, players]) => (
<Fragment>
{players.map((v, index) => (
<div class="inline-flex flex-col justify-end">
{index == 0 ? <h2 class="dark:text-white text-4xl font-bold text-center md:text-left md:pl-4">{t("home.prefix." + prefix)}</h2> : null}
<Card extraClasses={`pt-8 pb-10 px-8 w-fit shadow-md ${prefixColorMap[prefix]}`} client:idle>
<figure class="flex flex-col items-center" style="width: 150px">
<figcaption class="text-center mb-4 text-2xl">{v.name}</figcaption>
<!-- ═══════════ TEAM ═══════════ -->
<section class="team">
<div class="team-inner">
{
Object.entries(teamMember).map(([prefix, players]) => (
<div class="rank-group">
<h2 class="rank-label" style={`--rc: ${prefixColors[prefix] || "#666"}`}>
{t("home.prefix." + prefix)}
</h2>
<div class="rank-members">
{players.map((v) => (
<div class="member" style={`--rc: ${prefixColors[prefix] || "#666"}`}>
<Image
src={`${import.meta.env.PUBLIC_API_SERVER}/data/skin/${v.uuid}`}
class="transition duration-300 ease-in-out hover:scale-110 hover:backdrop-blur-lg hover:drop-shadow-2xl"
alt={v.name + "s bust"}
width="150"
height="150"
alt={v.name}
width="120"
height="120"
class="w-[100px] h-[100px] transition-transform duration-300"
/>
</figure>
</Card>
<span class="member-name">{v.name}</span>
</div>
))}
</div>
))}
</Fragment>
))
}
</div>
))
}
</div>
</section>
<script>
class TextCarousel extends HTMLElement {
current = 0;
connectedCallback() {
this._current.classList.add("!opacity-100");
for (let i = 0; i < this.children.length; i++) {
if (i !== this.current) {
this.children[i].classList.add("translate-y-4");
}
}
setInterval(() => this.next(), 5000);
}
get _current() {
return this.children[this.current];
}
next() {
this._current.classList.remove("!opacity-100");
this._current.classList.add("translate-y-4");
this._current.classList.remove("!delay-500");
this.current = (this.current + 1) % this.children.length;
this._current.classList.add("!opacity-100");
this._current.classList.remove("translate-y-4");
this._current.classList.add("!delay-500");
}
}
customElements.define("text-carousel", TextCarousel);
</script>
</NavbarLayout>
<style>
text-carousel {
> * {
@apply absolute top-0 left-0 w-full text-xl sm:text-4xl italic text-white text-center opacity-0;
transition:
transform 0.5s ease-out,
opacity 0.5s linear;
text-shadow: 2px 2px 5px black;
/* ── Typography ── */
.hero-label,
.hero-title,
.hero-cta span,
.feat-num,
.feat h3,
.rank-label,
.member-name {
font-family: "Barlow Condensed", sans-serif;
}
/* ══════════════════════════════════════
HERO
══════════════════════════════════════ */
.hero {
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
}
.hero-bg {
position: absolute;
inset: 0;
height: calc(100vh + 1rem);
}
.hero-gradient {
position: absolute;
inset: 0;
z-index: 2;
background: linear-gradient(
to bottom,
rgba(0, 0, 0, 0.6) 0%,
rgba(0, 0, 0, 0.2) 35%,
rgba(0, 0, 0, 0.45) 65%,
#080808 100%
);
}
.hero-scanlines {
position: absolute;
inset: 0;
z-index: 3;
pointer-events: none;
background: repeating-linear-gradient(
0deg,
transparent 0px,
transparent 3px,
rgba(0, 0, 0, 0.06) 3px,
rgba(0, 0, 0, 0.06) 4px
);
}
.hero-content {
position: relative;
z-index: 10;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 0 1rem;
}
.hero-label {
font-size: 0.65rem;
letter-spacing: 0.5em;
text-transform: uppercase;
color: rgba(245, 158, 11, 0.7);
margin-bottom: 2rem;
animation: fadeUp 0.8s 0.1s ease-out both;
}
@media (min-width: 640px) {
.hero-label { font-size: 0.8rem; }
}
.hero-title {
font-size: clamp(4.5rem, 14vw, 14rem);
font-weight: 900;
line-height: 0.85;
letter-spacing: -0.03em;
user-select: none;
animation: scaleIn 0.9s 0.25s ease-out both;
}
.hero-steam {
background: linear-gradient(160deg, #fcd34d 0%, #f59e0b 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.hero-war {
color: #ffffff;
text-shadow: 0 0 80px rgba(255, 255, 255, 0.06);
}
.hero-rule {
width: 0;
height: 2px;
background: linear-gradient(90deg, transparent, #f59e0b, transparent);
margin: 1.75rem 0;
animation: lineGrow 0.6s 0.7s ease-out both;
}
/* Carousel */
.hero-carousel {
height: 2.5rem;
width: 100%;
max-width: 28rem;
position: relative;
}
@media (min-width: 640px) {
.hero-carousel {
height: 3rem;
max-width: 32rem;
}
}
.barlow {
font-family:
Barlow Condensed,
sans-serif;
text-carousel > * {
position: absolute;
top: 0;
left: 0;
width: 100%;
text-align: center;
opacity: 0;
font-family: "Barlow Condensed", sans-serif;
font-size: 0.95rem;
letter-spacing: 0.18em;
text-transform: uppercase;
color: rgba(255, 255, 255, 0.5);
transform: translateY(8px);
transition:
transform 0.5s ease-out,
opacity 0.5s linear;
}
.card {
@apply w-72 border-2 bg-zinc-50 border-gray-100 flex flex-col items-center p-8 m-4 rounded-xl shadow-lg transition-transform duration-300 ease-in-out
dark:bg-zinc-900 dark:border-gray-800 dark:text-gray-100
hover:scale-105;
@media (min-width: 640px) {
text-carousel > * { font-size: 1.15rem; }
}
> h1 {
@apply text-xl font-bold mt-4;
/* CTA */
.hero-cta {
display: inline-flex;
align-items: center;
gap: 0.6rem;
margin-top: 3rem;
padding: 0.8rem 2.8rem;
border: 1px solid rgba(245, 158, 11, 0.5);
color: #fbbf24;
font-size: 0.85rem;
letter-spacing: 0.2em;
text-transform: uppercase;
background: rgba(245, 158, 11, 0.04);
backdrop-filter: blur(12px);
clip-path: polygon(
0 0,
calc(100% - 14px) 0,
100% 14px,
100% 100%,
14px 100%,
0 calc(100% - 14px)
);
transition: all 0.35s ease;
animation: fadeUp 0.6s 1s ease-out both;
}
.hero-cta:hover {
background: rgba(245, 158, 11, 0.12);
border-color: rgba(245, 158, 11, 0.85);
color: #fff;
box-shadow:
0 0 40px rgba(245, 158, 11, 0.1),
inset 0 0 40px rgba(245, 158, 11, 0.03);
transform: scale(1.04);
}
.hero-cta:active {
transform: scale(0.97);
}
/* Announcement */
.hero-announcement {
position: absolute;
bottom: 1.5rem;
left: 50%;
transform: translateX(-50%);
z-index: 20;
width: 100%;
max-width: 40rem;
padding: 0 1rem;
}
/* ══════════════════════════════════════
FEATURES
══════════════════════════════════════ */
.features {
position: relative;
background: #080808;
overflow: hidden;
}
.features-glow {
position: absolute;
top: -100px;
left: 50%;
transform: translateX(-50%);
width: 500px;
height: 250px;
background: radial-gradient(ellipse, rgba(245, 158, 11, 0.06) 0%, transparent 70%);
pointer-events: none;
}
.features-inner {
position: relative;
z-index: 2;
max-width: 64rem;
margin: 0 auto;
padding: 6rem 1rem;
}
.features-grid {
display: grid;
grid-template-columns: 1fr;
gap: 0;
}
@media (min-width: 768px) {
.features-grid {
grid-template-columns: 1fr 1fr 1fr;
}
}
> p {
@apply mt-4;
.feat {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 2.5rem 2rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
transition: background 0.4s ease;
}
@media (min-width: 768px) {
.feat {
border-bottom: none;
border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.feat:last-child { border-right: none; }
}
> svg {
@apply transition-transform duration-300 ease-in-out hover:scale-110 hover:drop-shadow-2xl;
.feat:hover {
background: rgba(245, 158, 11, 0.025);
}
.feat-num {
font-size: 3.5rem;
font-weight: 800;
line-height: 1;
color: rgba(245, 158, 11, 0.1);
margin-bottom: 1.25rem;
}
.feat :global(svg) {
color: #f59e0b;
margin-bottom: 1.25rem;
transition: transform 0.3s ease;
}
.feat:hover :global(svg) {
transform: scale(1.15);
}
.feat h3 {
font-size: 1.15rem;
font-weight: 700;
color: #fff;
letter-spacing: 0.08em;
text-transform: uppercase;
margin-bottom: 0.75rem;
}
.feat p {
color: rgba(163, 163, 163, 0.85);
font-size: 0.85rem;
line-height: 1.65;
margin-top: 0.3rem;
}
/* ══════════════════════════════════════
TEAM
══════════════════════════════════════ */
.team {
background: #0c0c0c;
padding: 5rem 0;
}
.team-inner {
max-width: 64rem;
margin: 0 auto;
padding: 0 1rem;
}
.rank-group {
margin-bottom: 3rem;
}
.rank-group:last-child {
margin-bottom: 0;
}
.rank-label {
font-size: 1.35rem;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--rc);
padding-bottom: 0.6rem;
margin-bottom: 1.25rem;
border-bottom: 2px solid var(--rc);
display: inline-block;
}
.rank-members {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}
.member {
display: flex;
flex-direction: column;
align-items: center;
padding: 1.25rem 1.5rem;
background: rgba(255, 255, 255, 0.025);
border-top: 2px solid var(--rc);
transition:
transform 0.3s ease,
background 0.3s ease,
box-shadow 0.3s ease;
}
.member:hover {
transform: translateY(-6px);
background: rgba(255, 255, 255, 0.05);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.member:hover :global(img) {
transform: scale(1.08);
}
.member-name {
margin-top: 0.75rem;
font-size: 0.9rem;
letter-spacing: 0.1em;
color: rgba(212, 212, 212, 0.9);
}
/* ══════════════════════════════════════
ANIMATIONS
══════════════════════════════════════ */
@keyframes fadeUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes scaleIn {
from {
opacity: 0;
transform: scale(0.92);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes lineGrow {
from {
width: 0;
opacity: 0;
}
to {
width: 6rem;
opacity: 1;
}
}
</style>