-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
140 lines (134 loc) · 6.86 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Allegro</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
</head>
<body>
<div class="logo-container">
<img src="logo2.png" alt="Allegro Logo" class="logo">
</div>
<div class="topnav">
<button onclick="openTab(event, 'viewOffers')" class="tablinks">View Offers</button>
<button onclick="openTab(event, 'createOffer')" class="tablinks">Create Offer</button>
<button onclick="location.href='login.html'" class="tablinks login-button">Login</button>
<button onclick="location.href='profile.html'" class="tablinks profile-button">Profile</button>
</div>
<div id="viewOffers" class="tab active">
<div class="instrument-filter">
<button onclick="filterByInstrument('Guitar')" class="filter-button">Guitar</button>
<button onclick="filterByInstrument('Piano')" class="filter-button">Piano</button>
<button onclick="filterByInstrument('Violin')" class="filter-button">Violin</button>
<button onclick="filterByInstrument('Drums')" class="filter-button">Drums</button>
<button onclick="filterByInstrument('Flute')" class="filter-button">Flute</button>
<button onclick="filterByInstrument('Saxophone')" class="filter-button">Saxophone</button>
<button onclick="filterByInstrument('Trumpet')" class="filter-button">Trumpet</button>
<button onclick="filterByInstrument('Cello')" class="filter-button">Cello</button>
<button onclick="filterByInstrument('Clarinet')" class="filter-button">Clarinet</button>
<button onclick="filterByInstrument('Trombone')" class="filter-button">Trombone</button>
<button onclick="filterByInstrument('Harp')" class="filter-button">Harp</button>
<button onclick="filterByInstrument('Accordion')" class="filter-button">Accordion</button>
<button onclick="filterByInstrument('Banjo')" class="filter-button">Banjo</button>
<button onclick="filterByInstrument('Xylophone')" class="filter-button">Xylophone</button>
<button id="toggleFiltersBtn" class="toggle-filters-button" onclick="toggleFilters()">
<i class="fas fa-filter"></i>
</button>
</div>
<div class="search-filters">
<label for="priceFilter">Max Price (€):</label>
<input type="number" id="priceFilter" name="priceFilter" min="0" oninput="applyFilters()">
<label for="sizeFilter">Size:</label>
<select id="sizeFilter" name="sizeFilter" onchange="applyFilters()">
<option value="">All Sizes</option>
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL">XL</option>
</select>
<label for="materialFilter">Material:</label>
<select id="materialFilter" name="materialFilter" onchange="applyFilters()">
<option value="">All Materials</option>
<option value="Wood">Wood</option>
<option value="Metal">Metal</option>
<option value="Leather">Leather</option>
<option value="Other">Other</option>
</select>
</div>
<div id="offerList">
<!-- Offers will be dynamically populated here -->
</div>
</div>
<div id="createOffer" class="tab">
<h2>Create New Offer</h2>
<form id="offerForm">
<label for="instrument">Instrument:</label>
<select id="instrument" name="instrument" required>
<option value="">Select an instrument</option>
<option value="Guitar">Guitar</option>
<option value="Piano">Piano</option>
<option value="Violin">Violin</option>
<option value="Drums">Drums</option>
<option value="Flute">Flute</option>
<option value="Saxophone">Saxophone</option>
<option value="Trumpet">Trumpet</option>
<option value="Cello">Cello</option>
<option value="Clarinet">Clarinet</option>
<option value="Trombone">Trombone</option>
<option value="Harp">Harp</option>
<option value="Accordion">Accordion</option>
<option value="Banjo">Banjo</option>
<option value="Xylophone">Xylophone</option>
</select><br>
<label for="size">Size:</label>
<select id="size" name="size" required>
<option value="">Select a Size</option>
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL">XL</option>
</select><br>
<label for="material">Material:</label>
<select id="material" name="material" required>
<option value="">Select a Material</option>
<option value="Wood">Wood</option>
<option value="Metal">Metal</option>
<option value="Leather">Leather</option>
<option value="Other">Other</option>
</select><br>
<label for="notes">Notes:</label><br>
<textarea id="notes" name="notes" rows="4" required></textarea><br>
<label for="price">Price (€):</label>
<input type="number" id="price" name="price" min="0" required><br>
<label for="loanDuration">Loan Duration (days):</label>
<input type="number" id="loanDuration" name="loanDuration" min="0" required><br>
<label for="image">Image:</label>
<input type="file" id="image" name="image" accept="image/*" required><br>
<input type="hidden" id="postedBy" name="postedBy"><!-- Hidden field for user name -->
<button type="submit">Create Offer</button>
</form>
</div>
<div id="detailsModal" class="details-modal">
<div class="modal-content">
<span class="close" onclick="closeModal()">×</span>
<h2>Offer Details</h2>
<div id="detailsContent"></div>
<button id="loanButtonModal" class="loan-button" onclick="loanOfferModal()">Loan</button>
</div>
</div>
<div id="paymentTab" class="tab">
<h2>Payment Successful!</h2>
<p>Thank you for your payment.</p>
</div>
<script src="script.js"></script>
<script>
// Load offers on window load
window.onload = function() {
loadOffers();
displayFilteredOffers(offers);
};
</script>
</body>
</html>