notherbase-fs 3.2.20 → 3.2.21

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.
@@ -19,6 +19,9 @@ export default class Creation {
19
19
  //pages
20
20
  this.router.get(`/:page`, this.page, this.explore);
21
21
 
22
+ //the-front optional shortcuts
23
+ this.router.get(`/:frontDetail`, this.frontDetail, this.explore);
24
+
22
25
  //explorer
23
26
  this.router.get(`/:region/:area/:poi`, this.lock, this.poi, this.explore);
24
27
  this.router.get(`/:region/:area/:poi/:detail`, this.lock, this.detail, this.explore);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "3.2.20",
3
+ "version": "3.2.21",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
@@ -0,0 +1,105 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Test</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
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <!-- font-family: 'Roboto' or 'Roboto Condensed', sans-serif; -->
11
+ <link href="https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Condensed:wght@700&display=swap" rel="stylesheet">
12
+ <!-- 'Redacted Script', cursive; -->
13
+ <link href="https://fonts.googleapis.com/css2?family=Redacted+Script:wght@300&display=swap" rel="stylesheet">
14
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
15
+ <link rel="stylesheet" href="/styles/main.css">
16
+ <link rel="stylesheet" href="/styles/menu.css">
17
+ <link rel="stylesheet" href="/styles/inventory.css">
18
+ <link rel="stylesheet" href="/styles/player.css">
19
+ <link rel="stylesheet" href="/styles/account.css">
20
+ <link rel="stylesheet" href="/styles/more.css">
21
+ <link rel="stylesheet" href="/styles/chat.css">
22
+ <script src="/js/base.js"></script>
23
+ </head>
24
+ <script>
25
+ const currentRoute = "<%- route %>";
26
+ </script>
27
+
28
+ <body>
29
+ <main>
30
+ <div class="chatter" id="adam"></div>
31
+ <input type="text" id="adam">
32
+ <button id="adam">Chat</button>
33
+ </main>
34
+ </body>
35
+
36
+ <script>
37
+ class Spirit {
38
+ constructor(name) {
39
+ this.name = name;
40
+ this.children = {};
41
+ }
42
+
43
+ addChild(child, parent) {
44
+ if (!this.children[child.name]) {
45
+ this.children[child.name] = 1;
46
+ }
47
+
48
+ this.children[child.name]++;
49
+ }
50
+ }
51
+
52
+ class Chatter {
53
+ constructor(id) {
54
+ this.name = id;
55
+ this.brain = new Spirit("i");
56
+ this.$div = $(`.chatter#${id}`);
57
+ this.$input = $(`input#${id}`);
58
+ this.$submit = $(`button#${id}`);
59
+
60
+ this.$submit.click(() => {
61
+ this.listen(this.$input.val());
62
+ });
63
+ }
64
+
65
+ register = (word) => {
66
+ if (!this.brain[word]) {
67
+ this.brain[word] = new Spirit(word);
68
+ }
69
+
70
+ return this.brain[word];
71
+ }
72
+
73
+ think = () => {
74
+
75
+ }
76
+
77
+ listen = (message) => {
78
+ message = message.toLowerCase();
79
+ let words = message.split(" ");
80
+
81
+ //add words to the dialogue tree
82
+ this.register(words[0]);
83
+ for (let i = 0; i < words.length; i++) {
84
+ if (i < words.length - 1) {
85
+ let child = this.register(words[i + 1]);
86
+ if (i > 0) this.brain[words[i]].addChild(child, this.brain[words[i - 1]]);
87
+ else this.brain[words[i]].addChild(child, null);
88
+ }
89
+ }
90
+
91
+ //think
92
+
93
+ this.respond(message);
94
+ }
95
+
96
+ respond(message) {
97
+ this.$div.append(`<p>${this.name}: ${message}</p>`);
98
+ }
99
+ }
100
+
101
+ const adam = new Chatter("adam");
102
+ adam.listen(`In the beginning God created the heavens and the earth`);
103
+ adam.listen("if i have the first two words in a three word relationship can the third word be guessed")
104
+ </script>
105
+ </html>
@@ -23,7 +23,7 @@
23
23
  Go inside
24
24
  </a>
25
25
 
26
- <a href="/the-front/check">
26
+ <a href="/check">
27
27
  Go to The Check
28
28
  </a>
29
29