diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..edc662b --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,29 @@ +body { + font-family: 'Roboto', sans-serif; +} + +h1, h2, h3, h4, h5, h6, .navbar-brand, .nav-link { + font-family: 'Poppins', sans-serif; +} + +.nav-link { + transition: color 0.3s ease; +} + +.nav-link:hover, .nav-link.active { + color: #0d6efd !important; +} + +section { + padding-top: 5rem; + padding-bottom: 5rem; +} + +#intro { + padding-top: 8rem; +} + +.card-img-top { + aspect-ratio: 3 / 2; + object-fit: cover; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..386bb5e --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,52 @@ +document.addEventListener('DOMContentLoaded', function () { + const contactForm = document.getElementById('contact-form'); + const contactAlert = document.getElementById('contact-alert'); + + if (contactForm) { + contactForm.addEventListener('submit', function (e) { + e.preventDefault(); + + const formData = new FormData(contactForm); + const button = contactForm.querySelector('button[type="submit"]'); + const originalButtonText = button.innerHTML; + + button.disabled = true; + button.innerHTML = ' Sending...'; + + fetch('contact.php', { + method: 'POST', + body: formData + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + contactAlert.innerHTML = ``; + contactForm.reset(); + } else { + contactAlert.innerHTML = ``; + } + }) + .catch(error => { + contactAlert.innerHTML = ``; + }) + .finally(() => { + button.disabled = false; + button.innerHTML = originalButtonText; + }); + }); + } + + // Activate scrollspy + var scrollSpy = new bootstrap.ScrollSpy(document.body, { + target: '#navbar' + }); +}); diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..d24acce --- /dev/null +++ b/contact.php @@ -0,0 +1,36 @@ + false, 'message' => 'Please fill in all fields.']; + } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { + $response = ['success' => false, 'message' => 'Please provide a valid email address.']; + } else { + // The recipient email address. If MAIL_TO is not set, it will fall back to MAIL_FROM. + // It's recommended to set MAIL_TO in your .env file. + $to = getenv('MAIL_TO') ?: null; + $subject = 'New Contact Form Submission from ' . $name; + + $mailResult = MailService::sendContactMessage($name, $email, $message, $to, $subject); + + if (!empty($mailResult['success'])) { + $response = ['success' => true, 'message' => 'Your message has been sent successfully!']; + } else { + error_log('MailService Error: ' . ($mailResult['error'] ?? 'Unknown error')); + $response = ['success' => false, 'message' => 'Sorry, there was an error sending your message. Please try again later.']; + } + } +} else { + $response = ['success' => false, 'message' => 'Invalid request method.']; +} + +echo json_encode($response); diff --git a/index.php b/index.php index 7205f3d..8790721 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,157 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + <?php echo htmlspecialchars(getenv('PROJECT_NAME') ?: 'Personal Portfolio'); ?> + + + + + + + + + + + + + + + - -
-
-

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

-
-
- + + + + +
+
+
+
+
+

Welcome to My Digital Space

+

I build beautiful and functional web experiences. Explore my work and let's create something amazing together.

+ Get In Touch + View My Work +
+
+
+
+ +
+
+
+

Portfolio

+

A selection of my recent projects.

+
+
+ +
+
+ Project 1 +
+
Project Title 1
+

A brief description of the project, the technologies used, and the outcome.

+ View Details +
+
+
+ +
+
+ Project 2 +
+
Project Title 2
+

A brief description of the project, the technologies used, and the outcome.

+ View Details +
+
+
+ +
+
+ Project 3 +
+
Project Title 3
+

A brief description of the project, the technologies used, and the outcome.

+ View Details +
+
+
+
+
+
+ +
+
+
+
+ About Me +
+
+
+

About Me

+

I am a passionate developer with a knack for creating elegant solutions in the least amount of time.

+

My background is in computer science, and I have several years of experience building web applications for a variety of clients. I specialize in front-end development but am also proficient in back-end technologies.

+

When I'm not coding, I enjoy hiking, photography, and exploring new coffee shops.

+
+
+
+
+
+ +
+
+
+

Contact Me

+

Have a project in mind? I'd love to hear from you.

+
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+
+ + + + + - + \ No newline at end of file