Files
SkyArtShop/website/admin/homepage.html.old

513 lines
16 KiB
HTML
Raw Permalink Normal View History

2026-01-18 02:22:05 -06:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Homepage Editor - Sky Art Shop</title>
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
/>
<link
href="https://cdn.jsdelivr.net/npm/quill@1.3.6/dist/quill.snow.css"
rel="stylesheet"
/>
<link rel="stylesheet" href="/admin/css/admin-style.css" />
<style>
.section-builder {
background: white;
border-radius: 12px;
padding: 25px;
margin-bottom: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
border: 2px solid #e9ecef;
transition: all 0.3s ease;
}
.section-builder:hover {
border-color: #667eea;
}
.section-builder.disabled {
opacity: 0.6;
background: #f8f9fa;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 2px solid #e9ecef;
}
.section-header h5 {
margin: 0;
color: #2c3e50;
font-weight: 700;
}
.section-controls {
display: flex;
gap: 10px;
align-items: center;
}
.image-preview {
width: 100%;
max-width: 400px;
height: 200px;
border: 2px dashed #ccc;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
margin-top: 10px;
overflow: hidden;
background: #f8f9fa;
}
.image-preview img {
max-width: 100%;
max-height: 100%;
object-fit: cover;
}
.image-preview.empty {
color: #6c757d;
}
.alignment-selector {
display: flex;
gap: 10px;
margin-top: 10px;
}
.alignment-btn {
flex: 1;
padding: 10px;
border: 2px solid #e9ecef;
background: white;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
}
.alignment-btn:hover {
border-color: #667eea;
background: #f8f9fa;
}
.alignment-btn.active {
border-color: #667eea;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.save-button {
position: fixed;
bottom: 30px;
right: 30px;
z-index: 999;
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
/* Quill Editor Styling */
.ql-container {
min-height: 150px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
.ql-toolbar {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
background: #f8f9fa;
}
.ql-editor {
min-height: 150px;
font-size: 15px;
line-height: 1.6;
}
.ql-editor.ql-blank::before {
color: #adb5bd;
font-style: italic;
}
</style>
</head>
<body>
<div class="sidebar">
<div class="sidebar-brand">🛍️ Sky Art Shop</div>
<ul class="sidebar-menu">
<li>
<a href="/admin/dashboard"
><i class="bi bi-speedometer2"></i> Dashboard</a
>
</li>
<li>
<a href="/admin/homepage" class="active"
><i class="bi bi-house"></i> Homepage Editor</a
>
</li>
<li>
<a href="/admin/products"><i class="bi bi-box"></i> Products</a>
</li>
<li>
<a href="/admin/portfolio"
><i class="bi bi-easel"></i> Portfolio</a
>
</li>
<li>
<a href="/admin/blog"><i class="bi bi-newspaper"></i> Blog</a>
</li>
<li>
<a href="/admin/pages"
><i class="bi bi-file-text"></i> Custom Pages</a
>
</li>
<li>
<a href="/admin/media-library"
><i class="bi bi-images"></i> Media Library</a
>
</li>
<li>
<a href="/admin/menu"><i class="bi bi-list"></i> Menu</a>
</li>
<li>
<a href="/admin/settings"><i class="bi bi-gear"></i> Settings</a>
</li>
<li>
<a href="/admin/users"><i class="bi bi-people"></i> Users</a>
</li>
</ul>
</div>
<div class="main-content">
<div class="top-bar">
<div>
<h3>Homepage Editor</h3>
<p class="mb-0 text-muted">Customize your homepage sections</p>
</div>
<div>
<a href="/index.html" target="_blank" class="btn btn-info me-2">
<i class="bi bi-eye"></i> Preview
</a>
<button class="btn-logout" onclick="logout()">
<i class="bi bi-box-arrow-right"></i> Logout
</button>
</div>
</div>
<div id="sectionsContainer">
<!-- Hero Section -->
<div class="section-builder" id="heroSection">
<div class="section-header">
<h5><i class="bi bi-stars"></i> Hero Section</h5>
<div class="section-controls">
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
id="heroEnabled"
checked
onchange="toggleSection('hero')"
/>
<label class="form-check-label" for="heroEnabled"
>Enabled</label
>
</div>
</div>
</div>
<div class="section-content">
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">Headline *</label>
<input
type="text"
class="form-control"
id="heroHeadline"
placeholder="Welcome to Sky Art Shop"
/>
</div>
<div class="col-md-6 mb-3">
<label class="form-label">Subheading</label>
<input
type="text"
class="form-control"
id="heroSubheading"
placeholder="Your creative destination"
/>
</div>
</div>
<div class="mb-3">
<label class="form-label">Description</label>
<div
id="heroDescription"
style="background: white; min-height: 150px"
></div>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">CTA Button Text</label>
<input
type="text"
class="form-control"
id="heroCtaText"
placeholder="Shop Now"
/>
</div>
<div class="col-md-6 mb-3">
<label class="form-label">CTA Button Link</label>
<input
type="text"
class="form-control"
id="heroCtaLink"
placeholder="/shop"
/>
</div>
</div>
<div class="mb-3">
<label class="form-label">Background Image/Video</label>
<input type="hidden" id="heroBackgroundUrl" />
<button
type="button"
class="btn btn-outline-primary w-100"
onclick="openMediaLibrary('hero', 'background')"
>
<i class="bi bi-folder2-open"></i> Choose from Media Library
</button>
<div class="image-preview empty" id="heroPreview">
<i class="bi bi-image" style="font-size: 3rem"></i>
</div>
<button
type="button"
class="btn btn-sm btn-outline-danger mt-2"
onclick="clearMedia('hero', 'background')"
id="heroBackgroundClear"
style="display: none"
>
<i class="bi bi-x-circle"></i> Clear Background
</button>
</div>
<div class="mb-3">
<label class="form-label">Layout</label>
<div class="alignment-selector">
<button
class="alignment-btn active"
onclick="setLayout('hero', 'text-left')"
>
<i class="bi bi-align-start"></i> Text Left
</button>
<button
class="alignment-btn"
onclick="setLayout('hero', 'text-center')"
>
<i class="bi bi-align-center"></i> Text Center
</button>
<button
class="alignment-btn"
onclick="setLayout('hero', 'text-right')"
>
<i class="bi bi-align-end"></i> Text Right
</button>
</div>
</div>
</div>
</div>
<!-- Promotion Section -->
<div class="section-builder" id="promotionSection">
<div class="section-header">
<h5><i class="bi bi-gift"></i> Promotion Section</h5>
<div class="section-controls">
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
id="promotionEnabled"
checked
onchange="toggleSection('promotion')"
/>
<label class="form-check-label" for="promotionEnabled"
>Enabled</label
>
</div>
</div>
</div>
<div class="section-content">
<div class="mb-3">
<label class="form-label">Section Title</label>
<input
type="text"
class="form-control"
id="promotionTitle"
placeholder="Special Offers"
/>
</div>
<div class="mb-3">
<label class="form-label">Description</label>
<div
id="promotionDescription"
style="background: white; min-height: 150px"
></div>
</div>
<div class="mb-3">
<label class="form-label">Section Image</label>
<input type="hidden" id="promotionImageUrl" />
<button
type="button"
class="btn btn-outline-primary w-100"
onclick="openMediaLibrary('promotion', 'image')"
>
<i class="bi bi-folder2-open"></i> Choose from Media Library
</button>
<div class="image-preview empty" id="promotionPreview">
<i class="bi bi-image" style="font-size: 3rem"></i>
</div>
<button
type="button"
class="btn btn-sm btn-outline-danger mt-2"
onclick="clearMedia('promotion', 'image')"
id="promotionImageClear"
style="display: none"
>
<i class="bi bi-x-circle"></i> Clear Image
</button>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label class="form-label">Image Position</label>
<div class="alignment-selector">
<button
class="alignment-btn active"
onclick="setImagePosition('promotion', 'left')"
>
<i class="bi bi-arrow-left"></i> Left
</button>
<button
class="alignment-btn"
onclick="setImagePosition('promotion', 'center')"
>
<i class="bi bi-arrow-down"></i> Center
</button>
<button
class="alignment-btn"
onclick="setImagePosition('promotion', 'right')"
>
<i class="bi bi-arrow-right"></i> Right
</button>
</div>
</div>
<div class="col-md-6 mb-3">
<label class="form-label">Text Alignment</label>
<div class="alignment-selector">
<button
class="alignment-btn active"
onclick="setTextAlignment('promotion', 'left')"
>
<i class="bi bi-text-left"></i> Left
</button>
<button
class="alignment-btn"
onclick="setTextAlignment('promotion', 'center')"
>
<i class="bi bi-text-center"></i> Center
</button>
<button
class="alignment-btn"
onclick="setTextAlignment('promotion', 'right')"
>
<i class="bi bi-text-right"></i> Right
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Portfolio Showcase Section -->
<div class="section-builder" id="portfolioSection">
<div class="section-header">
<h5><i class="bi bi-easel"></i> Portfolio Showcase</h5>
<div class="section-controls">
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
id="portfolioEnabled"
checked
onchange="toggleSection('portfolio')"
/>
<label class="form-check-label" for="portfolioEnabled"
>Enabled</label
>
</div>
</div>
</div>
<div class="section-content">
<div class="mb-3">
<label class="form-label">Section Title</label>
<input
type="text"
class="form-control"
id="portfolioTitle"
placeholder="Our Work"
/>
</div>
<div class="mb-3">
<label class="form-label">Description</label>
<div
id="portfolioDescription"
style="background: white; min-height: 150px"
></div>
</div>
<div class="mb-3">
<label class="form-label">Number of Projects to Display</label>
<input
type="number"
class="form-control"
id="portfolioCount"
value="6"
min="3"
max="12"
/>
</div>
</div>
</div>
</div>
<button
class="btn btn-lg btn-primary save-button"
onclick="saveHomepage()"
>
<i class="bi bi-save"></i> Save All Changes
</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/quill@1.3.6/dist/quill.js"></script>
<script src="/admin/js/auth.js"></script>
<script src="/admin/js/homepage.js"></script>
</body>
</html>