notherbase-fs 1.0.38 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/controllers/authCheck.js +27 -0
- package/controllers/chat.js +30 -0
- package/controllers/contact.js +22 -0
- package/controllers/explorer.js +122 -0
- package/controllers/index.js +11 -0
- package/controllers/inventory.js +104 -0
- package/controllers/item.js +61 -0
- package/controllers/portfolio/models/projects.js +16 -0
- package/controllers/portfolio/portfolio-controller.js +10 -0
- package/controllers/portfolio/views/index.ejs +234 -0
- package/controllers/portfolio/views/parts/tamago.ejs +534 -0
- package/controllers/the-front.js +88 -0
- package/controllers/user.js +111 -0
- package/index.js +16 -0
- package/models/chat.js +9 -0
- package/models/contact.js +17 -0
- package/models/index.js +10 -0
- package/models/inventory.js +22 -0
- package/models/item.js +12 -0
- package/models/start-mongoose.js +22 -0
- package/models/user.js +16 -0
- package/package.json +12 -3
- package/public/img/logo.png +0 -0
- package/public/styles/chat.css +60 -0
- package/public/styles/main.css +328 -0
- package/public/styles/portfolio.css +468 -0
- package/public/styles/void.css +37 -0
- package/server.js +83 -0
- package/views/basic-footer.ejs +2 -0
- package/views/chat-box.ejs +47 -0
- package/views/contact.ejs +24 -0
- package/views/explorer.ejs +26 -0
- package/views/footer.ejs +9 -0
- package/views/head.ejs +19 -0
- package/views/inventory.ejs +134 -0
- package/main.js +0 -91
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--textColor: rgb(247, 247, 247);
|
|
3
|
+
--altTextColor: rgb(20, 20, 20);
|
|
4
|
+
--bgColor: rgb(31, 31, 31);
|
|
5
|
+
--bgColorLight: rgb(79, 79, 79);
|
|
6
|
+
--focusColor: rgb(222, 139, 37);
|
|
7
|
+
--shadowColor: rgb(0, 0, 0);
|
|
8
|
+
--extreme-dark: #2e2e2e;
|
|
9
|
+
--very-dark: #3e3e3e;
|
|
10
|
+
--dark: #505050;
|
|
11
|
+
--light: #F7FFE0;
|
|
12
|
+
--yellow: #D59C00;
|
|
13
|
+
--brown: #704E2E;
|
|
14
|
+
--green: #709176;
|
|
15
|
+
--blue: #00487C;
|
|
16
|
+
--game-size: 500px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
* {
|
|
20
|
+
color: var(--textColor);
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
margin: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
font-family: 'Chakra Petch', sans-serif;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.invisible {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
a {
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h4 a {
|
|
36
|
+
margin-right: 20px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
hr {
|
|
40
|
+
border: none;
|
|
41
|
+
border-bottom: 2px solid var(--shadowColor);
|
|
42
|
+
margin: 5px 20px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
hr.light {
|
|
46
|
+
border-bottom: 2px solid var(--textColor);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
body {
|
|
50
|
+
background-color: var(--bgColorLight);
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
header {
|
|
55
|
+
height: 100vh;
|
|
56
|
+
width: 100%;
|
|
57
|
+
position: relative;
|
|
58
|
+
box-shadow: 0 10px 25px var(--shadowColor);
|
|
59
|
+
background-color: var(--bgColor);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.portrait {
|
|
63
|
+
height: 100%;
|
|
64
|
+
width: 70%;
|
|
65
|
+
position: absolute;
|
|
66
|
+
right: 0;
|
|
67
|
+
background-image: url("/img/fancy-me.jpg");
|
|
68
|
+
background-size: cover;
|
|
69
|
+
background-position-x: center;
|
|
70
|
+
background-repeat: no-repeat;
|
|
71
|
+
z-index: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.portrait-fade {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
header h2 {
|
|
80
|
+
position: absolute;
|
|
81
|
+
left: 100px;
|
|
82
|
+
top: 35%;
|
|
83
|
+
font-size: 50px;
|
|
84
|
+
background-color: var(--bgColor);
|
|
85
|
+
padding: 10px;
|
|
86
|
+
border-radius: 5px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
header h3 {
|
|
90
|
+
position: absolute;
|
|
91
|
+
left: 100px;
|
|
92
|
+
top: calc(35% + 75px);
|
|
93
|
+
font-size: 30px;
|
|
94
|
+
background-color: var(--bgColor);
|
|
95
|
+
padding: 10px;
|
|
96
|
+
border-radius: 5px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.external-links {
|
|
100
|
+
position: absolute;
|
|
101
|
+
left: 100px;
|
|
102
|
+
top: calc(35% + 125px);
|
|
103
|
+
font-size: 50px;
|
|
104
|
+
background-color: var(--bgColor);
|
|
105
|
+
width: 110px;
|
|
106
|
+
height: 65px;
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: space-evenly;
|
|
109
|
+
align-items: center;
|
|
110
|
+
padding: 5px;
|
|
111
|
+
border-radius: 5px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
header a {
|
|
115
|
+
width: 50px;
|
|
116
|
+
height: 100%;
|
|
117
|
+
margin: 5px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
header i:hover {
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
color: var(--focusColor);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
nav {
|
|
126
|
+
height: 50px;
|
|
127
|
+
width: 100%;
|
|
128
|
+
background-color: var(--focusColor);
|
|
129
|
+
padding: 10px;
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
align-items: center;
|
|
133
|
+
position: fixed;
|
|
134
|
+
left: 0;
|
|
135
|
+
top: 0;
|
|
136
|
+
transition: all .2s ease;
|
|
137
|
+
z-index: 99;
|
|
138
|
+
border-bottom: 1px solid var(--bgColorLight);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
nav * {
|
|
142
|
+
color: var(--altTextColor);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
nav i {
|
|
146
|
+
font-size: 30px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.nav-closed {
|
|
150
|
+
top: -50px;
|
|
151
|
+
transition: all .2s ease;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
main {
|
|
155
|
+
width: 100%;
|
|
156
|
+
overflow: hidden;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
main img {
|
|
160
|
+
width: 100%;
|
|
161
|
+
height: auto;
|
|
162
|
+
border-radius: 5px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
section {
|
|
166
|
+
width: 100%;
|
|
167
|
+
padding: 100px 10px;
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
align-items: center;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
section h3 {
|
|
174
|
+
margin: 20px;
|
|
175
|
+
font-size: 25px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
section h4 {
|
|
179
|
+
margin: 5px 20px;
|
|
180
|
+
font-size: 18px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
section h4 i {
|
|
184
|
+
margin: 5px 5px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
section p {
|
|
188
|
+
margin: 20px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
section img {
|
|
192
|
+
width: 50%;
|
|
193
|
+
height: auto;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
section iframe {
|
|
197
|
+
width: 50%;
|
|
198
|
+
height: 700px;
|
|
199
|
+
border: none;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.text {
|
|
203
|
+
width: 600px;
|
|
204
|
+
height: 100%;
|
|
205
|
+
padding: 5px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
#notherbase-fs {
|
|
209
|
+
background-color: var(--extreme-dark);
|
|
210
|
+
padding: 10px;
|
|
211
|
+
border: 5% solid var(--bgColor);
|
|
212
|
+
border-radius: 0% 0% 50px 50px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
#notherbase-fs img {
|
|
216
|
+
width: 20%;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
#cpd {
|
|
220
|
+
background-color: var(--focusColor);
|
|
221
|
+
flex-direction: row-reverse;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
#cpd * {
|
|
225
|
+
color: var(--altTextColor);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
#tamago-watch {
|
|
229
|
+
background-color: var(--bgColor);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
#won-ventures {
|
|
233
|
+
background-color: var(--focusColor);
|
|
234
|
+
flex-direction: row-reverse;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
#won-ventures * {
|
|
238
|
+
color: var(--altTextColor);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
#wayfarer {
|
|
242
|
+
background-color: var(--bgColor);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* tamago watch styles */
|
|
246
|
+
.watch {
|
|
247
|
+
width: var(--game-size);
|
|
248
|
+
min-height: 100;
|
|
249
|
+
image-rendering: pixelated;
|
|
250
|
+
position: relative;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.watch * {
|
|
254
|
+
image-rendering: pixelated;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.cartridge {
|
|
258
|
+
position: absolute;
|
|
259
|
+
left: 5%;
|
|
260
|
+
top: 30%;
|
|
261
|
+
background-image: url("/img/cartridge.png");
|
|
262
|
+
background-size: cover;
|
|
263
|
+
transition: ease-out .15s;
|
|
264
|
+
z-index: 0;
|
|
265
|
+
width: 90%;
|
|
266
|
+
height: 90%;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.cartridge:hover {
|
|
270
|
+
top: 40%;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.name {
|
|
274
|
+
background-color: #70917600;
|
|
275
|
+
position: absolute;
|
|
276
|
+
top: 73%;
|
|
277
|
+
left: 32%;
|
|
278
|
+
width: 280px;
|
|
279
|
+
height: 80px;
|
|
280
|
+
transform: rotate(29deg);
|
|
281
|
+
text-align: center;
|
|
282
|
+
font-size: 50px;
|
|
283
|
+
border: none;
|
|
284
|
+
cursor: pointer;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.console {
|
|
288
|
+
width: 100%;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.screen {
|
|
292
|
+
position: absolute;
|
|
293
|
+
top: 6%;
|
|
294
|
+
left: 6.25%;
|
|
295
|
+
width: 87.5%;
|
|
296
|
+
height: 55%;
|
|
297
|
+
display: initial;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.bloom {
|
|
301
|
+
box-shadow: 0px 0px 10px #fff6d759, inset 0px 0px 10px #fff6d759;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.pet {
|
|
305
|
+
position: absolute;
|
|
306
|
+
top: 0%;
|
|
307
|
+
left: 10%;
|
|
308
|
+
width: 25%;
|
|
309
|
+
display: none;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
#p1 {
|
|
313
|
+
top: auto;
|
|
314
|
+
bottom: 10%;
|
|
315
|
+
left: 40%;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
#p2 {
|
|
319
|
+
top: 0%;
|
|
320
|
+
left: auto;
|
|
321
|
+
right: 10%;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.food {
|
|
325
|
+
position: absolute;
|
|
326
|
+
right: 0;
|
|
327
|
+
bottom: 20%;
|
|
328
|
+
width: 25%;
|
|
329
|
+
display: none;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.music {
|
|
333
|
+
position: absolute;
|
|
334
|
+
bottom: 20%;
|
|
335
|
+
left: 2%;
|
|
336
|
+
width: 25%;
|
|
337
|
+
display: none;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.detached-right {
|
|
341
|
+
float: right;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.dark {
|
|
345
|
+
filter: brightness(.5);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.hud {
|
|
349
|
+
position: absolute;
|
|
350
|
+
bottom: 5%;
|
|
351
|
+
left: 5%;
|
|
352
|
+
width: 90%;
|
|
353
|
+
height: 32%;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.clock-hand {
|
|
357
|
+
position: absolute;
|
|
358
|
+
top: 12.5%;
|
|
359
|
+
left: 4.10%;
|
|
360
|
+
height: 80%;
|
|
361
|
+
width: 25%;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.status {
|
|
365
|
+
position: absolute;
|
|
366
|
+
top: 10%;
|
|
367
|
+
right: 27.75%;
|
|
368
|
+
height: 16%;
|
|
369
|
+
width: 29%;
|
|
370
|
+
display: grid;
|
|
371
|
+
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
372
|
+
grid-template-rows: 1fr;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
#s1 {
|
|
376
|
+
top: 45%;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
#s2 {
|
|
380
|
+
top: 78%;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.point {
|
|
384
|
+
border: 1px solid var(--dark);
|
|
385
|
+
background-color: var(--yellow);
|
|
386
|
+
display: none;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.button {
|
|
390
|
+
background-color: rgba(0, 0, 0, 0);
|
|
391
|
+
background-image: url("/img/button_brown.png");
|
|
392
|
+
background-size: 100%;
|
|
393
|
+
background-repeat: no-repeat;
|
|
394
|
+
cursor: pointer;
|
|
395
|
+
border: none;
|
|
396
|
+
position: absolute;
|
|
397
|
+
top: 6%;
|
|
398
|
+
right: 5%;
|
|
399
|
+
height: 25%;
|
|
400
|
+
width: 20%;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.button:active {
|
|
404
|
+
background-image: url("/img/button_brown_down.png");
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
#b1 {
|
|
408
|
+
background-image: url("/img/button_blue.png");
|
|
409
|
+
top: 40%;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
#b1:active {
|
|
413
|
+
background-image: url("/img/button_blue_down.png");
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
#b2 {
|
|
417
|
+
background-image: url("/img/button_green.png");
|
|
418
|
+
top: 75%;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
#b2:active {
|
|
422
|
+
background-image: url("/img/button_green_down.png");
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@media only screen and (max-width: 900px) {
|
|
426
|
+
.portrait {
|
|
427
|
+
width: 100%;
|
|
428
|
+
height: 100vh;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
header h2 {
|
|
432
|
+
left: 35px;
|
|
433
|
+
font-size: 30px;
|
|
434
|
+
top: 65%;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
header h3 {
|
|
438
|
+
left: 35px;
|
|
439
|
+
font-size: 25px;
|
|
440
|
+
top: calc(65% + 50px);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.external-links {
|
|
444
|
+
left: 35px;
|
|
445
|
+
font-size: 30px;
|
|
446
|
+
top: calc(65% + 95px);
|
|
447
|
+
height: 45px;
|
|
448
|
+
width: 75px;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
section {
|
|
452
|
+
flex-wrap: wrap;
|
|
453
|
+
padding: 40px 10px;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
#cpd, #won-ventures {
|
|
457
|
+
flex-direction: row;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.text, section img, section iframe {
|
|
461
|
+
width: 100%;
|
|
462
|
+
padding: 5px;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.watch {
|
|
466
|
+
width: 100%;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--shadow: rgb(71, 71, 71);
|
|
3
|
+
--textColor: rgb(49, 49, 49);
|
|
4
|
+
--woodColor: rgb(170, 117, 68);
|
|
5
|
+
--metalColor: rgb(104, 101, 100);
|
|
6
|
+
--brickColor: rgb(139, 67, 38);
|
|
7
|
+
--gravelColor: rgb(160, 158, 154);
|
|
8
|
+
--grassColor: rgb(50, 93, 61);
|
|
9
|
+
--voidColor: rgb(41, 0, 41);
|
|
10
|
+
--darkVoidColor: rgb(24, 0, 24);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
* {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
font-family: 'Chela One', cursive;
|
|
16
|
+
color: var(--voidColor);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
body {
|
|
20
|
+
background-color: var(--voidColor);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
main {
|
|
24
|
+
background-color: var(--darkVoidColor);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h1 {
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
a {
|
|
32
|
+
background-color: var(--darkVoidColor);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
a:hover {
|
|
36
|
+
border: 1px solid var(--voidColor);
|
|
37
|
+
}
|
package/server.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
let started = false;
|
|
2
|
+
let theFront, explorer = null;
|
|
3
|
+
|
|
4
|
+
function start() {
|
|
5
|
+
if (!started) {
|
|
6
|
+
require("dotenv").config();
|
|
7
|
+
|
|
8
|
+
// Setup for Express
|
|
9
|
+
const express = require("express");
|
|
10
|
+
const app = express();
|
|
11
|
+
app.set("view engine", "ejs");
|
|
12
|
+
|
|
13
|
+
//setup for sockets
|
|
14
|
+
const http = require('http');
|
|
15
|
+
const server = http.createServer(app);
|
|
16
|
+
const { Server } = require("socket.io");
|
|
17
|
+
const io = new Server(server);
|
|
18
|
+
|
|
19
|
+
// allows us to delete
|
|
20
|
+
const methodOverride = require('method-override');
|
|
21
|
+
app.use(methodOverride('_method'));
|
|
22
|
+
|
|
23
|
+
//auth
|
|
24
|
+
const session = require('express-session');
|
|
25
|
+
const MongoStore = require('connect-mongo');
|
|
26
|
+
|
|
27
|
+
// allows us to use post body data
|
|
28
|
+
app.use(express.urlencoded({ extended: true }));
|
|
29
|
+
|
|
30
|
+
// allows us to get static files like css
|
|
31
|
+
app.use(express.static('public'));
|
|
32
|
+
|
|
33
|
+
// sets the favicon image
|
|
34
|
+
const favicon = require('serve-favicon');
|
|
35
|
+
app.use(favicon(__dirname + '/public/img/logo.png'));
|
|
36
|
+
|
|
37
|
+
// Import my Controller
|
|
38
|
+
const controllers = require("./controllers");
|
|
39
|
+
|
|
40
|
+
//enable cookies
|
|
41
|
+
app.use(session({
|
|
42
|
+
store: MongoStore.create({ mongoUrl: process.env.MONGODB_URI }),
|
|
43
|
+
secret: process.env.SECRET || "won",
|
|
44
|
+
resave: false,
|
|
45
|
+
saveUninitialized: false
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
io.on('connection', (socket) => {
|
|
49
|
+
socket.join(socket.handshake.query.room);
|
|
50
|
+
|
|
51
|
+
socket.on('disconnect', () => {});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
app.use("/user", controllers.user);
|
|
55
|
+
|
|
56
|
+
app.use("/portfolio", controllers.portfolio);
|
|
57
|
+
|
|
58
|
+
app.use("/chat", controllers.chat(io));
|
|
59
|
+
|
|
60
|
+
app.use("/contact", controllers.contact);
|
|
61
|
+
|
|
62
|
+
app.use("/inventory", controllers.inventory);
|
|
63
|
+
|
|
64
|
+
app.use("/item", controllers.item);
|
|
65
|
+
|
|
66
|
+
app.use("/the-front", theFront);
|
|
67
|
+
|
|
68
|
+
app.use("/", controllers.authCheck, explorer);
|
|
69
|
+
|
|
70
|
+
// Go Off (On)
|
|
71
|
+
server.listen(process.env.PORT);
|
|
72
|
+
|
|
73
|
+
started = true;
|
|
74
|
+
}
|
|
75
|
+
else console.log("Server already started!");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = function set(frontRouter, exploreRouter) {
|
|
79
|
+
theFront = frontRouter;
|
|
80
|
+
explorer = exploreRouter;
|
|
81
|
+
|
|
82
|
+
return start;
|
|
83
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<link rel="stylesheet" href="/styles/chat.css">
|
|
2
|
+
|
|
3
|
+
<div class="chat-box">
|
|
4
|
+
<div class="chat-name">Chatting using the name <%= user.username %>:</div>
|
|
5
|
+
|
|
6
|
+
<div class="chat-log">
|
|
7
|
+
|
|
8
|
+
</div>
|
|
9
|
+
<input autocomplete="off" type="text" name="text" class="chat-entry">
|
|
10
|
+
<div value="Send" class="chat-send">Send</div>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
<%- include("../node_modules/socket.io/client-dist/socket.io.js"); %>
|
|
15
|
+
|
|
16
|
+
let socket = io({
|
|
17
|
+
query: {
|
|
18
|
+
room: "<%= room %>"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
let $chatLog = $(".chat-log");
|
|
22
|
+
let $entry = $(".chat-entry");
|
|
23
|
+
|
|
24
|
+
socket.on('chat message', function(msg) {
|
|
25
|
+
let time = new Date(msg.time);
|
|
26
|
+
$chatLog.append(`<p>[${time.toLocaleTimeString('en-US')}] ${msg.name}: ${msg.text}</p>`);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const sendMessage = function() {
|
|
30
|
+
if ($entry.val() !== ""){
|
|
31
|
+
let val = $entry.val();
|
|
32
|
+
$entry.val("");
|
|
33
|
+
|
|
34
|
+
$.post("/chat", {
|
|
35
|
+
room: "<%= room %>",
|
|
36
|
+
text: val
|
|
37
|
+
}, function () {
|
|
38
|
+
$chatLog.scrollTop($chatLog[0].scrollHeight);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
$(".chat-send").on("click", sendMessage);
|
|
44
|
+
$entry.on("keyup", function(e) {
|
|
45
|
+
if (e.keyCode == 13) sendMessage();
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<div id="contact-form" class="invisible">
|
|
2
|
+
<h4>Message Nother</h4>
|
|
3
|
+
<input type="text" name="content" id="content">
|
|
4
|
+
<button id="send">Send Message</button>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<button id="contact">Msg Nother</button>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
$("#contact").on("click", (e) => {
|
|
11
|
+
$("#contact-form").toggleClass("invisible");
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
$("#send").on("click", (e) => {
|
|
15
|
+
$.post("/contact",
|
|
16
|
+
{
|
|
17
|
+
location: "Test",
|
|
18
|
+
content: $("#content").val(),
|
|
19
|
+
},
|
|
20
|
+
function () {
|
|
21
|
+
$("#content").val("");
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<%- include("./head.ejs"); %>
|
|
2
|
+
|
|
3
|
+
<style>
|
|
4
|
+
<% for (let i = 0; i < styles.length; i++) { %>
|
|
5
|
+
<%- include(`${styles[i]}.css`); %>
|
|
6
|
+
<% } %>
|
|
7
|
+
<% for (let i = 0; i < externalStyles.length; i++) { %>
|
|
8
|
+
<%- include(`${externalStyles[i]}.css`); %>
|
|
9
|
+
<% } %>
|
|
10
|
+
</style>
|
|
11
|
+
|
|
12
|
+
<main class="override">
|
|
13
|
+
<%- include(`${main}.ejs`); %>
|
|
14
|
+
|
|
15
|
+
<%- include(process.cwd() + "/views/inventory.ejs"); %>
|
|
16
|
+
|
|
17
|
+
<%- include(process.cwd() + "/views/contact.ejs"); %>
|
|
18
|
+
</main>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
<% for (let i = 0; i < scripts.length; i++) { %>
|
|
22
|
+
<%- include(`${scripts[i]}.js`); %>
|
|
23
|
+
<% } %>
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<%- include("./footer.ejs"); %>
|
package/views/footer.ejs
ADDED
package/views/head.ejs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title><%= siteTitle %></title>
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
|
8
|
+
|
|
9
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
10
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
11
|
+
<!-- 'Roboto Condensed', sans-serif; -->
|
|
12
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@700&display=swap" rel="stylesheet">
|
|
13
|
+
<!-- 'Redacted Script', cursive; -->
|
|
14
|
+
<link href="https://fonts.googleapis.com/css2?family=Redacted+Script:wght@300&display=swap" rel="stylesheet">
|
|
15
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
|
16
|
+
<link rel="stylesheet" href="/styles/main.css">
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|