diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..e39f9bc --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,73 @@ + +body { + font-family: 'system-ui', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; + background-color: #F8F9FA; +} + +.navbar { + box-shadow: 0 2px 4px rgba(0,0,0,.05); +} + +.hero { + background: linear-gradient(135deg, #0D6EFD, #0dcaf0); + color: white; + padding: 6rem 0; + text-align: center; +} + +.hero h1 { + font-weight: 700; + font-size: 3.5rem; +} + +.hero p { + font-size: 1.25rem; + margin-bottom: 2rem; +} + +.btn-primary { + background-color: #0D6EFD; + border-color: #0D6EFD; + border-radius: 0.5rem; + padding: 0.75rem 1.5rem; + font-weight: 500; +} + +.section { + padding: 4rem 0; +} + +.feature-icon { + font-size: 3rem; + color: #0D6EFD; +} + +.card { + border: none; + border-radius: 0.5rem; + box-shadow: 0 4px 8px rgba(0,0,0,.05); + transition: transform .2s; +} + +.card:hover { + transform: translateY(-5px); +} + +#contact { + background-color: #FFFFFF; +} + +.footer { + background-color: #343A40; + color: white; + padding: 2rem 0; +} + +.footer a { + color: #adb5bd; + text-decoration: none; +} + +.footer a:hover { + color: white; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..bc96fdc --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,44 @@ + +document.addEventListener('DOMContentLoaded', function () { + const contactForm = document.getElementById('contactForm'); + if (contactForm) { + contactForm.addEventListener('submit', function (e) { + e.preventDefault(); + const form = e.target; + const formData = new FormData(form); + const alertContainer = document.getElementById('form-alerts'); + + alertContainer.innerHTML = ''; + + fetch('contact.php', { + method: 'POST', + body: formData + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + showAlert('success', 'Message sent successfully! We will get back to you shortly.'); + form.reset(); + } else { + showAlert('danger', 'An error occurred: ' + (data.error || 'Please try again.')); + } + }) + .catch(error => { + showAlert('danger', 'A network error occurred. Please try again.'); + console.error('Error:', error); + }); + }); + } + + function showAlert(type, message) { + const alertContainer = document.getElementById('form-alerts'); + const wrapper = document.createElement('div'); + wrapper.innerHTML = [ + `' + ].join(''); + alertContainer.append(wrapper); + } +}); diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..7a6c7fa --- /dev/null +++ b/contact.php @@ -0,0 +1,36 @@ + + false]; + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $name = isset($_POST['name']) ? trim($_POST['name']) : ''; + $email = isset($_POST['email']) ? trim($_POST['email']) : ''; + $message = isset($_POST['message']) ? trim($_POST['message']) : ''; + + if (!empty($name) && filter_var($email, FILTER_VALIDATE_EMAIL) && !empty($message)) { + // The 'to' address can be omitted to use the default from .env + // Or specified directly. For this example, we'll use a placeholder + // that should be configured in a real environment. + $to = getenv('MAIL_TO') ?: 'support@yourdomain.com'; + $subject = 'New Contact Form Submission'; + + $mailResult = MailService::sendContactMessage($name, $email, $message, $to, $subject); + + if (!empty($mailResult['success'])) { + $response['success'] = true; + } else { + $response['error'] = $mailResult['error'] ?? 'Failed to send email.'; + // In a real app, you would log this error. + // error_log('MailService Error: ' . $response['error']); + } + } else { + $response['error'] = 'Invalid input. Please fill out all fields correctly.'; + } +} else { + $response['error'] = 'Invalid request method.'; +} + +echo json_encode($response); diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..bf526e1 --- /dev/null +++ b/footer.php @@ -0,0 +1,16 @@ + + + + + + + diff --git a/header.php b/header.php new file mode 100644 index 0000000..b8b6f75 --- /dev/null +++ b/header.php @@ -0,0 +1,30 @@ + + + + + + + <?php echo htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'Price Comparison App'); ?> + + + + + + + + + diff --git a/index.php b/index.php index 7205f3d..c1093ee 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,90 @@ - -$phpVersion = PHP_VERSION; -$now = date('Y-m-d H:i:s'); -?> - - - - - - New Style - - - - - - - - - - - - - - - - - - - - - -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ +
+
+

PricePal SA

+

Your smart shopping companion for comparing prices across South African retailers.

+ + Download on Google Play +
-
- - - + + + +
+
+
+

Why You'll Love PricePal

+

All the features you need for smarter shopping.

+
+
+ +
+
+
+
Instant Search
+

Get mock price comparisons from top retailers with a single tap.

+
+
+ +
+
+
+
Retailer Selection
+

Start with 2 default retailers and expand to see more options.

+
+
+ +
+
+
+
Save Favorites
+

Keep a list of your favorite products for quick price checks anytime.

+
+
+ +
+
+
+
Ethical & Transparent
+

Clear disclaimers about our mock data usage on every search.

+
+
+
+
+
+ + +
+
+
+
+
+

Get In Touch

+

Have questions or feedback? We'd love to hear from you.

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/legal.php b/legal.php new file mode 100644 index 0000000..a912029 --- /dev/null +++ b/legal.php @@ -0,0 +1,19 @@ + + + +
+

Legal & Disclaimer

+
+

This application is for demonstration purposes only. The data presented is mock data and does not represent real-time prices from any retailer.

+ +

Data Sourcing

+

All product and pricing information displayed within this application is generated randomly and is not sourced from Pick n Pay, Woolworths, Checkers, Game, Makro, or any other retailer. Any resemblance to actual products or prices is purely coincidental.

+ +

Ethical Considerations

+

We are committed to ethical practices. This application is designed as a proof-of-concept and should not be used for making actual purchasing decisions. We respect the intellectual property and business operations of all retailers.

+ +

Limitation of Liability

+

The developers and owners of this application shall not be held liable for any decisions made based on the information presented herein. Users are advised to consult official retailer websites for accurate and up-to-date pricing.

+
+ + diff --git a/privacy.php b/privacy.php new file mode 100644 index 0000000..ee2775b --- /dev/null +++ b/privacy.php @@ -0,0 +1,26 @@ + + + +
+

Privacy Policy

+
+

Your privacy is important to us. It is our policy to respect your privacy regarding any information we may collect from you across our application.

+ +

Information We Collect

+

We only ask for personal information when we truly need it to provide a service to you. For the contact form, we collect your name and email address to respond to your inquiry. For saved favorite products, the data is stored locally on your device and is not transmitted to our servers.

+ +

Use of Information

+

We use the collected information to:

+ + +

Data Storage

+

We only retain collected information for as long as necessary to provide you with your requested service. What data we store, we’ll protect within commercially acceptable means to prevent loss and theft, as well as unauthorized access, disclosure, copying, use or modification.

+ +

Third Parties

+

We do not share any personally identifying information publicly or with third-parties, except when required to by law.

+
+ + diff --git a/terms.php b/terms.php new file mode 100644 index 0000000..a7c20b9 --- /dev/null +++ b/terms.php @@ -0,0 +1,19 @@ + + + +
+

Terms of Service

+
+

By using this application, you are agreeing to be bound by these terms of service, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws.

+ +

1. Use License

+

Permission is granted to temporarily download one copy of the materials (information or software) on this application for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title.

+ +

2. Disclaimer

+

The materials on this application are provided on an 'as is' basis. We make no warranties, expressed or implied, and hereby disclaim and negate all other warranties including, without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights.

+ +

3. Limitations

+

In no event shall the application owners or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials on this application.

+
+ +