Skip to content

Commit

Permalink
update the basic logic components
Browse files Browse the repository at this point in the history
  • Loading branch information
ctkqiang committed Nov 3, 2024
1 parent c770844 commit 19d2f5a
Show file tree
Hide file tree
Showing 4 changed files with 442 additions and 273 deletions.
345 changes: 208 additions & 137 deletions public/index.ejs
Original file line number Diff line number Diff line change
@@ -1,187 +1,258 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><%= title %></title>
<title><%= title %> </title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<style>
.hero-section {
background: linear-gradient(135deg, #1e88e5, #1565c0);
color: white;
padding: 100px 0;
min-height: 100vh;
}
.feature-card {
transition: transform 0.3s ease;
cursor: pointer;
}
.feature-card:hover {
transform: translateY(-10px);
}
.icon-large {
font-size: 3rem;
margin-bottom: 1rem;
color: #1e88e5;
}
.fade-in {
animation: fadeIn 1s ease-in;
.hero-section {
background: linear-gradient(135deg, #1e88e5, #1565c0);
color: white;
padding: 100px 0;
min-height: 100vh;
}
.feature-card {
transition: transform 0.3s ease;
cursor: pointer;
}
.feature-card:hover {
transform: translateY(-10px);
}
.icon-large {
font-size: 3rem;
margin-bottom: 1rem;
color: #1e88e5;
}
.fade-in {
animation: fadeIn 1s ease-in;
}
@keyframes pulse {
0% {
transform: scale(1);
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
50% {
transform: scale(1.05);
}
.pulse {
animation: pulse 2s infinite;
100% {
transform: scale(1);
}
}
.pulse {
animation: pulse 2s infinite;
}
</style>
</head>
<body>
</head>
<body onload='sessionStorage.removeItem('modalShown');'>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="/public/main"><i class="bi bi-heart-pulse"></i> <%= title %></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#features">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/public/how-to-use-aed">How To Use AED</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/public/pages/contact">Contact</a>
</li>
</ul>
</div>
<div class="container">
<a class="navbar-brand" href="/public/main">
<i class="bi bi-heart-pulse"></i><%= title %> </a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#features">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/public/how-to-use-aed">How To Use AED</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/public/pages/contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>

<!-- Sponsorship Modal -->
<div class="modal fade" id="sponsorshipModal" tabindex="-1" aria-labelledby="sponsorshipModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="sponsorshipModalLabel">Sponsorship Opportunity</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Attention Penang Government and Interested Parties:</p>
<p>This AED location service is open for official sponsorship and collaboration opportunities. For partnership inquiries, please contact our development team.</p>
<p>Together, we can enhance public safety in Penang.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<a href="mailto:ctkqiang96@zohomail.cn" class="btn btn-primary">Contact Us</a>
</div>
</div>
</div>
</div>
<!-- Hero Section -->
<section class="hero-section d-flex align-items-center">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6 animate__animated animate__fadeInLeft">
<h1 class="display-4 fw-bold mb-4">Find AED Locations in Penang</h1>
<p class="lead mb-4">Quick access to life-saving Automated External Defibrillators (AED) locations across Penang. Every second counts in an emergency.</p>

<a href="/public/locate-aed">
<button class="btn btn-light btn-lg pulse">Find Nearest AED</button>
</a>

</div>
<div class="col-lg-6 animate__animated animate__fadeInRight">
<img src="/assets/screenshot.png" alt="AED Location Map" class="img-fluid rounded shadow">
</div>
</div>
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6 animate__animated animate__fadeInLeft">
<h1 class="display-4 fw-bold mb-4">Find AED Locations in Penang</h1>
<p class="lead mb-4">Quick access to life-saving Automated External Defibrillators (AED) locations across Penang. Every second counts in an emergency.</p>
<a href="/public/locate-aed">
<button class="btn btn-light btn-lg pulse">Find Nearest AED</button>
</a>
</div>
<div class="col-lg-6 animate__animated animate__fadeInRight">
<img src="/assets/screenshot.png" alt="AED Location Map" class="img-fluid rounded shadow">
</div>
</div>
</div>
</section>

<!-- Features Section -->
<section id="features" class="py-5 bg-light">
<div class="container">
<h2 class="text-center mb-5">Key Features</h2>
<div class="row g-4">
<div class="col-md-4">
<div class="card feature-card h-100 shadow-sm">
<div class="card-body text-center">
<i class="bi bi-geo-alt icon-large"></i>
<h5 class="card-title">Real-time Location</h5>
<p class="card-text">Find the nearest AED with precise coordinates and directions.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card feature-card h-100 shadow-sm">
<div class="card-body text-center">
<i class="bi bi-images icon-large"></i>
<h5 class="card-title">Visual Guidance</h5>
<p class="card-text">View images of AED locations for easy identification.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card feature-card h-100 shadow-sm">
<div class="card-body text-center">
<i class="bi bi-info-circle icon-large"></i>
<h5 class="card-title">Detailed Information</h5>
<p class="card-text">Access comprehensive details about each AED location.</p>
</div>
</div>
</div>
<div class="container">
<h2 class="text-center mb-5">Key Features</h2>
<div class="row g-4">
<div class="col-md-4">
<div class="card feature-card h-100 shadow-sm">
<div class="card-body text-center">
<i class="bi bi-geo-alt icon-large"></i>
<h5 class="card-title">Real-time Location</h5>
<p class="card-text">Find the nearest AED with precise coordinates and directions.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card feature-card h-100 shadow-sm">
<div class="card-body text-center">
<i class="bi bi-images icon-large"></i>
<h5 class="card-title">Visual Guidance</h5>
<p class="card-text">View images of AED locations for easy identification.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card feature-card h-100 shadow-sm">
<div class="card-body text-center">
<i class="bi bi-info-circle icon-large"></i>
<h5 class="card-title">Detailed Information</h5>
<p class="card-text">Access comprehensive details about each AED location.</p>
</div>
</div>
</div>
</div>
</div>
</section>

<!-- API Documentation Section -->
<section id="about" class="py-5">
<div class="container">
<h2 class="text-center mb-5">API Documentation</h2>
<div class="row">
<div class="col-lg-8 mx-auto">
<div class="card shadow">
<div class="card-body">
<h5>Available Endpoints:</h5>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<code>GET /aed/all</code>
<p class="mb-0 mt-2">Retrieve all AED locations in Penang</p>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<h2 class="text-center mb-5">API Documentation</h2>
<div class="row">
<div class="col-lg-8 mx-auto">
<div class="card shadow">
<div class="card-body">
<h5>Available Endpoints:</h5>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<code>GET /aed/all</code>
<p class="mb-0 mt-2">Retrieve all AED locations in Penang</p>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>

<!-- Contact Section -->
<section id="contact" class="py-5 bg-light">
<div class="container">
<h2 class="text-center mb-5">Contact Developer</h2>
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="card shadow">
<div class="card-body text-center">
<i class="bi bi-envelope-fill icon-large"></i>
<p class="lead">Technical Support:</p>
<a href="mailto:ctkqiang96@zohomail.cn" class="text-decoration-none">ctkqiang96@zohomail.cn</a>
</div>
</div>
</div>
<div class="container">
<h2 class="text-center mb-5">Contact Developer</h2>
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="card shadow">
<div class="card-body text-center">
<i class="bi bi-envelope-fill icon-large"></i>
<p class="lead">Technical Support:</p>
<a href="mailto:ctkqiang96@zohomail.cn" class="text-decoration-none">ctkqiang96@zohomail.cn</a>
</div>
</div>
</div>
</div>
</div>
</section>

<div id="sponsorshipToast" class="custom-toast" style="display: none;">
<div class="toast-header">
<strong class="me-auto">Sponsorship Opportunity</strong>
<button type="button" class="toast-close" onclick="dismissToast()">&times;</button>
</div>
<div class="toast-body">
<p style="font-size: 0.9rem; line-height: 1.5; color: #333;"> Attention Penang Government and Interested Parties: <br>
<br> This AED location service is open for official sponsorship and collaboration opportunities. For partnership inquiries, please contact our development team. <br>
<br> Together, we can enhance public safety in Penang.
</p>
<a href="mailto:ctkqiang96@zohomail.cn" class="btn btn-sm btn-primary mt-2">Contact Us</a>
</div>
</div>
<!-- Footer -->
<footer class="bg-dark text-white py-4">
<div class="container text-center">
<p class="mb-0">&copy; 2024 <%= title %>. All rights reserved.</p>
</div>
<div class="container text-center">
<p class="mb-0">&copy; 2025 <% title %>. All rights reserved. 上饶满星科技 </p>
</div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Add smooth scrolling to all links
document.addEventListener('DOMContentLoaded', function() {
// Smooth scrolling
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
anchor.addEventListener('click', function(e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Test button to show modal (temporary for testing)
// You can remove this after confirming the modal works
console.log("DOM Loaded - Modal Script Running");
// Modal functionality
const modalEl = document.getElementById('sponsorshipModal');
if (!modalEl) {
console.error('Modal element not found');
return;
}
const sponsorshipModal = new bootstrap.Modal(modalEl);
console.log("Modal initialized");
// Show modal immediately for testing
// sponsorshipModal.show();
// Show modal on scroll
window.addEventListener('scroll', () => {
if (!sessionStorage.getItem('modalShown') && window.scrollY > 1) {
console.log("Showing modal");
sponsorshipModal.show();
sessionStorage.setItem('modalShown', 'true');
sessionStorage.setItem('modalShown', 'true');
}
});
});
// Alternative trigger - you can remove this after confirming the modal works
function testModal() {
const modalEl = document.getElementById('sponsorshipModal');
const modal = new bootstrap.Modal(modalEl);
modal.show();
}
</script>
</body>
</body>
</html>
Loading

0 comments on commit 19d2f5a

Please sign in to comment.