diff --git a/assets/cache/pexels_auli.json b/assets/cache/pexels_auli.json new file mode 100644 index 0000000..e1ea061 --- /dev/null +++ b/assets/cache/pexels_auli.json @@ -0,0 +1 @@ +{"local_url":"assets\/images\/destinations\/pexels-9963746.jpg","alt":"Scenic landscape of Auli, India with snowy mountains and a serene lake in winter.","photographer":"Kushal Verma","photographer_url":"https:\/\/www.pexels.com\/@kushal-verma-123877130"} \ No newline at end of file diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..ace7886 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,56 @@ + +@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Roboto:wght@400;500&display=swap'); + +body { + font-family: 'Roboto', sans-serif; + background-color: #F8F9FA; + color: #212529; +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Playfair Display', serif; +} + +.hero { + background: linear-gradient(rgba(13, 110, 253, 0.1), rgba(0, 198, 255, 0.1)), url('https://picsum.photos/1600/900') no-repeat center center; + background-size: cover; + height: 100vh; + color: white; +} + +.hero .display-4 { + font-size: 4.5rem; + font-weight: 700; +} + +.btn-primary { + background-color: #0D6EFD; + border-color: #0D6EFD; + border-radius: 0.75rem; + padding: 0.75rem 1.5rem; + transition: all 0.3s ease; +} + +.btn-primary:hover { + transform: translateY(-2px); + box-shadow: 0 4px 8px rgba(0,0,0,0.1); +} + +.section { + padding: 6rem 0; +} + +.card { + border: none; + border-radius: 0.75rem; + box-shadow: 0 4px 12px rgba(0,0,0,0.05); +} + +.navbar { + transition: background-color 0.3s ease; +} + +.navbar.scrolled { + background-color: rgba(255, 255, 255, 0.9); + box-shadow: 0 2px 4px rgba(0,0,0,0.05); +} diff --git a/assets/images/destinations/pexels-9963746.jpg b/assets/images/destinations/pexels-9963746.jpg new file mode 100644 index 0000000..fede87c Binary files /dev/null and b/assets/images/destinations/pexels-9963746.jpg differ diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..b10b96e --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,41 @@ + +document.addEventListener('DOMContentLoaded', function () { + // Navbar scroll effect + const navbar = document.querySelector('.navbar'); + window.addEventListener('scroll', () => { + if (window.scrollY > 50) { + navbar.classList.add('scrolled'); + } else { + navbar.classList.remove('scrolled'); + } + }); + + // Smooth scrolling for anchor links + document.querySelectorAll('a[href^="#"]').forEach(anchor => { + anchor.addEventListener('click', function (e) { + e.preventDefault(); + document.querySelector(this.getAttribute('href')).scrollIntoView({ + behavior: 'smooth' + }); + }); + }); + + // Contact form validation + const form = document.querySelector('.contact-form'); + form.addEventListener('submit', function (e) { + e.preventDefault(); + // Basic validation + const name = form.querySelector('#name').value; + const email = form.querySelector('#email').value; + const message = form.querySelector('#message').value; + + if (name === '' || email === '' || message === '') { + alert('Please fill out all fields.'); + return; + } + + // On success + alert('Thank you for your message!'); + form.reset(); + }); +}); diff --git a/includes/pexels.php b/includes/pexels.php new file mode 100644 index 0000000..0595391 --- /dev/null +++ b/includes/pexels.php @@ -0,0 +1,40 @@ + 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 => 20, + CURLOPT_USERAGENT => 'Flatlogic/Gemini-CLI' + ]); + $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) { + if (!is_dir(dirname($destPath))) { + mkdir(dirname($destPath), 0775, true); + } + + $ch = curl_init($srcUrl); + $fp = fopen($destPath, 'wb'); + curl_setopt($ch, CURLOPT_FILE, $fp); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_TIMEOUT, 60); + $result = curl_exec($ch); + curl_close($ch); + fclose($fp); + + return $result !== false; +} diff --git a/index.php b/index.php index 7205f3d..4ca078a 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,203 @@ 'https://via.placeholder.com/1200x800.png?text=Auli,+India', // Fallback + 'alt' => 'A beautiful landscape of Auli, India', + 'photographer' => 'N/A', + 'photographer_url' => '#', +]; + +// Path for the cached JSON data +$cache_file = __DIR__ . '/assets/cache/pexels_auli.json'; +$cache_ttl = 86400; // Cache for 24 hours + +$image_data = null; + +if (file_exists($cache_file) && (time() - filemtime($cache_file)) < $cache_ttl) { + $image_data = json_decode(file_get_contents($cache_file), true); +} else { + $url = 'https://api.pexels.com/v1/search?query=' . urlencode($destination_query) . '&orientation=landscape&per_page=1&page=1'; + $api_data = pexels_get($url); + + if ($api_data && !empty($api_data['photos'])) { + $photo = $api_data['photos'][0]; + $src = $photo['src']['large2x'] ?? $photo['src']['large'] ?? $photo['src']['original']; + $filename = 'pexels-' . $photo['id'] . '.jpg'; + $targetDir = __DIR__ . '/assets/images/destinations/'; + $targetPath = $targetDir . $filename; + $localUrl = 'assets/images/destinations/' . $filename; + + if (!file_exists($targetPath)) { + download_to($src, $targetPath); + } + + if (file_exists($targetPath)) { + $image_data = [ + 'local_url' => $localUrl, + 'alt' => $photo['alt'] ?? 'Image of ' . $destination_query, + 'photographer' => $photo['photographer'] ?? 'Unknown', + 'photographer_url' => $photo['photographer_url'] ?? '#', + ]; + + // Cache the data + if (!is_dir(dirname($cache_file))) mkdir(dirname($cache_file), 0775, true); + file_put_contents($cache_file, json_encode($image_data)); + } + } +} + +if ($image_data) { + $destination_image = $image_data; +} ?> - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + TripEase + + + + + + + + + + -
-
-

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

-
-
- + + + + + +
+
+

Plan. Share. Explore.

+

Your next adventure starts here. Discover, plan, and share your travels with a community of wanderers.

+ Explore Trips +
+
+ + +
+
+
+
+ A group of friends laughing and planning a trip together. +
+
+

About TripEase

+

TripEase is more than just a travel app; it's a community-driven platform designed to inspire and empower travelers. From finding your next destination to planning every detail and sharing your experiences, we provide the tools you need to make every trip unforgettable.

+
+
+
+
+ + +
+
+

Destination of the Month

+

Discover Auli, India - a Himalayan ski resort and hill station.

+
+
+
+ <?php echo htmlspecialchars($destination_image['alt']); ?> +
+
Auli, India
+

With its pristine slopes and stunning mountain views, Auli is a paradise for skiers and nature lovers alike. Photo by on Pexels.

+
+
+
+
+
+
+ + +
+
+

What Our Travelers Say

+
+
+
+

"TripEase made planning our group trip a breeze. The collaborative features are a game-changer!"

+
Jane Doe
+
+
+
+
+

"I love the travel style quiz! The recommendations were spot on and introduced me to places I wouldn't have found otherwise."

+
John Smith
+
+
+
+
+

"The community is so inspiring. I've discovered so many hidden gems through other travelers' stories."

+ +
+
+
+
+
+ + +
+
+

Get in Touch

+
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+ + + + + + diff --git a/privacy.php b/privacy.php new file mode 100644 index 0000000..f5336f3 --- /dev/null +++ b/privacy.php @@ -0,0 +1,16 @@ + + + + + + Privacy Policy - TripEase + + + +
+

Privacy Policy

+

This is a placeholder for the privacy policy.

+ Back to Home +
+ +