From 1023524f8cb533276db43f30e88ae31728fa3afb Mon Sep 17 00:00:00 2001 From: Drushya-jolly <160266129+Drushya-jolly@users.noreply.github.com> Date: Sat, 8 Feb 2025 19:46:16 +0530 Subject: [PATCH 1/4] Add files via upload --- index.html | 41 +++++++++++++++++++++ script.js | 91 +++++++++++++++++++++++++++++++++++++++++++++++ styles.css | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 index.html create mode 100644 script.js create mode 100644 styles.css diff --git a/index.html b/index.html new file mode 100644 index 000000000..7c00ab4cc --- /dev/null +++ b/index.html @@ -0,0 +1,41 @@ + + + + + + AI Travel Itinerary Planner + + + + +
+

AI Travel Itinerary Planner

+
+ +
+

Select Your Destination

+ + +

Enter Your Budget

+ + + +
+ +
+

Your AI-Generated Itinerary

+
+ +
+
+ + + + + + diff --git a/script.js b/script.js new file mode 100644 index 000000000..d71b6b8b6 --- /dev/null +++ b/script.js @@ -0,0 +1,91 @@ +const destinationData = { + "Paris": { + activities: [ + { name: "Eiffel Tower Visit", cost: 30 }, + { name: "Louvre Museum", cost: 20 }, + { name: "Seine River Cruise", cost: 50 } + ], + accommodations: [ + { name: "Budget Hotel", costPerNight: 100 }, + { name: "Mid-range Hotel", costPerNight: 200 }, + { name: "Luxury Hotel", costPerNight: 400 } + ] + }, + "New York": { + activities: [ + { name: "Statue of Liberty", cost: 25 }, + { name: "Central Park", cost: 0 }, + { name: "Broadway Show", cost: 100 } + ], + accommodations: [ + { name: "Budget Hostel", costPerNight: 50 }, + { name: "Mid-range Hotel", costPerNight: 150 }, + { name: "Luxury Hotel", costPerNight: 350 } + ] + }, + "Tokyo": { + activities: [ + { name: "Shibuya Crossing", cost: 0 }, + { name: "Tokyo Tower", cost: 15 }, + { name: "Senso-ji Temple", cost: 0 } + ], + accommodations: [ + { name: "Capsule Hotel", costPerNight: 40 }, + { name: "Business Hotel", costPerNight: 100 }, + { name: "Luxury Hotel", costPerNight: 300 } + ] + } +}; + +// Function to generate the AI-driven itinerary +function generateItinerary() { + const destination = document.getElementById('destination').value; + const budget = parseFloat(document.getElementById('budget').value); + + if (!destination || isNaN(budget) || budget <= 0) { + alert("Please enter a valid destination and budget."); + return; + } + + // Check if the destination is in the predefined data + const data = destinationData[destination]; + if (!data) { + alert("Sorry, we don't have data for this destination."); + return; + } + + // Suggest activities based on the budget + let activities = data.activities.filter(activity => activity.cost <= budget); + let accommodations = data.accommodations.filter(acc => acc.costPerNight <= budget / 3); // Assume a 3-night stay + + // Generate itinerary summary + let itinerarySummary = ` +

Destination: ${destination}

+

Activities (within your budget):

+ +

Accommodation Options (within your budget):

+ +

Suggested Itinerary:

