Skip to content

Commit

Permalink
Merge pull request #1327 from Vin205/main
Browse files Browse the repository at this point in the history
feat: Added Packaging List
  • Loading branch information
apu52 authored Aug 7, 2024
2 parents c46e904 + c3c40af commit 2eebf93
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 1 deletion.
204 changes: 204 additions & 0 deletions Pack.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hotel Booking Form</title>
<style>
body {
font-family: Arial, sans-serif;
background: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSAgEx3UTsYmOsw00pc-dRtsGkOEgFmS7ca-w&s")
no-repeat center fixed;
background-size: cover;
color: #333;
padding: 20px;
overflow-x: hidden; /* Prevent horizontal scrolling due to animations */
}

.container {
width: 80%;
margin: auto;
overflow: hidden;
}

h1, h2 {
text-align: center;
}

form {
background: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin-top: 20px;
}

label {
display: block;
margin-top: 10px;
}

input, select, button {
width: 100%;
padding: 10px;
margin-top: 5px;
margin-bottom: 10px;
border-radius: 5px;
border: 1px solid #ccc;
}

button {
background-color: #28a745;
color: #fff;
border: none;
cursor: pointer;
}

button:hover {
background-color: #218838;
}

.packing-list {
background: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin-top: 20px;
}

.packing-list ul {
list-style: none;
padding: 0;
}

.packing-list ul li {
background: #f4f4f4;
padding: 10px;
margin-bottom: 5px;
border-radius: 5px;
}
.home-button {
position: absolute;
top: 20px;
left: 20px;
background-color: #f60303;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
text-decoration: none;
}

.home-button:hover {
background-color: #f2444d;
color: rgb(8, 6, 6);
border: 1px solid black;
box-shadow: #070505;
box-shadow: 0 0 10px rgba(7, 6, 13, 0.9);
}

@media (max-width: 768px) {
.flex-item {
flex: 1 1 100%;
margin-right: 0;
}

input[type="submit"],
.btn-book {
margin-left: 0;
width: 100%;
text-align: center;
}
}
</style>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
</head>
<body>
<a href="index.html" class="home-button">Home</a>
<div class="container">
<h1>Customizable Packing List</h1>
<form id="packing-form">
<label for="trip-type">Type of Trip:</label>
<select id="trip-type" name="trip-type">
<option value="beach">Beach</option>
<option value="mountains">Mountains</option>
<option value="city">City</option>
<option value="international">International</option>
</select>

<label for="duration">Duration (days):</label>
<input type="number" id="duration" name="duration" min="1" max="30">

<label for="weather">Expected Weather:</label>
<select id="weather" name="weather">
<option value="hot">Hot</option>
<option value="cold">Cold</option>
<option value="moderate">Moderate</option>
</select>

<button type="submit">Generate Packing List</button>
</form>

<div id="packing-list" class="packing-list">
<h2>Your Packing List</h2>
<ul id="list"></ul>
</div>
</div>

<script>
document.getElementById('packing-form').addEventListener('submit', function(event) {
event.preventDefault();

const tripType = document.getElementById('trip-type').value;
const duration = parseInt(document.getElementById('duration').value, 10);
const weather = document.getElementById('weather').value;

const packingList = generatePackingList(tripType, duration, weather);
displayPackingList(packingList);
});

function generatePackingList(tripType, duration, weather) {
const commonItems = ['Toothbrush', 'Toothpaste', 'Shampoo', 'Conditioner', 'Body Wash', 'Deodorant', 'Underwear', 'Socks'];
const packingList = [...commonItems];

if (tripType === 'beach') {
packingList.push('Swimsuit', 'Sunscreen', 'Beach Towel', 'Flip Flops');
} else if (tripType === 'mountains') {
packingList.push('Hiking Boots', 'Jacket', 'Backpack', 'Map');
} else if (tripType === 'city') {
packingList.push('Comfortable Shoes', 'Guidebook', 'Camera', 'City Map');
} else if (tripType === 'international') {
packingList.push('Passport', 'Travel Adapter', 'Language Guide', 'Currency');
}

if (weather === 'hot') {
packingList.push('Sunglasses', 'Hat', 'Light Clothing');
} else if (weather === 'cold') {
packingList.push('Gloves', 'Scarf', 'Warm Clothing');
} else if (weather === 'moderate') {
packingList.push('Light Jacket', 'Comfortable Clothing');
}

for (let i = 0; i < duration; i++) {
packingList.push('Day ' + (i + 1) + ' Outfit');
}

return packingList;
}

function displayPackingList(packingList) {
const listElement = document.getElementById('list');
listElement.innerHTML = '';

packingList.forEach(item => {
const listItem = document.createElement('li');
listItem.textContent = item;
listElement.appendChild(listItem);
});
}
</script>

</body>
</html>
18 changes: 17 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,23 @@ <h3 style="color: rgb(151, 6, 241); font-style: italic;font-family: Cambria, Coc
</div>
</section>
<br /><br /><br /><br />

<!--Packaging List-->
<section class="hotel" id ="hotel">
<h2 class="tourist-heading section__title" align-items="center" data-aos="fade-in">Packaging List</h2>

<br></br>
<h3 style="color: rgb(9, 27, 186); font-style: italic;font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;">List for Trip</h3>
<br></br>
<div class="center-card">
<img src="./pack.jpg" alt="hr1"/>
<br>
<a class="btn btn-primary" href="./Pack.html" role="button" class="book__now btn-style" style="box-shadow: 2px 2px 8px red;">View Now</a>
<br>

</div>
</section>
<br /><br /><br /><br />
<br /><br /><br /><br />
<!-- Testimonials Section -->
<section id="testimo" class="testimo">
<h2 class="testimonial-heading section__title" align-items="center" data-aos="fade-in">Testimonials</h2>
Expand Down
Binary file added pack.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2eebf93

Please sign in to comment.