-
Notifications
You must be signed in to change notification settings - Fork 0
/
history.html
190 lines (162 loc) · 6.66 KB
/
history.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
<html>
<head>
<script src="https://www.gstatic.com/firebasejs/7.14.1/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/7.14.1/firebase-analytics.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.14.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.14.1/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.14.1/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.14.1/firebase-storage.js"></script>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
margin:auto;
overflow: hidden;
background-color: rgb(255, 255, 255);
border-top:2px solid #000000;
border-bottom:2px solid #000000;
}
li {
/* margin:auto; */
float: left;
}
li a {
display: block;
color: black;
text-align: center;
padding: 14px 26px;
text-decoration: none;
}
/* li a:hover:not(.active) {
background-color: rgb(100, 111, 146);
} */
li a:hover {
/* background-color: rgb(100, 111, 146); */
color:rgb(110, 108, 218);
}
.active {
text-shadow: aqua;
/* background-color: rgb(123, 153, 209); */
}
#center{
float: left;
/* margin:auto; */
margin-left: 159px;
margin-right: 0;
/* background-color: aqua; */
width: 65%;
height:100%;
}
p{
text-indent:30px;
line-height: 25px;
}h1{
font-size: 45px;
text-align: center;
}img{
width: 100%;
height: 50%;
}#about{
float: right;
margin-right:0;
/* background-color:blueviolet; */
width: 20%;
}.card {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
width: 95%;
border-radius: 5px;
margin-left: 20px;
margin-top:15px;
/* background-color: ; */
}
.card:hover {
box-shadow: 5px 8px 16px 5px rgba(0,0,0,0.2);
}
img {
border-radius: 5px 5px 0 0;
}
.container {
margin-left:5px;
margin-top: 5px;
padding: 2px 16px;
}#left{
float: left;
width:50%;
}#right{
float: left;
width:50%;
}
</style>
</head>
<body>
<h1>The History Of North Toronto</h1>
<ul>
<li style="padding-left: 33%;"><a class="active" href="index.html">Home</a></li>
<li><a href="stories.html">Stories</a></li>
<li><a href="history.html">More History</a></li>
<li><a href="post.html">Add your own Stories or History</a></li>
</ul>
<div>
<div id="center">
<div id="left">
</div>
<div id="right">
</div>
</div>
<div id="about">
<h2>About</h2>
<p>This page is where all user added history is. This means any history added by people visiting the website on the add your own stories and history page. If you would like to add your own history please go to the "Add your own stories and history" page.</p>
</div>
</div>
<script>
const firebaseConfig = {
apiKey: "AIzaSyBr82lf_mJNINggjBO1LRj7f81J1geYTAk",
authDomain: "northtorontohistory.firebaseapp.com",
databaseURL: "https://northtorontohistory-default-rtdb.firebaseio.com",
projectId: "northtorontohistory",
storageBucket: "northtorontohistory.appspot.com",
messagingSenderId: "864463281667",
appId: "1:864463281667:web:b354b7413a6053fa44b836",
measurementId: "G-9VNB32JXFE"
};
// var firebaseConfig = {
// apiKey: "AIzaSyAwfVDBdOqoBcngST7p0AKpyd6ls4_CA3M",
// authDomain: "northtoronto-d4b21.firebaseapp.com",
// databaseURL: "https://northtoronto-d4b21.firebaseio.com",
// projectId: "northtoronto-d4b21",
// storageBucket: "northtoronto-d4b21.appspot.com",
// messagingSenderId: "121807116095",
// appId: "1:121807116095:web:6cffa8780a7d1a1fbae58a",
// measurementId: "G-R2XHV4VHFY"
// };
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
const db=firebase.firestore();
var outputstrleft=""
var outputstrright=""
var list=[]
var count=0;
db.collection("histories").get().then((data)=>{
data.forEach((doc)=>{
count+=1
if(count%2==1){
outputstrleft+='<div class="card"><div class="container"><h2>'+doc.data()["title"]+'</h2><h3>'+doc.data()['date']+'</h3><p>'+doc.data()['history']+'</p><p>'+doc.data()['author']+'</p><p>Posted: '+doc.data()['dateposted']+'</p></div></div>'
}else if(count%2==0){
outputstrright+='<div class="card"><div class="container"><h2>'+doc.data()["title"]+'</h2><h3>'+doc.data()['date']+'</h3><p>'+doc.data()['history']+'</p><p>'+doc.data()['author']+'</p><p>Posted: '+doc.data()['dateposted']+'</p></div></div>'
}
list.push(doc.data())
})
}).then(()=>{
document.getElementById("right").innerHTML=outputstrright;
document.getElementById("left").innerHTML=outputstrleft;
}).catch((error)=>{
console.error(error)
})
</script>
</body>
</html>