feat: Refactor hero sections in facilities and stats pages for improved structure and styling

This commit is contained in:
zhangyuheng
2026-03-10 11:17:01 +08:00
parent 092935fd60
commit 2c8a9fdd19
6 changed files with 29 additions and 35 deletions

View File

@@ -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) {