-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathb.html
263 lines (247 loc) · 14.2 KB
/
b.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
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
<link
href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Two+Tone|Material+Icons+Round|Material+Icons+Sharp"
rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Roboto">
<link rel="stylesheet" href="https://use.typekit.net/lku7gbz.css">
<link rel="stylesheet" href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css">
<link rel="stylesheet" href="https://2kinc.me/2kcomponents.css">
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="favicon.png" type="image/x-icon">
<title>Blitzboard</title>
</head>
<body>
<div id="app">
<aside id="drawer" class="mdc-drawer mdc-drawer--modal mdc-typography">
<div class="mdc-drawer__header">
<h3 class="mdc-drawer__title" id="drawer-title">{{name}}</h3>
<h6 class="mdc-drawer__subtitle" id="drawer-subtitle">
<span id="blitzboard-description">{{description}}</span>
<hr>
<span class="inactive-dot"></span>
<span id="member-count">{{members.length}} members</span>
<span class="active-dot"></span>
<span id="online-member-count">{{onlineMembers.length}} online</span>
</h6>
</div>
<div class="mdc-drawer__content">
<nav class="mdc-list">
<div class="mdc-list-divider"></div>
<h6 class="mdc-list-group__subheader">Topics</h6>
<div id="topics">
<template v-for="topic of topics" v-if="topic != 'home'">
<li class="topic-item mdc-list-item"
v-bind:class="{'mdc-list-item--selected': currentTopic == topic}"
v-on:click="goToTopic(topic)">::{{topic}}</li>
</template>
</div>
<div class="mdc-list-divider"></div>
<h6 class="mdc-list-group__subheader">Members</h6>
<template v-for="member of sortedMembers">
<li class="member-wrapper mdc-list-item">
<div class="member-left">
<img v-bind:src="member.photoURL" class="profile-picture member-picture" />
<div class="member-status">
<div class="active-dot" v-if="member.presence == true"></div>
<div class="inactive-dot" v-if="!member.presence"></div>
</div>
</div>
<div class="member-name">{{member.displayName}}</div>
</li>
</template>
</nav>
</div>
</aside>
<div class="mdc-drawer-scrim"></div>
<div id="mdc-drawer-frame-content">
<header class="mdc-top-app-bar" id="navbar">
<div class="mdc-top-app-bar__row">
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
<button
class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-ripple-surface">menu</button>
<span class="mdc-top-app-bar__title" style="font-family: 'Product Sans', 'Roboto', sans-serif;">
Blitzboard <span id="blitzboard-title">::{{currentTopic}} - {{name}}</span>
</span>
</section>
</div>
</header>
<div id="content-body" class="mdc-drawer-app-content">
<div id="main-content">
<div id="posts" ref="posts">
<div id="new-post-wrapper">
<div id="new-post-main" v-bind:class="{shown: readyToPushPost}">
<div class="mdc-text-field mdc-text-field--outlined">
<input class="mdc-text-field__input" id="new-post-name" v-model="postForm.name">
<div class="mdc-notched-outline">
<div class="mdc-notched-outline__leading"></div>
<div class="mdc-notched-outline__notch">
<label class="mdc-floating-label">Title</label>
</div>
<div class="mdc-notched-outline__trailing"></div>
</div>
</div>
<button id="cancel-post-button" v-on:click="closePost"
class="mdc-button mdc-button--outlined mdc-ripple-upgraded" style="float:right;">
✕ Close
</button>
<br>
<div class="mdc-text-field mdc-text-field--textarea">
<textarea id="new-post-content" class="mdc-text-field__input" rows="8" cols="40"
v-model="postForm.content"></textarea>
<div class="mdc-notched-outline">
<div class="mdc-notched-outline__leading"></div>
<div class="mdc-notched-outline__notch">
<label for="new-post-content" class="mdc-floating-label">Content</label>
</div>
<div class="mdc-notched-outline__trailing"></div>
</div>
</div>
<br>
<input type="file" name="Upload an image" class="inputfile" id="new-post-upload"
ref="newPostUpload" accept=".jpg,.png,.bmp" />
<label for="new-post-upload" class="mdc-chip" id="new-post-upload-label">
<i
class="material-icons-outlined mdc-chip__icon mdc-chip__icon--leading">cloud_upload</i>
<div class="mdc-chip__text">Upload an image?</div>
</label>
<br>
<br>
<div>Topics:</div>
<div id="new-post-topics-wrapper" class="mdc-chip-set"></div>
<div class="mdc-select">
<i class="mdc-select__dropdown-icon"></i>
<select class="mdc-select__native-control" id="new-post-topics">
<option selected>Select a topic</option>
<option v-for="topic of availableTopics" v-bind:id="'option-' + topic">
::{{topic}}</option>
</select>
<label class="mdc-floating-label">Add topics</label>
<div class="mdc-line-ripple"></div>
</div>
</div>
<button class="mdc-button mdc-button--outlined" id="new-post-button" v-on:click="pushPost"
ref="newPostButton">+ New Post</button>
</div>
<div id="posts-bodies" ref="postsBodies"></div>
</div>
<div id="chat">
<div id="chat-bodies" ref="chatBodies"></div>
<div id="chat-input-container" class="mdc-elevation--z2">
<div class="mdc-text-field mdc-text-field--outlined" id="chat-textfield">
<input class="mdc-text-field__input" id="chat-input" v-model="chatMessage"
v-on:keyup.enter="pushChatMessage">
<div class="mdc-notched-outline">
<div class="mdc-notched-outline__leading"></div>
<div class="mdc-notched-outline__notch">
<label class="mdc-floating-label">Send a message</label>
</div>
<div class="mdc-notched-outline__trailing"></div>
</div>
</div>
<button class="mdc-icon-button material-icons" id="chat-input-button" v-on:click="pushChatMessage">message</button>
</div>
</div>
</div>
<div id="loading" v-if="!loaded">Loading...</div>
</div>
</div>
<div id="welcome" ref="welcome">
<h1>Welcome <b>{{currentUser.displayName}}</b>!</h1>
<div id="welcome-info">
<h1>{{name}}</h1>
<h5>{{description}}</h2>
<h3>{{members.length}} members ⋅ <span>{{onlineMembers.length}} online</span></h2>
</div>
<button class="mdc-button mdc-button--unelevated" id="join-blitzboard" v-on:click="joinBlitzboard">Join</button>
</div>
</div>
<template id="chat-body-template">
<div class="chat-body" v-bind:id="'chat-body-' + topic" v-if="parentVue.currentTopic == topic">
<message-wrapper v-for="message in sortedMessages" v-if="message" v-bind:key="message.id"
v-bind:message="message">
</message-wrapper>
</div>
</template>
<template id="message-wrapper-template" v-if="message">
<div class="message">
<div style="--color-secondary: black; color: black;">
<img v-bind:src="message.photoURL" class="profile-picture mdc-elevation--z1"
v-bind:alt="message.displayName" v-bind:title="message.displayName">
<div class="message-body mdc-ripple-surface" ref="messageBody">{{message.message}}</div>
</div>
<div class="message-info">
<span class="chat-username">{{message.displayName}}</span>
<span class="message-info--time"> at {{message.time}}</span>
</div>
</div>
</template>
<template id="posts-body-template">
<div class="posts-body mdc-layout-grid" v-bind:id="'posts-body-' + topic"
v-if="parentVue.currentTopic == topic">
<div class="mdc-layout-grid__inner">
<post-wrapper v-for="post of posts" v-bind:post="post" v-bind:dbref="dbref.ref.child(post.id)"
v-bind:key="post.key"></post-wrapper>
</div>
</div>
</template>
<template id="post-wrapper-template">
<div class="mdc-card post-wrapper mdc-layout-grid__cell mdc-layout-grid__cell--span-6 mdc-elevation--z3">
<div class="mdc-card__primary-action" tabindex="0">
<div class="mdc-card__media mdc-card__media--16-9 post-img"
v-bind:style="'background-image: url("' + post.imageURL + '");'">
</div>
<div class="mdc-card__primary">
<h2 class="mdc-card__title mdc-typography mdc-typography--headline6 post-title">
{{post.name}}
</h2>
<h3 class="mdc-card__subtitle mdc-typography mdc-typography--subtitle2 post-user">
{{post.displayName}}
</h3>
</div>
<div class="mdc-card__secondary mdc-typography mdc-typography--body2">
{{post.content}}
</div>
<div class="post-topics mdc-chip-set">
<div v-for="topic of post.topics" class="mdc-chip post-topic-item">
<div class="mdc-chip__text">::{{topic}}</div>
</div>
</div>
</div>
<div class="mdc-card__actions">
<div class="mdc-card__action-buttons">
<button class="plus-button mdc-button mdc-button--outlined" v-on:click="addPlus" ref="plusButton"
v-bind:class="{selected: vote === 1}">+1</button>
<span class="post-points">{{post.pluses - post.minuses}}</span>
<button class="minus-button mdc-button mdc-button--outlined" v-on:click="addMinus" ref="minusButton"
v-bind:class="{selected: vote === 0}">-1</button>
</div>
</div>
</div>
</template>
<script src="https://www.gstatic.com/firebasejs/5.9.1/firebase.js"></script>
<script> //Firebase Initializing
var config = {
apiKey: "AIzaSyADD6YWKrzibRMwJNi1FwUR0jcR0GitZPI",
authDomain: "k-inc-232222.firebaseapp.com",
databaseURL: "https://k-inc-232222.firebaseio.com",
projectId: "k-inc-232222",
storageBucket: "k-inc-232222.appspot.com",
messagingSenderId: "827804821456"
};
firebase.initializeApp(config);
</script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
<!-- Required MDC Web JavaScript library -->
<script src="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.js"></script>
<script src="notifications.js"></script>
<script src="index.js"></script>
</body>
</html>