lekkerlogic.com Ads.txt file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LekkerLogic - AI-Powered Business Solutions</title>
<!-- SEO Meta Tags -->
<meta name="description" content="LekkerLogic helps businesses deploy practical, human-centered solutions that enhance workflows, making teams smarter, more efficient, and more productive.">
<meta name="keywords" content="AI business solutions, artificial intelligence, business automation, data analytics, CRM systems, ERP systems, intelligent reporting, smart manufacturing">
<meta name="author" content="LekkerLogic">
<!-- Open Graph / Social Media Meta Tags -->
<meta property="og:title" content="LekkerLogic - AI-Powered Business Solutions">
<meta property="og:description" content="Enhancing human potential with AI. Solutions that make your teams smarter, more efficient, and more productive.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.lekkerlogic.com">
<meta property="og:image" content="https://lekkerlogic.com/assets/img/human-ai.png">
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="LekkerLogic - AI-Powered Business Solutions">
<meta name="twitter:description" content="Enhancing human potential with AI. Solutions that make your teams smarter, more efficient, and more productive.">
<meta name="twitter:image" content="https://lekkerlogic.com/assets/img/human-ai.png">
<!-- Canonical URL -->
<link rel="canonical" href="https://www.lekkerlogic.com">
<!-- Bootstrap 5 CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome for icons -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<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=Fira+Code:wght@300..700&family=Quicksand:wght@300..700&display=swap" rel="stylesheet">
<!-- Custom CSS -->
<link href="assets/css/styles.css" rel="stylesheet">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DGJSNHSGXQ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-DGJSNHSGXQ');
</script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<div class="container">
<a class="navbar-brand d-flex align-items-center" href="#">
<span class="animated-gradient-text my-2 fs-4 quicksand-lekker-logo"><i class="fa-solid fa-code me-2"></i>{ LekkerLogic }</span>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<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="#solutions">Solutions</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#benefits">Benefits</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
<a href="#contact" class="btn btn-outline-primary ms-3 d-none d-lg-block">Get Started</a>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="hero d-flex align-items-center">
<div class="glowing-circle circle-1"></div>
<div class="glowing-circle circle-2"></div>
<div class="container hero-content">
<div class="row align-items-center position-relative">
<!-- Code container - now positioned absolutely -->
<div class="code-background position-absolute">
<div id="code-container"></div>
</div>
<!-- Content div (will appear in front) -->
<div class="col-lg-6 position-relative z-index-1">
<h1 class="display-3 fw-bold mb-4 quicksand-lekker-h">Enhancing Human Potential With <span class="animated-gradient-text">Artificial Intelligence</span></h1>
<p class="lead mb-5 fw-bold quicksand-lekker-p"><span class="animated-gradient-text">{ LekkerLogic }</span> helps businesses deploy practical, Human-Centered AI software that supplements workflows, making your teams smarter, more productive and more profitable.</p>
<div class="d-flex flex-wrap gap-3">
<a href="#solutions" class="btn btn-primary btn-cta">Explore Solutions <i class="fa-solid fa-arrow-down"></i></a>
<a href="#contact" class="btn btn-outline-primary btn-cta">Let's Go!</a>
</div>
</div>
<!-- This column is now empty since we're using absolute positioning -->
<div class="col-lg-6"></div>
</div>
</div>
<div class="scroll-down-indicator">
<i class="fas fa-chevron-down"></i>
</div>
</section>
<!-- Solutions Section -->
<section id="solutions" class="section">
<div class="container">
<div class="text-center mb-5">
<h2 class="display-5 fw-bold">Super Powered <span class="animated-gradient-text">Business Solutions</span></h2>
<p class="lead w-75 mx-auto">We develop intelligent applications that unlock your business's full potential, empowering your teams to innovate, adapt, and thrive in today's competitive landscape while enhancing human capabilities rather than replacing them.</p>
</div>
<div class="row g-4">
<div class="col-md-6 col-lg-4">
<div class="card p-4">
<h3 class="h4 lighter-text"><i class="fas fa-users-cog me-3"></i>AI-Enhanced Applications</h3>
<p>Intelligent software solutions that seamlessly integrate with your existing systems, transforming workflows through predictive analysis, automated task handling, and personalized data insights that make your team more efficient and effective.</p>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="card p-4">
<h3 class="h4 lighter-text"><i class="fas fa-chart-line me-3"></i>Data Intelligence</h3>
<p>Harness the full potential of your business data. Our systems identify hidden patterns, predict market trends, and deliver intuitive visualizations that empower every team member to make confident, data-driven decisions that drive growth.</p>
</div>
</div>
<div class="col-md-6 col-lg-4">
<div class="card p-4">
<h3 class="h4 lighter-text"><i class="fas fa-industry me-3"></i>Smart Manufacturing</h3>
<p>Advanced AI-driven solutions that transform production environments by analyzing real-time data to optimize workflows, predict maintenance needs, reduce downtime, and enhance quality control—all while empowering your team to make data-backed decisions that increase productivity and profitability.</p>
</div>
</div>
<div class="col-md-6 col-lg-6">
<div class="card p-4">
<h3 class="h4 lighter-text"><i class="fas fa-clipboard-list me-3"></i>Intelligent Reporting</h3>
<p>Automated reports and dashboards that deliver real-time business insights, helping your team focus on strategy rather than data compilation.</p>
</div>
</div>
<div class="col-md-6 col-lg-6">
<div class="card p-4">
<h3 class="h4 lighter-text"><i class="fas fa-robot me-3"></i>Custom Solutions</h3>
<p>Tailored applications designed specifically for your unique business challenges and team workflows.</p>
</div>
</div>
</div>
</div>
</section>
<!-- Recent Work Section with New TaakBoard Entry -->
<section id="recent-work" class="section section-dark">
<div class="container">
<div class="text-center mb-5">
<h2 class="display-5 fw-bold">Our <span class="animated-gradient-text">Recent Work</span></h2>
<p class="lead w-75 mx-auto">Discover how we've helped businesses transform their operations with our innovative solutions.</p>
</div>
<div class="row g-4">
<div class="col-md-6">
<div class="project-card">
<div class="project-icon">
<i class="fas fa-tasks"></i>
</div>
<div class="project-content">
<h3 class="h5 teal-text">AI Project Management Platform</h3>
<p>Developed <a href="https://www.taakboard.com" target="_bl">TaakBoard.com</a>, an AI-powered project management solution designed for businesses to track projects, customers, and manufacturers - with intelligent insights that help you stay ahead. The platform features automated task prioritization, resource allocation optimization, and predictive timeline analysis that identifies potential bottlenecks before they impact deadlines. This comprehensive solution has helped clients improve project completion rates and reduce management overhead.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="project-card">
<div class="project-icon">
<i class="fas fa-envelope-open-text"></i>
</div>
<div class="project-content">
<h3 class="h5 teal-text">Agentic AI Email Assistant</h3>
<p>Developed a propietary, intelligent email processing system that works autonomously by simply forwarding emails to a dedicated address for CRM insertion. Built for the Visie iQ and <a href="https://visie.ai" target="_blank">Visie.ai</a> platform, the system scans content, extracts information and generates comprehensive summaries directly into your CRM's notes section. This hands-free solution saves teams hours daily on manual data entry while ensuring critical client information is never missed.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="project-card">
<div class="project-icon">
<i class="fas fa-warehouse"></i>
</div>
<div class="project-content">
<h3 class="h5 teal-text">Customer Portal - HoffmanPortal.com</h3>
<p>Developed a comprehensive customer portal for nVent at <a href="https://hoffmanportal.com" target="_blank">HoffmanPortal.com</a> that provides real-time access to product availability, inventory levels, and pricing information. The system tracks browsing patterns, creating dynamic customer profiles that reveal product interests and buying intent. This intelligence drives personalized recommendations, targeted marketing campaigns, and inventory forecasting. Our partnership with nVent resulted in increased customer engagement and improved conversion rates.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="project-card">
<div class="project-icon">
<i class="fas fa-sync-alt"></i>
</div>
<div class="project-content">
<h3 class="h5 teal-text">Enterprise Integration API</h3>
<p>Developed a sophisticated data integration API that enables seamless communication between Salesforce, Microsoft Dynamics, and other enterprise systems. Built on modern REST API standards with OAuth security, this solution eliminated data silos and reduced manual data entry.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="project-card">
<div class="project-icon">
<i class="fas fa-chart-pie"></i>
</div>
<div class="project-content">
<h3 class="h5 teal-text">AI Sales Analytics with Visie.ai</h3>
<p>Created a comprehensive sales analytics platform in partnership with <a href="https://visie.ai" target="_blank">Visie.ai</a> that evaluates historical data to generate interactive dashboards and predictive models. This collaborative solution helped our client identify emerging market trends and increase revenue forecasting accuracy by 40%.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="project-card">
<div class="project-icon">
<i class="fas fa-user-friends"></i>
</div>
<div class="project-content">
<h3 class="h5 teal-text">Custom CRM Solution</h3>
<p>Implemented Visie iQ, a custom CRM system that integrates with existing workflows, unifying customer data across departments. Features include AI-powered follow-ups, smart email reminders, team collaboration tools, and intelligent file management. The solution increased customer engagement and eliminated user pushback on CRM adoption.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="project-card">
<div class="project-icon">
<i class="fas fa-calculator"></i>
</div>
<div class="project-content">
<h3 class="h5 teal-text">Cost Analysis System</h3>
<p>Created a cost analysis system that evaluates part numbers based on customer profiles and purchasing patterns. This solution helped our client optimize pricing strategies, resulting in increased profit margins while maintaining competitive market positioning.</p>
</div>
</div>
</div>
</div>
<div class="text-center mt-5">
<p>Want to learn more about our work? Reach out and ask us!</p>
<a href="#contact" class="btn btn-primary btn-cta">Discuss Your Project</a>
</div>
</div>
</section>
<!-- Human + AI Section (New) -->
<section id="benefits" class="section section-dark">
<div class="container">
<div class="text-center mb-5">
<h2 class="display-5 fw-bold">Humans <span class="animated-gradient-text">+ AI</span>: Better Together</h2>
<p class="lead w-75 mx-auto">Our AI deployments focus on enhancing human capabilities, not replacing them.</p>
</div>
<div class="row align-items-center g-4">
<!-- Left column with image -->
<div class="col-lg-6">
<div class="soft-border-image">
<img src="assets/img/human-ai.png" alt="AI Solutions" class="img-fluid w-100">
</div>
</div>
<!-- Right column with benefit cards -->
<div class="col-lg-6">
<div class="row">
<div class="col-12">
<div class="benefit-card">
<h3 class="h5"><i class="fas fa-brain me-2 text-secondary"></i> AI Augments Human Intelligence</h3>
<p>Our solutions handle repetitive tasks and complex calculations, freeing your team to focus on creativity, strategy, and human connection.</p>
</div>
<div class="benefit-card">
<h3 class="h5"><i class="fas fa-handshake me-2 text-secondary"></i> Collaborative Systems</h3>
<p>We design AI tools that work alongside your team, providing suggestions and insights while keeping you in control of final decisions.</p>
</div>
<div class="benefit-card">
<h3 class="h5"><i class="fas fa-chart-line me-2 text-secondary"></i> Enhancing Human Performance</h3>
<p>Our AI solutions help your team work smarter by surfacing relevant information, automating routine tasks, and identifying opportunities.</p>
</div>
<div class="benefit-card">
<h3 class="h5"><i class="fas fa-graduation-cap me-2 text-secondary"></i> Continuous Learning</h3>
<p>Our systems learn from your team's expertise while helping them develop new skills and capabilities.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Benefits Section -->
<section class="section">
<div class="container">
<div class="text-center mb-5">
<h2 class="display-5 fw-bold">Unlock the Power of Your <span class="animated-gradient-text">Data</span></h2>
<p class="lead w-75 mx-auto">Our database solutions and AI-powered analytics transform your raw data into actionable insights that drive business growth.</p>
</div>
<div class="row g-4">
<div class="col-md-6">
<div class="benefit-card">
<h3 class="h5"><i class="fas fa-database me-2 text-secondary"></i> Intelligent Data Integration</h3>
<p>Connect and unify data from multiple sources with AI-powered ETL processes that ensure data quality and consistency across your organization.</p>
</div>
</div>
<div class="col-md-6">
<div class="benefit-card">
<h3 class="h5"><i class="fas fa-brain me-2 text-secondary"></i> Predictive Analytics</h3>
<p>Leverage machine learning models that analyze historical data patterns to forecast trends, identify risks, and uncover growth opportunities before they emerge.</p>
</div>
</div>
<div class="col-md-6">
<div class="benefit-card">
<h3 class="h5"><i class="fas fa-search me-2 text-secondary"></i> Natural Language Data Queries</h3>
<p>Enable anyone in your organization to extract insights using conversational AI interfaces that translate natural language questions into complex database queries.</p>
</div>
</div>
<div class="col-md-6">
<div class="benefit-card">
<h3 class="h5"><i class="fas fa-shield-alt me-2 text-secondary"></i> Intelligent Data Security</h3>
<p>Protect sensitive information with AI-powered anomaly detection that identifies unusual access patterns and potential security threats in real-time.</p>
</div>
</div>
</div>
</div>
</section>
<!-- About Section -->
<section id="about" class="section section-dark">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6 mb-4 mb-lg-0">
<h2 class="display-5 fw-bold mb-4">We Make <span class="animated-gradient-text">AI Practical</span> For Business</h2>
<p class="mb-4">At LekkerLogic, we bridge the gap between cutting-edge AI technology and real-world business applications. Our team of experts combines deep technical knowledge with business acumen to deliver solutions that drive measurable results.</p>
<p class="mb-4">We believe that artificial intelligence should enhance human capabilities, not replace them. Our mission is to create intuitive applications that solve real business problems and make your team more effective and profitable.</p>
<a href="#contact" class="btn btn-primary btn-cta">Work With Us</a>
</div>
<div class="col-lg-6">
<div class="card p-4">
<h3 class="h4 mb-4 lighter-text">Our Implementation Approach</h3>
<div class="d-flex align-items-start mb-3">
<div class="me-3 bg-primary rounded-circle d-flex align-items-center justify-content-center" style="width: 30px; height: 30px;">
<span class="text-white">1</span>
</div>
<div>
<h4 class="h6 mb-1 teal-text">Discovery & Assessment</h4>
<p class="small mb-0">We analyze your business processes to identify high-impact opportunities.</p>
</div>
</div>
<div class="d-flex align-items-start mb-3">
<div class="me-3 bg-primary rounded-circle d-flex align-items-center justify-content-center" style="width: 30px; height: 30px;">
<span class="text-white">2</span>
</div>
<div>
<h4 class="h6 mb-1 teal-text">Solution Design</h4>
<p class="small mb-0">Our experts design custom solutions tailored to your specific needs.</p>
</div>
</div>
<div class="d-flex align-items-start mb-3">
<div class="me-3 bg-primary rounded-circle d-flex align-items-center justify-content-center" style="width: 30px; height: 30px;">
<span class="text-white">3</span>
</div>
<div>
<h4 class="h6 mb-1 teal-text">Agile Implementation</h4>
<p class="small mb-0">We develop and deploy solutions through iterative cycles for faster results.</p>
</div>
</div>
<div class="d-flex align-items-start mb-3">
<div class="me-3 bg-primary rounded-circle d-flex align-items-center justify-content-center" style="width: 30px; height: 30px;">
<span class="text-white">4</span>
</div>
<div>
<h4 class="h6 mb-1 teal-text">Training & Integration</h4>
<p class="small mb-0">We ensure seamless integration with your existing systems and team adoption.</p>
</div>
</div>
<div class="d-flex align-items-start">
<div class="me-3 bg-primary rounded-circle d-flex align-items-center justify-content-center" style="width: 30px; height: 30px;">
<span class="text-white">5</span>
</div>
<div>
<h4 class="h6 mb-1 teal-text">Continuous Improvement</h4>
<p class="small mb-0">Our solutions evolve with your business. AI continuously learning and adapting.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact" class="section">
<div class="container">
<div class="row g-5">
<div class="col-lg-5 mb-4 mb-lg-0">
<span class="badge bg-secondary mb-2">Get In Touch</span>
<h2 class="display-5 fw-bold mb-4">Ready to <span class="animated-gradient-text">Transform</span> Your Business?</h2>
<p class="mb-4">Contact us today to schedule a consultation and discover how our solutions can help your team work smarter and more efficiently.</p>
<h5 class="mb-3 fw-bold">Solutions</h5>
<ul class="list-unstyled">
<li class="mb-2"><i class="fa-solid fa-circle-check me-2 text-secondary"></i>Web Applications</li>
<li class="mb-2"><i class="fa-solid fa-circle-check me-2 text-secondary"></i>AI Solutions</li>
<li class="mb-2"><i class="fa-solid fa-circle-check me-2 text-secondary"></i>CRM Systems</li>
<li class="mb-2"><i class="fa-solid fa-circle-check me-2 text-secondary"></i>Data Analytics</li>
<li class="mb-2"><i class="fa-solid fa-circle-check me-2 text-secondary"></i>ERP Systems</li>
<li class="mb-2"><i class="fa-solid fa-circle-check me-2 text-secondary"></i>MES Solutions</li>
<li class="mb-2"><i class="fa-solid fa-circle-check me-2 text-secondary"></i>Intelligent Reporting</li>
</ul>
</div>
<div class="col-lg-7">
<div class="card bg-darker p-4">
<h3 class="h4 mb-4">Send Us a Message</h3>
<form class="contact-form" method="post">
<div class="row g-3">
<div class="col-md-6">
<div class="mb-3">
<label for="nameInput" class="form-label">Your Name</label>
<input type="text" class="form-control" id="nameInput" name="nameInput" required>
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label for="emailInput" class="form-label">Your Email</label>
<input type="email" class="form-control" id="emailInput" name="emailInput" required>
</div>
</div>
<div class="col-12">
<div class="mb-3">
<label for="companyInput" class="form-label">Company Name</label>
<input type="text" class="form-control" id="companyInput" name="companyInput">
</div>
</div>
<div class="col-12">
<div class="mb-3">
<label for="serviceSelect" class="form-label">I'm Interested In</label>
<select class="form-select" id="serviceSelect" name="serviceSelect">
<option selected disabled value="">Select a service</option>
<option value="crm">CRM Systems</option>
<option value="analytics">Data Analytics</option>
<option value="erp">ERP Systems</option>
<option value="mes">Manufacturing Systems</option>
<option value="reporting">Intelligent Reporting</option>
<option value="custom">Custom AI Solution</option>
</select>
</div>
</div>
<div class="col-12">
<div class="mb-3">
<label for="messageTextarea" class="form-label">Your Message</label>
<textarea class="form-control" id="messageTextarea" name="messageTextarea" style="height: 150px" required></textarea>
</div>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary btn-cta w-100">Send Message</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="text-center text-lg-start">
<div class="container py-4">
<div class="row g-4">
<div class="col-lg-6 col-md-6">
<span class="animated-gradient-text h3"><i class="fa-solid fa-code"></i> { LekkerLogic }</span>
<p class="mt-3">Transforming businesses with practical solutions that enhance capabilities and drive efficiency, engagement, and growth.</p>
</div>
<div class="col-lg-6 col-md-12">
<h5 class="mb-3 fw-bold">Stay Updated</h5>
<p class="mb-3">Subscribe to our newsletter for the latest AI insights and company updates.</p>
<form id="newsletterForm" class="newsletter-form">
<div class="input-group mb-3">
<input type="email" name="email" class="form-control bg-dark text-light border-0" placeholder="Your Email" aria-label="Your Email" required>
<button class="btn btn-primary" type="submit">Subscribe</button>
</div>
<div id="newsletterMessage"></div>
</form>
</div>
</div>
</div>
<div class="text-center p-3" style="background-color: var(--darker)">
© 2025 LekkerLogic. All rights reserved.
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/code-typer.js"></script>
<script>
// Smooth scrolling for navigation links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
window.scrollTo({
top: target.offsetTop - 80,
behavior: 'smooth'
});
}
});
});
// Navbar color change on scroll
window.addEventListener('scroll', function() {
const navbar = document.querySelector('.navbar');
if (window.scrollY > 50) {
navbar.style.backgroundColor = 'rgba(10, 10, 10, 0.95) !important';
navbar.style.boxShadow = '0 2px 15px rgba(0, 0, 0, 0.5)';
} else {
navbar.style.backgroundColor = 'var(--darker) !important';
navbar.style.boxShadow = 'none';
}
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const contactForm = document.querySelector('.contact-form');
if (contactForm) {
contactForm.addEventListener('submit', function(event) {
event.preventDefault();
// Show loading indicator
const submitButton = contactForm.querySelector('button[type="submit"]');
const originalButtonText = submitButton.innerHTML;
submitButton.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span> Sending...';
submitButton.disabled = true;
// Get form data
const formData = new FormData(contactForm);
// Send AJAX request
fetch('php/process-form.php', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
// Create alert element
const alertElement = document.createElement('div');
alertElement.className = data.success ? 'alert alert-success' : 'alert alert-danger';
alertElement.role = 'alert';
alertElement.innerHTML = data.message;
// Insert alert before the form
contactForm.insertAdjacentElement('beforebegin', alertElement);
// Reset form if successful
if (data.success) {
contactForm.reset();
// Auto-hide success message after 5 seconds
setTimeout(() => {
alertElement.classList.add('fade');
setTimeout(() => alertElement.remove(), 500);
}, 5000);
}
// Restore button state
submitButton.innerHTML = originalButtonText;
submitButton.disabled = false;
// Scroll to the alert
alertElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
})
.catch(error => {
// Create error alert
const alertElement = document.createElement('div');
alertElement.className = 'alert alert-danger';
alertElement.role = 'alert';
alertElement.innerHTML = 'An error occurred. Please try again later.';
// Insert alert before the form
contactForm.insertAdjacentElement('beforebegin', alertElement);
// Restore button state
submitButton.innerHTML = originalButtonText;
submitButton.disabled = false;
console.error('Error:', error);
});
});
}
// Newsletter form submission
const newsletterForm = document.getElementById('newsletterForm');
if (newsletterForm) {
newsletterForm.addEventListener('submit', function(event) {
event.preventDefault();
// Show loading state
const submitButton = newsletterForm.querySelector('button[type="submit"]');
const originalButtonText = submitButton.innerHTML;
submitButton.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span> Subscribing...';
submitButton.disabled = true;
// Get form data
const formData = new FormData(newsletterForm);
// Send AJAX request
fetch('php/process-newsletter.php', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
// Show message
const messageDiv = document.getElementById('newsletterMessage');
messageDiv.className = data.success ? 'alert alert-success mt-3' : 'alert alert-danger mt-3';
messageDiv.textContent = data.message;
// Reset form if successful
if (data.success) {
newsletterForm.reset();
// Auto-hide success message after 5 seconds
setTimeout(() => {
messageDiv.style.display = 'none';
}, 5000);
}
// Restore button state
submitButton.innerHTML = originalButtonText;
submitButton.disabled = false;
})
.catch(error => {
// Show error message
const messageDiv = document.getElementById('newsletterMessage');
messageDiv.className = 'alert alert-danger mt-3';
messageDiv.textContent = 'An error occurred. Please try again later.';
// Restore button state
submitButton.innerHTML = originalButtonText;
submitButton.disabled = false;
console.error('Error:', error);
});
});
}
});
</script>
</body>
</html>