Skip to content

Commit

Permalink
Merge pull request #1005 from Ibrangrd/buy_page_responsive
Browse files Browse the repository at this point in the history
Make buy page responsive
  • Loading branch information
ankit071105 authored Nov 6, 2024
2 parents 36054c1 + 4d84783 commit 2acbbd0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions buy.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@

<nav class="navbar">
<img src="https://ticket-booking-blue.vercel.app/images/4.jpeg" alt="" style="border-radius: 50%; height: 35px; width: 35px;">
<div class="logo" style="font-size: 20px;">Ticket Marketplace</div>
<div class="logo">Ticket Marketplace</div>

<!-- Toggle Button (Visible on Small Screens) -->
<button id="navToggle"></button>
Expand All @@ -332,7 +332,7 @@
</div>

<!-- Dark Mode Button -->
<button id="darkModeToggle" style="width: 40px; height: 40px;">🌙</button>
<button id="darkModeToggle">🌙</button>
</nav>


Expand Down Expand Up @@ -692,7 +692,7 @@ <h2>Book Your Ticket</h2>
const ticketList = type === 'bus' ? document.getElementById('busTicketsList') : document.getElementById('trainTicketsList');

if (filteredTickets.length === 0) {
ticketList.innerHTML = `<p>No ${type} tickets available.</p>`;
ticketList.innerHTML = <p>No ${type} tickets available.</p>;
} else {
filteredTickets.forEach(ticket => {
const ticketElement = document.createElement('div');
Expand All @@ -711,7 +711,7 @@ <h3>${type === 'bus' ? ticket.busName : 'Train Number: ' + ticket.trainNumber}</
}

function buyTicket(ticketNumber, type) {
alert(`You have successfully purchased the ${type} ticket: ${ticketNumber}`);
alert(`You have successfully purchased the ${type}` `ticket: ${ticketNumber}`);
}
</script>
<!-- footer -->
Expand Down
12 changes: 9 additions & 3 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,12 @@ p {
font-size: 20px;
cursor: pointer;
}

@media (max-width:480px)
{
#darkModeToggle{
margin-top: 20px;
}
}
/* Dark Mode CSS */
body.dark-mode {
background-color: #121212;
Expand Down Expand Up @@ -615,7 +620,8 @@ body.dark-mode .ticket-card button:hover {

@media (max-width: 500px) {
.navbar .logo {
font-size: 20px;
font-size: 15px;
margin-top: -15px;
}

.btn {
Expand Down Expand Up @@ -790,4 +796,4 @@ button:hover {
.faq-heading {
font-size: 20px;
}
}
}

0 comments on commit 2acbbd0

Please sign in to comment.