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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user