+ + `; + + // Display the generated itinerary + document.getElementById('itinerary-summary').innerHTML = itinerarySummary; +} + +// Export function to PDF +function exportItinerary() { + const { jsPDF } = window.jspdf; + const doc = new jsPDF(); + + const itineraryContent = document.getElementById('itinerary-summary').innerText; + doc.text(itineraryContent, 10, 10); + doc.save('itinerary.pdf'); +} diff --git a/styles.css b/styles.css new file mode 100644 index 000000000..9775d7354 --- /dev/null +++ b/styles.css @@ -0,0 +1,102 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + color: #333; + margin: 0; + padding: 0; +} + +header { + background-color: #4CAF50; + color: white; + text-align: center; + padding: 20px 0; +} + +h1 { + margin: 0; +} + +h2 { + font-size: 1.5rem; + margin-top: 0; + color: #444; +} + +h3 { + font-size: 1.2rem; + margin-bottom: 10px; +} + +h4 { + font-size: 1rem; + color: #555; +} + +.form-container { + background-color: white; + padding: 20px; + margin: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +input[type="text"], +input[type="number"] { + width: 100%; + padding: 10px; + margin: 10px 0; + border-radius: 4px; + border: 1px solid #ddd; +} + +button { + background-color: #4CAF50; + color: white; + border: none; + padding: 10px 20px; + cursor: pointer; + border-radius: 4px; + font-size: 1rem; + margin-top: 10px; +} + +button:hover { + background-color: #45a049; +} + +#itinerary-view { + margin: 20px; + background-color: white; + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +ul { + list-style-type: none; + padding: 0; +} + +ul li { + padding: 5px 0; + font-size: 1rem; +} + +ul li:nth-child(even) { + background-color: #f9f9f9; +} + +button:active { + transform: scale(0.98); +} + +footer { + text-align: center; + padding: 10px; + background-color: #4CAF50; + color: white; + position: fixed; + bottom: 0; + width: 100%; +} From 314a57fd4f88a4eef99b50ef1a9ae145aa8bb741 Mon Sep 17 00:00:00 2001 From: Drushya-jolly <160266129+Drushya-jolly@users.noreply.github.com> Date: Sat, 8 Feb 2025 19:49:43 +0530 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79f19266d..43f690330 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [Project Name] 🎯 +# DestINo 🎯 ## Basic Details From cb0e77c0af68fc69db9aeaa8ec81fe23e5deea46 Mon Sep 17 00:00:00 2001 From: Drushya-jolly <160266129+Drushya-jolly@users.noreply.github.com> Date: Sat, 8 Feb 2025 21:32:43 +0530 Subject: [PATCH 3/4] Update index.html (#1) --- index.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 7c00ab4cc..12771891a 100644 --- a/index.html +++ b/index.html @@ -19,19 +19,25 @@

Select Your Destination

+ + + +

Enter Your Budget

+

Select Your Trip Dates

+ + +

Your AI-Generated Itinerary

-
- -
+
From ce8b8663be8ef9d2f09dc02198a180282d8618ca Mon Sep 17 00:00:00 2001 From: Drushya-jolly <160266129+Drushya-jolly@users.noreply.github.com> Date: Sat, 8 Feb 2025 21:35:35 +0530 Subject: [PATCH 4/4] Update styles.css --- styles.css | 87 +++++++++++------------------------------------------- 1 file changed, 17 insertions(+), 70 deletions(-) diff --git a/styles.css b/styles.css index 9775d7354..7ddab4139 100644 --- a/styles.css +++ b/styles.css @@ -1,102 +1,49 @@ body { font-family: Arial, sans-serif; - background-color: #f4f4f4; - color: #333; margin: 0; padding: 0; + text-align: center; + background-color: #f4f4f4; } header { - background-color: #4CAF50; + background-color: #3498db; color: white; - text-align: center; - padding: 20px 0; -} - -h1 { - margin: 0; -} - -h2 { - font-size: 1.5rem; - margin-top: 0; - color: #444; -} - -h3 { - font-size: 1.2rem; - margin-bottom: 10px; -} - -h4 { - font-size: 1rem; - color: #555; + padding: 15px; } .form-container { - background-color: white; + background: white; padding: 20px; - margin: 20px; + width: 50%; + margin: 20px auto; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } -input[type="text"], -input[type="number"] { - width: 100%; +input, select, button { + margin: 10px; padding: 10px; - margin: 10px 0; - border-radius: 4px; - border: 1px solid #ddd; + width: 80%; + font-size: 16px; } button { - background-color: #4CAF50; + background-color: #3498db; color: white; border: none; - padding: 10px 20px; cursor: pointer; - border-radius: 4px; - font-size: 1rem; - margin-top: 10px; } button:hover { - background-color: #45a049; + background-color: #2980b9; } -#itinerary-view { - margin: 20px; - background-color: white; +#itinerary-summary { + background: white; padding: 20px; + margin: 20px auto; + width: 50%; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } - -ul { - list-style-type: none; - padding: 0; -} - -ul li { - padding: 5px 0; - font-size: 1rem; -} - -ul li:nth-child(even) { - background-color: #f9f9f9; -} - -button:active { - transform: scale(0.98); -} - -footer { - text-align: center; - padding: 10px; - background-color: #4CAF50; - color: white; - position: fixed; - bottom: 0; - width: 100%; -}