mirror of
https://github.com/Coldsmiles/infstarweb.git
synced 2026-04-23 02:30:41 +08:00
feat: Refactor hero sections in facilities and stats pages for improved structure and styling
This commit is contained in:
@@ -1,24 +1,7 @@
|
||||
/* Page-Specific Styles for Facilities */
|
||||
|
||||
.facilities-hero {
|
||||
margin-top: 44px; /* Navbar height */
|
||||
padding: 100px 20px 60px;
|
||||
text-align: center;
|
||||
background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
|
||||
color: #1d1d1f;
|
||||
}
|
||||
|
||||
.facilities-hero h1 {
|
||||
font-size: 48px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 16px;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.hero-subtitle {
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
opacity: 0.8;
|
||||
.facilities-hero-bg {
|
||||
background-image: url('https://img.lunadeer.cn/i/2025/11/26/69267755e14e3.png');
|
||||
}
|
||||
|
||||
/* Container */
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
/* Specific styles for stats page override/additions */
|
||||
.stats-hero {
|
||||
height: 40vh;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.stats-hero-bg {
|
||||
background-image: url('https://img.lunadeer.cn/i/2025/11/26/69267755e14e3.png');
|
||||
}
|
||||
|
||||
@@ -125,6 +125,11 @@ body {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.page-hero {
|
||||
height: 40vh;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.home-hero {
|
||||
background-image: url('https://img.lunadeer.cn/i/2025/11/26/69267755e14e3.png');
|
||||
}
|
||||
|
||||
@@ -54,10 +54,8 @@
|
||||
|
||||
<div id="navbar-component"></div>
|
||||
|
||||
<div class="facilities-hero">
|
||||
<h1>全服共享资源</h1>
|
||||
<p class="hero-subtitle">共同建设,共同分享,让生存更轻松。</p>
|
||||
</div>
|
||||
<!-- Hero Section -->
|
||||
<header id="hero-component" data-title="全服共享资源" data-subtitle="共同建设,共同分享,让生存更轻松。" data-class="facilities-hero-bg"></header>
|
||||
|
||||
<div class="facilities-container">
|
||||
|
||||
|
||||
@@ -52,6 +52,22 @@ const Components = {
|
||||
</footer>
|
||||
`,
|
||||
|
||||
initPageHero: function() {
|
||||
const heroContainer = document.getElementById('hero-component');
|
||||
if (heroContainer) {
|
||||
const title = heroContainer.dataset.title || '';
|
||||
const subtitle = heroContainer.dataset.subtitle || '';
|
||||
const extraClass = heroContainer.dataset.class || '';
|
||||
heroContainer.className = `hero page-hero ${extraClass}`;
|
||||
heroContainer.innerHTML = `
|
||||
<div class="hero-overlay"></div>
|
||||
<div class="hero-content">
|
||||
<h1 class="hero-title">${title}</h1>
|
||||
<p class="hero-subtitle">${subtitle}</p>
|
||||
</div>`;
|
||||
}
|
||||
},
|
||||
|
||||
init: function() {
|
||||
// Inject Navbar
|
||||
const navContainer = document.getElementById('navbar-component');
|
||||
@@ -59,6 +75,9 @@ const Components = {
|
||||
navContainer.innerHTML = this.navbarHTML;
|
||||
}
|
||||
|
||||
// Inject Page Hero
|
||||
this.initPageHero();
|
||||
|
||||
// Inject Footer
|
||||
const footerContainer = document.getElementById('footer-component');
|
||||
if (footerContainer) {
|
||||
|
||||
@@ -56,13 +56,7 @@
|
||||
<div id="navbar-component"></div>
|
||||
|
||||
<!-- Hero Section -->
|
||||
<header class="hero stats-hero stats-hero-bg">
|
||||
<div class="hero-overlay"></div>
|
||||
<div class="hero-content">
|
||||
<h1 class="hero-title">数据中心</h1>
|
||||
<p class="hero-subtitle">记录每一位冒险者的足迹</p>
|
||||
</div>
|
||||
</header>
|
||||
<header id="hero-component" data-title="数据中心" data-subtitle="记录每一位冒险者的足迹" data-class="stats-hero-bg"></header>
|
||||
|
||||
<!-- Main Content -->
|
||||
<div class="features-section stats-main-section">
|
||||
|
||||
Reference in New Issue
Block a user