webupdate
This commit is contained in:
@@ -1,265 +1,399 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Frequently Asked Questions - Sky Art Shop"
|
||||
/>
|
||||
<title>FAQ - Sky Art Shop</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap"
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700;800&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<!-- Icons -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
|
||||
/>
|
||||
<link rel="stylesheet" href="/assets/css/theme-colors.css" />
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=1735692100" />
|
||||
<link rel="stylesheet" href="/assets/css/navbar.css?v=1768447584" />
|
||||
<link rel="stylesheet" href="/assets/css/page-overrides.css?v=1736790001" />
|
||||
<link rel="stylesheet" href="/assets/css/cart-wishlist.css" />
|
||||
<link rel="stylesheet" href="/assets/css/shopping.css" />
|
||||
<link rel="stylesheet" href="/assets/css/responsive.css" />
|
||||
|
||||
<!-- Modern Theme CSS -->
|
||||
<link rel="stylesheet" href="/assets/css/modern-theme.css?v=20260118drawer" />
|
||||
<link rel="stylesheet" href="/assets/css/mobile-fixes.css?v=20260118c" />
|
||||
|
||||
<style>
|
||||
.faq-container {
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.faq-item {
|
||||
background: var(--bg-white);
|
||||
border-radius: var(--radius-lg);
|
||||
margin-bottom: var(--spacing-md);
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: var(--transition-smooth);
|
||||
}
|
||||
|
||||
.faq-item:hover {
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.faq-question {
|
||||
padding: var(--spacing-lg);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
transition: var(--transition-fast);
|
||||
}
|
||||
|
||||
.faq-question:hover {
|
||||
background: var(--primary-pink-light);
|
||||
}
|
||||
|
||||
.faq-icon {
|
||||
font-size: 1.2rem;
|
||||
transition: var(--transition-fast);
|
||||
color: var(--primary-pink-dark);
|
||||
}
|
||||
|
||||
.faq-item.active .faq-icon {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.faq-answer {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.3s ease;
|
||||
}
|
||||
|
||||
.faq-answer-content {
|
||||
padding: 0 var(--spacing-lg) var(--spacing-lg);
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.faq-item.active .faq-answer {
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.contact-box {
|
||||
background: var(--primary-pink-light);
|
||||
padding: var(--spacing-xl);
|
||||
border-radius: var(--radius-lg);
|
||||
text-align: center;
|
||||
margin-top: var(--spacing-2xl);
|
||||
}
|
||||
|
||||
.contact-box h3 {
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>window.__bodyReady=true</script>
|
||||
<div class="sticky-banner-wrapper">
|
||||
<!-- Modern Navigation -->
|
||||
<nav class="modern-navbar">
|
||||
<div class="navbar-wrapper">
|
||||
<div class="navbar-brand">
|
||||
<a href="/home" class="brand-link">
|
||||
<img
|
||||
src="/uploads/cat-png-1767324141436-368259437.png"
|
||||
alt="Sky Art Shop Logo"
|
||||
class="brand-logo"
|
||||
/>
|
||||
<span class="brand-name">Sky' Art Shop</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Navigation -->
|
||||
<header class="nav-wrapper">
|
||||
<nav class="navbar">
|
||||
<a href="/home" class="nav-brand">
|
||||
<img
|
||||
src="/uploads/cat-png-1767324141436-368259437.png"
|
||||
alt="Sky Art Shop Logo"
|
||||
/>
|
||||
<span>Sky Art Shop</span>
|
||||
</a>
|
||||
|
||||
<div class="navbar-menu">
|
||||
<ul class="nav-menu-list">
|
||||
<li class="nav-item">
|
||||
<a href="/home" class="nav-link">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/shop" class="nav-link">Shop</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/portfolio" class="nav-link">Portfolio</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/about" class="nav-link">About</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/blog" class="nav-link active">Blog</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/contact" class="nav-link">Contact</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="navbar-actions">
|
||||
<div class="action-item wishlist-dropdown-wrapper">
|
||||
<button
|
||||
class="action-btn"
|
||||
id="wishlistToggle"
|
||||
aria-label="Wishlist"
|
||||
>
|
||||
<i class="bi bi-heart"></i>
|
||||
<span class="action-badge" id="wishlistCount">0</span>
|
||||
</button>
|
||||
<div class="action-dropdown wishlist-dropdown" id="wishlistPanel">
|
||||
<div class="dropdown-head">
|
||||
<h3>My Wishlist</h3>
|
||||
<button class="dropdown-close" id="wishlistClose">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dropdown-body" id="wishlistContent">
|
||||
<p class="empty-state">Your wishlist is empty</p>
|
||||
</div>
|
||||
<div class="dropdown-foot">
|
||||
<a href="/shop" class="btn-outline">Continue Shopping</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="action-item cart-dropdown-wrapper">
|
||||
<button
|
||||
class="action-btn"
|
||||
id="cartToggle"
|
||||
aria-label="Shopping Cart"
|
||||
>
|
||||
<i class="bi bi-cart3"></i>
|
||||
<span class="action-badge" id="cartCount">0</span>
|
||||
</button>
|
||||
<div class="action-dropdown cart-dropdown" id="cartPanel">
|
||||
<div class="dropdown-head">
|
||||
<h3>Shopping Cart</h3>
|
||||
<button class="dropdown-close" id="cartClose">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dropdown-body" id="cartContent">
|
||||
<p class="empty-state"><i class="bi bi-cart-x"></i><br>Your cart is empty</p>
|
||||
</div>
|
||||
<div class="dropdown-foot">
|
||||
<a href="/shop" class="btn-outline">Continue Shopping</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="mobile-toggle" id="mobileMenuToggle" aria-label="Menu">
|
||||
<span class="toggle-line"></span>
|
||||
<span class="toggle-line"></span>
|
||||
<span class="toggle-line"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mobile-menu" id="mobileMenu">
|
||||
<div class="mobile-menu-header">
|
||||
<span class="mobile-brand">Sky' Art Shop</span>
|
||||
<button class="mobile-close" id="mobileMenuClose">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
<ul class="mobile-menu-list">
|
||||
<li><a href="/home" class="mobile-link">Home</a></li>
|
||||
<li><a href="/shop" class="mobile-link">Shop</a></li>
|
||||
<li><a href="/portfolio" class="mobile-link">Portfolio</a></li>
|
||||
<li><a href="/about" class="mobile-link">About</a></li>
|
||||
<li><a href="/blog" class="mobile-link">Blog</a></li>
|
||||
<li><a href="/contact" class="mobile-link">Contact</a></li>
|
||||
<ul class="nav-menu">
|
||||
<li><a href="/home" class="nav-link">Home</a></li>
|
||||
<li><a href="/shop" class="nav-link">Shop</a></li>
|
||||
<li><a href="/portfolio" class="nav-link">Portfolio</a></li>
|
||||
<li><a href="/blog" class="nav-link">Blog</a></li>
|
||||
<li><a href="/about" class="nav-link">About</a></li>
|
||||
<li><a href="/contact" class="nav-link">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mobile-menu-overlay" id="mobileMenuOverlay"></div>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
// Mobile Menu Toggle
|
||||
(function() {
|
||||
const mobileToggle = document.getElementById('mobileMenuToggle');
|
||||
const mobileMenu = document.getElementById('mobileMenu');
|
||||
const mobileClose = document.getElementById('mobileMenuClose');
|
||||
const overlay = document.getElementById('mobileMenuOverlay');
|
||||
|
||||
function openMenu() {
|
||||
mobileMenu.classList.add('active');
|
||||
overlay.classList.add('active');
|
||||
document.body.style.overflow = 'hidden';
|
||||
}
|
||||
function closeMenu() {
|
||||
mobileMenu.classList.remove('active');
|
||||
overlay.classList.remove('active');
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
if (mobileToggle) mobileToggle.addEventListener('click', openMenu);
|
||||
if (mobileClose) mobileClose.addEventListener('click', closeMenu);
|
||||
if (overlay) overlay.addEventListener('click', closeMenu);
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape' && mobileMenu.classList.contains('active')) closeMenu();
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<section class="about-hero">
|
||||
<div class="container">
|
||||
<h1><i class="bi bi-question-circle"></i> Frequently Asked Questions</h1>
|
||||
<p class="hero-subtitle">Quick answers to common questions</p>
|
||||
</div>
|
||||
</section>
|
||||
<section class="blog-section" style="padding: 60px 0; background: #ffebeb">
|
||||
<div class="container">
|
||||
<div style="max-width: 800px; margin: 0 auto; background: white; padding: 40px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
|
||||
<div style="margin-bottom: 30px;">
|
||||
<h3 style="color: #667eea;">How long does shipping take?</h3>
|
||||
<p style="color: #666; line-height: 1.8;">Standard shipping takes 5-7 business days. Express shipping (2-3 days) and overnight shipping are also available.</p>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px;">
|
||||
<h3 style="color: #667eea;">Do you ship internationally?</h3>
|
||||
<p style="color: #666; line-height: 1.8;">Yes! We ship to over 50 countries worldwide. International orders typically arrive in 7-14 business days.</p>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px;">
|
||||
<h3 style="color: #667eea;">What is your return policy?</h3>
|
||||
<p style="color: #666; line-height: 1.8;">We offer a 30-day return policy on most items. Items must be unused and in original packaging. See our <a href="/returns" style="color: #667eea;">Returns page</a> for details.</p>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px;">
|
||||
<h3 style="color: #667eea;">How can I track my order?</h3>
|
||||
<p style="color: #666; line-height: 1.8;">Once your order ships, you'll receive a tracking number via email. You can also check your order status in your account dashboard.</p>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px;">
|
||||
<h3 style="color: #667eea;">Do you offer gift wrapping?</h3>
|
||||
<p style="color: #666; line-height: 1.8;">Yes! Add gift wrapping to your order at checkout for just $4.99. We'll include a personalized message card.</p>
|
||||
</div>
|
||||
|
||||
<div style="background: #f8f9fa; padding: 20px; border-radius: 8px; border-left: 4px solid #667eea; margin-top: 30px;">
|
||||
<p style="color: #666; margin: 0;"><strong>Still have questions?</strong> Contact us at <a href="mailto:support@skyartshop.com" style="color: #667eea;">support@skyartshop.com</a></p>
|
||||
<div class="nav-actions">
|
||||
<a href="/signin" class="nav-icon-btn" title="Sign In">
|
||||
<i class="bi bi-person"></i>
|
||||
</a>
|
||||
<button class="nav-icon-btn wishlist-btn-nav" title="Wishlist">
|
||||
<i class="bi bi-heart"></i>
|
||||
<span class="badge wishlist-count" style="display: none">0</span>
|
||||
</button>
|
||||
<button class="nav-icon-btn cart-btn" title="Cart">
|
||||
<i class="bi bi-bag"></i>
|
||||
<span class="badge cart-count" style="display: none">0</span>
|
||||
</button>
|
||||
<button class="nav-mobile-toggle" aria-label="Toggle menu">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- Page Content -->
|
||||
<main class="page-content">
|
||||
<!-- Page Header -->
|
||||
<div class="page-header">
|
||||
<div class="container">
|
||||
<h1 id="faqHeaderTitle">
|
||||
<i class="bi bi-question-circle"></i> Frequently Asked Questions
|
||||
</h1>
|
||||
<p id="faqHeaderSubtitle">Quick answers to common questions</p>
|
||||
<div class="breadcrumb">
|
||||
<a href="/home">Home</a>
|
||||
<span>/</span>
|
||||
<span>FAQ</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- FAQ Section -->
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="faq-container" id="faqContainer">
|
||||
<!-- FAQ items will be loaded from API -->
|
||||
<div class="loading-spinner" style="margin: 40px auto"></div>
|
||||
</div>
|
||||
|
||||
<div class="contact-box">
|
||||
<h3>Still have questions?</h3>
|
||||
<p>Our customer service team is here to help!</p>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
gap: var(--spacing-md);
|
||||
justify-content: center;
|
||||
margin-top: var(--spacing-lg);
|
||||
flex-wrap: wrap;
|
||||
"
|
||||
>
|
||||
<a href="/contact" class="btn btn-primary">Contact Us</a>
|
||||
<a href="mailto:support@skyartshop.com" class="btn btn-outline"
|
||||
>Email Support</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="footer-grid">
|
||||
<div class="footer-col">
|
||||
<h3 class="footer-title">Sky Art Shop</h3>
|
||||
<p class="footer-text">
|
||||
Your destination for unique art pieces and creative supplies.
|
||||
<div class="footer-about">
|
||||
<div class="footer-brand">
|
||||
<img
|
||||
src="/uploads/cat-png-1767324141436-368259437.png"
|
||||
alt="Sky Art Shop"
|
||||
/>
|
||||
<span>Sky Art Shop</span>
|
||||
</div>
|
||||
<p>
|
||||
Your one-stop shop for scrapbooking, journaling, cardmaking, and
|
||||
collaging stationery. Quality products for all your creative
|
||||
needs.
|
||||
</p>
|
||||
<div class="social-links">
|
||||
<div class="footer-social">
|
||||
<a href="#" class="social-link"><i class="bi bi-facebook"></i></a>
|
||||
<a href="#" class="social-link"><i class="bi bi-instagram"></i></a>
|
||||
<a href="#" class="social-link"><i class="bi bi-twitter"></i></a>
|
||||
<a href="#" class="social-link"><i class="bi bi-pinterest"></i></a>
|
||||
<a href="#" class="social-link"
|
||||
><i class="bi bi-instagram"></i
|
||||
></a>
|
||||
<a href="#" class="social-link"
|
||||
><i class="bi bi-pinterest"></i
|
||||
></a>
|
||||
<a href="#" class="social-link"><i class="bi bi-youtube"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-col">
|
||||
<h4 class="footer-heading">Shop</h4>
|
||||
|
||||
<div class="footer-column">
|
||||
<h4>Quick Links</h4>
|
||||
<ul class="footer-links">
|
||||
<li><a href="/shop">All Products</a></li>
|
||||
<li><a href="/shop?category=paintings">Paintings</a></li>
|
||||
<li><a href="/shop?category=prints">Prints</a></li>
|
||||
<li><a href="/shop?category=supplies">Art Supplies</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer-col">
|
||||
<h4 class="footer-heading">About</h4>
|
||||
<ul class="footer-links">
|
||||
<li><a href="/about">Our Story</a></li>
|
||||
<li><a href="/home">Home</a></li>
|
||||
<li><a href="/shop">Shop</a></li>
|
||||
<li><a href="/portfolio">Portfolio</a></li>
|
||||
<li><a href="/blog">Blog</a></li>
|
||||
<li><a href="/about">About Us</a></li>
|
||||
<li><a href="/contact">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer-col">
|
||||
<h4 class="footer-heading">Customer Service</h4>
|
||||
|
||||
<div class="footer-column">
|
||||
<h4>Customer Service</h4>
|
||||
<ul class="footer-links">
|
||||
<li><a href="/shipping-info">Shipping Info</a></li>
|
||||
<li><a href="/returns">Returns</a></li>
|
||||
<li><a href="/faq">FAQ</a></li>
|
||||
<li><a href="/shipping-info">Shipping Info</a></li>
|
||||
<li><a href="/returns">Returns & Refunds</a></li>
|
||||
<li><a href="/privacy">Privacy Policy</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer-column">
|
||||
<h4>Contact Us</h4>
|
||||
<ul class="footer-links">
|
||||
<li><i class="bi bi-envelope"></i> hello@skyartshop.com</li>
|
||||
<li><i class="bi bi-telephone"></i> (555) 123-4567</li>
|
||||
<li><i class="bi bi-geo-alt"></i> 123 Creative Lane</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer-bottom">
|
||||
<p>© 2025 Sky Art Shop. All rights reserved.</p>
|
||||
<p>© 2026 Sky Art Shop. All rights reserved.</p>
|
||||
<p>
|
||||
Made with
|
||||
<i class="bi bi-heart-fill" style="color: var(--primary-pink)"></i>
|
||||
for creative souls
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- Core Scripts (standardized order) -->
|
||||
<script src="/assets/js/main.js"></script>
|
||||
<script src="/assets/js/shop-system.js"></script>
|
||||
<script src="/assets/js/page-transitions.js?v=1766709739"></script>
|
||||
<script src="/assets/js/back-button-control.js?v=1766723554"></script>
|
||||
<script src="/assets/js/navigation.js"></script>
|
||||
|
||||
|
||||
<!-- Cart Drawer -->
|
||||
<div class="cart-overlay"></div>
|
||||
<div class="cart-drawer">
|
||||
<div class="cart-header">
|
||||
<h3>Shopping Cart</h3>
|
||||
<button class="cart-close"><i class="bi bi-x"></i></button>
|
||||
</div>
|
||||
<div class="cart-items">
|
||||
<!-- Cart items rendered via JavaScript -->
|
||||
</div>
|
||||
<div class="cart-footer">
|
||||
<div class="cart-total">
|
||||
<span>Total:</span>
|
||||
<span class="cart-total-amount">$0.00</span>
|
||||
</div>
|
||||
<a href="/checkout" class="btn btn-primary cart-checkout-btn"
|
||||
>Checkout</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Wishlist Drawer -->
|
||||
<div class="wishlist-overlay"></div>
|
||||
<div class="wishlist-drawer">
|
||||
<div class="wishlist-header">
|
||||
<h3><i class="bi bi-heart"></i> My Wishlist</h3>
|
||||
<button class="wishlist-close"><i class="bi bi-x"></i></button>
|
||||
</div>
|
||||
<div class="wishlist-items"></div>
|
||||
<div class="wishlist-footer">
|
||||
<a href="/shop" class="btn btn-outline">Continue Shopping</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="/assets/js/modern-theme.js?v=20260118c"></script>
|
||||
<script src="/assets/js/customer-auth.js"></script>
|
||||
<script>
|
||||
// Load FAQ page data from API
|
||||
async function loadFaqPageData() {
|
||||
const container = document.getElementById("faqContainer");
|
||||
|
||||
try {
|
||||
const response = await fetch("/api/pages/faq");
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success && data.page && data.page.pagedata) {
|
||||
const pagedata =
|
||||
typeof data.page.pagedata === "string"
|
||||
? JSON.parse(data.page.pagedata)
|
||||
: data.page.pagedata;
|
||||
|
||||
// Update header
|
||||
if (pagedata.header) {
|
||||
if (pagedata.header.title) {
|
||||
document.getElementById("faqHeaderTitle").innerHTML =
|
||||
'<i class="bi bi-question-circle"></i> ' +
|
||||
pagedata.header.title;
|
||||
}
|
||||
if (pagedata.header.subtitle) {
|
||||
document.getElementById("faqHeaderSubtitle").textContent =
|
||||
pagedata.header.subtitle;
|
||||
}
|
||||
}
|
||||
|
||||
// Render FAQ items
|
||||
if (pagedata.items && pagedata.items.length > 0) {
|
||||
container.innerHTML = pagedata.items
|
||||
.map(
|
||||
(item, index) => `
|
||||
<div class="faq-item ${index === 0 ? "active" : ""}">
|
||||
<div class="faq-question">
|
||||
<span>${escapeHtml(item.question)}</span>
|
||||
<i class="bi bi-chevron-down faq-icon"></i>
|
||||
</div>
|
||||
<div class="faq-answer" ${index === 0 ? 'style="max-height: 500px;"' : ""}>
|
||||
<div class="faq-answer-content">
|
||||
<p>${item.answer}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
)
|
||||
.join("");
|
||||
|
||||
// Setup accordion behavior
|
||||
setupFaqAccordion();
|
||||
} else {
|
||||
container.innerHTML =
|
||||
'<p class="text-center">No FAQs available yet.</p>';
|
||||
}
|
||||
} else {
|
||||
container.innerHTML =
|
||||
'<p class="text-center">Unable to load FAQs.</p>';
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error loading FAQ page:", error);
|
||||
container.innerHTML =
|
||||
'<p class="text-center">Unable to load FAQs.</p>';
|
||||
}
|
||||
}
|
||||
|
||||
function setupFaqAccordion() {
|
||||
document.querySelectorAll(".faq-item").forEach((item) => {
|
||||
const question = item.querySelector(".faq-question");
|
||||
question.addEventListener("click", () => {
|
||||
const isActive = item.classList.contains("active");
|
||||
|
||||
// Close all items
|
||||
document.querySelectorAll(".faq-item").forEach((i) => {
|
||||
i.classList.remove("active");
|
||||
i.querySelector(".faq-answer").style.maxHeight = "0";
|
||||
});
|
||||
|
||||
// Open clicked item if it wasn't active
|
||||
if (!isActive) {
|
||||
item.classList.add("active");
|
||||
item.querySelector(".faq-answer").style.maxHeight = "500px";
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function escapeHtml(text) {
|
||||
if (!text) return "";
|
||||
const div = document.createElement("div");
|
||||
div.textContent = text;
|
||||
return div.innerHTML;
|
||||
}
|
||||
|
||||
// Load page data on DOMContentLoaded
|
||||
document.addEventListener("DOMContentLoaded", loadFaqPageData);
|
||||
</script>
|
||||
<script src="/assets/js/accessibility.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user