-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload.html
More file actions
244 lines (224 loc) · 7.64 KB
/
upload.html
File metadata and controls
244 lines (224 loc) · 7.64 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload Item</title>
<link href="https://fonts.googleapis.com/css2?family=Russo+One&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap" rel="stylesheet">
<link href="https://unpkg.com/aos@next/dist/aos.css" rel="stylesheet">
<link rel="stylesheet" href="utils.css">
<link rel="stylesheet" href="style.css">
<script src="https://cdn.jsdelivr.net/npm/ethers@5.7.2/dist/ethers.umd.min.js"></script>
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.container {
margin-top: 100px;
width: 50vw;
height: 90vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: rgba(45, 45, 45, 0.5);
}
form {
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: start;
height: 80vh;
}
.form-group {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.btn-holder {
text-align: center;
}
input,
select {
margin: 1rem;
padding: 1rem;
min-width: 30vw;
border-radius: 20px;
}
.btn-holder {
width: 100%;
display: flex;
justify-content: center;
}
.btn-holder .btn {
background-color: rgb(32, 98, 164);
border-image: none;
color: white;
}
.btn-holder .btn:hover {
background-color: rgb(31, 80, 169);
}
@media (max-width:800px) {
.container {
height: 100vh;
width: 100vw;
}
.form-group {
flex-direction: column;
justify-content: center;
align-items: space-between;
padding: 2rem;
}
label {
padding: 2rem;
}
}
</style>
</head>
<body>
<nav class="flex space-around center-cross">
<div id="logo">Smart Share</div>
<ul id="nav-list" class="flex space-around baseline">
<a href="index.html">
<li>Home</li>
</a>
<a href="explore.html">
<li>Explore Listings</li>
</a>
<a href="upload.html">
<li>Create Listings</li>
</a>
<a href="dashboard.html">
<li>Dashboard</li>
</a>
</ul>
<div id="wallet">
<button class="btn" onclick="connectWallet()"><span>Connect Wallet</span></button>
</div>
</div>
</nav>
<div class="container">
<center>
<h2>Upload Your Item</h2>
</center>
<form id="form">
<div class="form-group">
<label for="item-name">Item Name</label>
<input type="text" id="item-name" name="item-name" required>
</div>
<div class="form-group">
<label for="size">Item Size</label>
<select id="size" name="size" required onchange="setPrice(this.value)">
<option value="">Select Size</option>
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
</select>
</div>
<div class="form-group">
<label for="price">Price</label>
<input type="text" id="price" name="price" readonly>
</div>
<div class="form-group">
<label for="duration">Duration</label>
<input type="text" id="duration" name="duration" required>
</div>
<div class="btn-holder">
<center><button type="submit" class="btn">Submit</button></center>
</div>
</form>
</div>
<footer id="footer">
<div id="foot-main">
<div class="foot-sec">
<h3 class="foothead">Quick Links</h3>
<ul id="foot-nav-list">
<a href="index.html">
<li>Home</li>
</a>
<a href="explore.html">
<li>Explore Listings</li>
</a>
<a href="upload.html.html">
<li>Create Listings</li>
</a>
<a href="dashboard.html">
<li>Dashboard</li>
</a>
</ul>
</div>
<div class="foot-sec">
<h3 class="foothead">Follow Us</h3>
<ul id="social-links">
<a href="">
<li><img src="./images/fb.svg" height="35px"></li>
</a>
<a href="">
<li><img src="./images/insta.svg" height="35px"></li>
</a>
<a href="">
<li><img src="./images/reddit.svg" height="35px"></li>
</a>
</ul>
</div>
<div class="foot-sec">
<h3 class="foothead">Contact Us</h3>
<ul style="list-style: none;">
<li>Email: <br>SmartShare@gmail.com</li>
<li>Phone: <br>+91 123 456 7890</li>
</ul>
</div>
</div>
<div id="foot-aside">
<p>© Copyright & Terms of Use </p>
</div>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>
AOS.init();
</script>
<script>
function setPrice(size) {
price = document.getElementById("price");
switch (size) {
case "small":
price.value = 10;
break;
case "medium":
price.value = 25;
break;
case "large":
price.value = 50;
break;
default:
price.value = null;
}
}
document.getElementById("form").addEventListener("submit", function (e) {
e.preventDefault();
const item = {
name: document.getElementById("item-name").value,
duration: document.getElementById("duration").value,
price: document.getElementById("price").value,
listed: new Date().toDateString,
available: "Yes",
user: "ABC"
};
if (localStorage.getItem("itemList")) {
itemList = JSON.parse(localStorage.getItem("itemList"));
}
else {
let itemList = [];
}
itemList.push(item);
localStorage.setItem("itemList", JSON.stringify(itemList));
window.location.href = "explore.html";
});
</script>
<script src="blockchain.js"></script>
</body>
</html>