diff --git a/assets/images/header.jpg b/assets/images/header.jpg new file mode 100644 index 0000000..fb25929 Binary files /dev/null and b/assets/images/header.jpg differ diff --git a/assets/images/portfolio/1166644.jpg b/assets/images/portfolio/1166644.jpg new file mode 100644 index 0000000..31410d5 Binary files /dev/null and b/assets/images/portfolio/1166644.jpg differ diff --git a/assets/images/portfolio/2442888.jpg b/assets/images/portfolio/2442888.jpg new file mode 100644 index 0000000..3cf7a5d Binary files /dev/null and b/assets/images/portfolio/2442888.jpg differ diff --git a/assets/images/portfolio/373543.jpg b/assets/images/portfolio/373543.jpg new file mode 100644 index 0000000..7264b6a Binary files /dev/null and b/assets/images/portfolio/373543.jpg differ diff --git a/assets/images/portfolio/5584052.jpg b/assets/images/portfolio/5584052.jpg new file mode 100644 index 0000000..eed3889 Binary files /dev/null and b/assets/images/portfolio/5584052.jpg differ diff --git a/includes/pexels.php b/includes/pexels.php new file mode 100644 index 0000000..a12b74c --- /dev/null +++ b/includes/pexels.php @@ -0,0 +1,25 @@ + 0 ? $k : 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18'; + } + function pexels_get($url) { + $ch = curl_init(); + curl_setopt_array($ch, [ + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => [ 'Authorization: '. pexels_key() ], + CURLOPT_TIMEOUT => 15, + ]); + $resp = curl_exec($ch); + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + if ($code >= 200 && $code < 300 && $resp) return json_decode($resp, true); + return null; + } + function download_to($srcUrl, $destPath) { + $data = file_get_contents($srcUrl); + if ($data === false) return false; + if (!is_dir(dirname($destPath))) mkdir(dirname($destPath), 0775, true); + return file_put_contents($destPath, $data) !== false; + } diff --git a/index.php b/index.php index 6f7ffab..3f5054d 100644 --- a/index.php +++ b/index.php @@ -6,126 +6,289 @@ declare(strict_types=1); $phpVersion = PHP_VERSION; $now = date('Y-m-d H:i:s'); + +$message_sent = false; +$error_message = ''; + +if ($_SERVER["REQUEST_METHOD"] == "POST") { + require_once __DIR__ . '/mail/MailService.php'; + $name = trim($_POST['name'] ?? ''); + $email = trim($_POST['email'] ?? ''); + $message = trim($_POST['message'] ?? ''); + + if (empty($name) || empty($email) || empty($message)) { + $error_message = "Please fill in all fields."; + } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { + $error_message = "Invalid email format."; + } else { + $to = getenv('MAIL_TO') ?: 'your-email@example.com'; + $res = MailService::sendContactMessage($name, $email, $message, $to, 'Contact Form Submission'); + if (!empty($res['success'])) { + $message_sent = true; + } else { + $error_message = "Failed to send message. " . ($res['error'] ?? ''); + } + } +} ?> - New Style + John Doe - 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

+ +
+
+

John Doe

+

Creative Developer & Designer

+ Get in Touch
-
+ + +
+
+

Portfolio

+
+ "Project One", "description" => "A brief description of the project, its purpose, and the technologies used. Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "image" => $portfolio_images[0] ?? 'https://picsum.photos/seed/project1/600/400'], + ["name" => "Project Two", "description" => "A brief description of the project, its purpose, and the technologies used. Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "image" => $portfolio_images[1] ?? 'https://picsum.photos/seed/project2/600/400'], + ["name" => "Project Three", "description" => "A brief description of the project, its purpose, and the technologies used. Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "image" => $portfolio_images[2] ?? 'https://picsum.photos/seed/project3/600/400'] + ]; + + foreach ($projects as $project) { + ?> +
+ <?= htmlspecialchars($project['name']) ?> +
+

+

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

About Me

+

Hello! I'm John Doe, a passionate developer with a love for creating beautiful and functional web experiences. I have a background in both design and development, allowing me to build projects from concept to completion. I'm always eager to learn new technologies and take on challenging projects.

+
+
+ +
+
+

Testimonials

+
+

"Working with John was a fantastic experience. He is a true professional with a keen eye for detail. The final product exceeded all our expectations."

+ - Jane Smith, CEO of ExampleCorp +
+
+
+ +
+
+

Contact Me

+
+ +
Thank you for your message! I'll get back to you shortly.
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+ +
+

+ This is for testing purposes only — Flatlogic does not guarantee usage of the mail server. Please set up your own SMTP in .env (MAIL_/SMTP_ vars). +

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