-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdonate.html
More file actions
217 lines (209 loc) · 10.6 KB
/
donate.html
File metadata and controls
217 lines (209 loc) · 10.6 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Donate Parts - IGNITE Part Share</title>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
<!-- Navigation Bar -->
<nav class="navbar">
<div class="nav-container">
<div class="nav-logo">
<i class="fas fa-robot"></i>
<span>IGNITE Part Share</span>
</div>
<ul class="nav-menu">
<li class="nav-item">
<a href="index.html" class="nav-link">Home</a>
</li>
<li class="nav-item auth-required" style="display: none;">
<a href="donate.html" class="nav-link active">Donate Parts</a>
</li>
<li class="nav-item auth-required" style="display: none;">
<a href="request.html" class="nav-link">Request Parts</a>
</li>
<li class="nav-item auth-required" style="display: none;">
<a href="browse.html" class="nav-link">Browse Parts</a>
</li>
<li class="nav-item">
<a href="leaderboard.html" class="nav-link">Leaderboard</a>
</li>
<li class="nav-item">
<a href="contact.html" class="nav-link">Contact</a>
</li>
</ul>
<div class="user-menu">
<a href="profile.html" class="profile-link">
<i class="fas fa-user"></i>
Profile
</a>
<button class="logout-btn" onclick="signOut()">Logout</button>
</div>
<div class="login-btn">
<a href="login.html" class="btn btn-primary">Login</a>
</div>
<div class="hamburger">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</div>
</div>
</nav>
<!-- Page Header -->
<section class="page-header">
<div class="container">
<h1 class="page-title">Donate Parts</h1>
<p class="page-subtitle">Share your surplus parts with teams in need</p>
<p class="page-organization">A project of <a href="https://www.ignitepathways.org/" target="_blank" rel="noopener noreferrer" class="ignite-link">IGNITE Pathways</a></p>
</div>
</section>
<!-- Donate Section -->
<section class="section">
<div class="container">
<div class="donate-content">
<div class="donate-form">
<form>
<div class="form-group">
<label for="team-number">Team Number</label>
<input type="text" id="team-number" placeholder="e.g., 1234" required>
</div>
<div class="form-group">
<label for="part-name">Part Name</label>
<input type="text" id="part-name" placeholder="e.g., REV HD Hex Motor">
</div>
<div class="form-group">
<label for="part-category">Category</label>
<select id="part-category">
<option value="">Select Category</option>
<option value="motors">Motors</option>
<option value="sensors">Sensors</option>
<option value="electronics">Electronics</option>
<option value="mechanical">Mechanical</option>
<option value="tools">Tools</option>
</select>
</div>
<div class="form-group">
<label for="part-condition">Condition</label>
<select id="part-condition">
<option value="">Select Condition</option>
<option value="new">New</option>
<option value="like-new">Like New</option>
<option value="good">Good</option>
<option value="fair">Fair</option>
</select>
</div>
<div class="form-group">
<label for="part-description">Description</label>
<textarea id="part-description" placeholder="Describe the part, any issues, etc."></textarea>
</div>
<div class="form-group">
<label for="part-image">Part Image</label>
<div class="image-upload-container">
<input type="file" id="part-image" accept="image/*" class="image-upload-input">
<div class="image-upload-area" id="image-upload-area">
<i class="fas fa-camera"></i>
<p>Click to upload or drag image here</p>
<span class="image-upload-hint">Supports: JPG, PNG, GIF (Max 5MB)</span>
</div>
<div class="image-preview" id="image-preview" style="display: none;">
<img id="preview-img" src="" alt="Part preview">
<button type="button" class="remove-image-btn" onclick="removeImage()">
<i class="fas fa-times"></i>
</button>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Donate Part</button>
</form>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="footer-content">
<div class="footer-section">
<h3>IGNITE Part Share</h3>
<p>Building a stronger FIRST community through part sharing and collaboration.</p>
<p>A project of <a href="https://www.ignitepathways.org/" target="_blank" rel="noopener noreferrer" class="ignite-link">IGNITE Pathways</a></p>
</div>
<div class="footer-section">
<h4>Quick Links</h4>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="donate.html">Donate</a></li>
<li><a href="request.html">Request</a></li>
<li><a href="browse.html">Browse</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Legal</h4>
<ul>
<li><a href="terms.html">Terms of Service</a></li>
<li><a href="privacy.html">Privacy Policy</a></li>
<li><a href="disclaimer.html">Disclaimer</a></li>
<li><a href="cookies.html">Cookie Policy</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Connect</h4>
<div class="social-links">
<a href="https://www.ignitepathways.org/" target="_blank" rel="noopener noreferrer" title="IGNITE Pathways"><i class="fas fa-globe"></i></a>
<a href="#" onclick="openSocialMedia('Twitter')"><i class="fab fa-twitter"></i></a>
<a href="#" onclick="openSocialMedia('Facebook')"><i class="fab fa-facebook"></i></a>
<a href="#" onclick="openSocialMedia('Instagram')"><i class="fab fa-instagram"></i></a>
<a href="#" onclick="openDiscord()"><i class="fab fa-discord"></i></a>
</div>
</div>
</div>
<div class="footer-bottom">
<p>© 2024 IGNITE Part Share. All rights reserved. | <a href="terms.html">Terms</a> | <a href="privacy.html">Privacy</a> | <a href="disclaimer.html">Disclaimer</a></p>
</div>
</div>
</footer>
<!-- Firebase SDK -->
<script src="https://www.gstatic.com/firebasejs/9.0.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.0/firebase-auth-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.0/firebase-firestore-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.0/firebase-storage-compat.js"></script>
<!-- Firebase Config -->
<script src="firebase-config.js"></script>
<!-- Auth Script -->
<script src="auth.js"></script>
<script src="script.js"></script>
<script>
// Check authentication on page load
document.addEventListener('DOMContentLoaded', function() {
let authChecked = false;
// Wait for auth to be initialized and check auth state
const checkAuth = () => {
if (typeof auth !== 'undefined') {
// Listen for auth state changes
auth.onAuthStateChanged(function(user) {
if (authChecked) return; // Prevent multiple checks
authChecked = true;
if (user) {
console.log('User authenticated, access granted to donate page');
// User is authenticated, allow access
} else {
console.log('No user authenticated, redirecting to login');
showMessage('Please log in to access this feature', 'error');
window.location.href = 'login.html';
}
});
} else {
// Auth not ready yet, wait a bit
setTimeout(checkAuth, 100);
}
};
checkAuth();
});
</script>
</body>
</html>