-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
205 lines (142 loc) · 7.06 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
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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- main CSS to overrule any bootstrap css -->
<link rel="stylesheet" type="text/css" href="assets/css/main.css">
</head>
<body>
<div class="jumbotron jumbotron-fluid bg">
<div class="container banner">
<h1 class="display-4">PlastX</h1>
<p class="lead">Envisioning oceans free of plastic toys.</p>
</div>
</div>
<title>PlastX</title>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">///</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor01">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li> -->
</ul>
<!-- <form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text" placeholder="Search">
<button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
</form> -->
</div>
</nav>
<div class="container">
Here at <b>PlastX</b>, we strongly believe that the world has all the plastic toys it needs in existence already. Did you know plastic toys take hundreds if not thousands of years to biodegrade? Help us put toy companies making environment-polluting products out of business by refusing to purchase new plastic toys. Has your little one outgrown his or her toy? No problem - some other parent is happy to ship you theirs, free of charge. <em>We can do this together.</em> No more plastic toys in the oceans and landfills of the world. Post your clean, non-broken, unwanted toys below or email someone who has posted a toy your family can use.
</div>
<div class="container">
<div class="row">
<div class="col-sm">
<h2>Post a Toy</h2>
<div img id="dummyHead" src="http://www.orangeandgrey.org.uk/sitecontent/uploads/2015/01/Image-Here6.png" alt="dummyHead">
</div>
<form>
<div class='form-group'>
<label for='name'>Your Email</label>
<input type="text" id='email'>
</div>
<div class='form-group'>
<label for='name'>Your Toy Image URL</label>
<input type="text" id='url'>
</div>
<button type='submit' class='btn btn-primary' id='pushNew'>Post!</button>
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm">
<h2>Claim a Toy</h2>
<div id="toysandmail">
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.13.0/firebase.js"></script>
<script>
var config = {
apiKey: "AIzaSyDP5v7bPm31JzLTbQfpKMznC1AoPGcNMrI",
authDomain: "hackathonstuffles.firebaseapp.com",
databaseURL: "https://hackathonstuffles.firebaseio.com",
projectId: "hackathonstuffles",
storageBucket: "hackathonstuffles.appspot.com",
messagingSenderId: "41314634182"
};
firebase.initializeApp(config);
var database = firebase.database();
var info = {};
$(document).on('click','#pushNew',function() {
event.preventDefault();
var email = $("#email").val();
var url = $("#url").val();
info = {
email: email,
url: url
}
database.ref().push(info);
$("#email").val("");
$("#url").val("");
});
database.ref().on('child_added', function(snapshot) {
info = snapshot.val();
var stuff = $('<div>');
stuff.addClass("stuff-div");
// var email = $('<div>')
// email.addClass("emailClass");
// email.html(info.email);
// $(stuff).prepend(email);
var email = $('<a>')
email.attr('href', "mailto:" + info.email);
email.addClass("emailClass");
email.html(info.email);
console.log(email)
stuff.append(email);
var toyImage = $('<img>'); //created image tag
toyImage.addClass("toyImageClass");
toyImage.attr("src", info.url);
$(stuff).prepend(toyImage);
$('#toysandmail').prepend(stuff);
})
</script>
<!--Footer Links-->
<div class="container-fluid text-center text-md-left">
<div class="row">
</div>
</div>
<!--/.Footer Links-->
<!--Copyright-->
<div class="footer-copyright py-3 text-center">
© 2018 Copyright HackathonHommies ||
<a href="https://github.com/dvdkrstndnls/noplastictoys"> GitHub Repo </a>
</div>
<!--/.Copyright-->
</footer>
<!--/.Footer-->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>