-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
176 lines (168 loc) · 5.13 KB
/
script.js
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
// Berry Foundations
home = `
<div class="banner">
<center>
<img id="Berry" src="Berry.png">
<h1>Berry Foundations</h1>
</center>
</div>
`;
about = `
<div class="about">
<center>
<img id="Berry" src="Berry.png">
<h1>What is Berry Foundations?</h1>
<p>
Berry Foundations is a bot development organization.
Here various bots are created.
For safety, connecting, fun and more stuff.
</p>
<h1>Purpose of Berry Bots</h1>
<p>
These bots are made to innovate.
To stop wasting time on simple things.
The intension is not to replace humans.
The intension is to make something useful, globally.
</p>
<h1>Bots and Services Prices</h1>
<p>
For most of the bots, they are completely free to use.
At least for the software part, that is completely free.
For services other than bot, that may depend.
Visiting policies is suggested.
</p>
</center>
</div>
`;
bots = `
<div class="bots">
<center>
<img id="Berry" src="Berry.png">
<h1>Berry Bots</h1>
<h1>Loading Bots...</h1>
</center>
</div>
`;
policy = `
<div class="privacy">
<center>
<img id="Berry" src="Berry.png">
<h1>Berry Policies</h1>
<p>
Berry Tech has some policies it follows.
This includes terms and conditions.
These exist for user safety, safety for content rights and other rights.
All bots follow these policies and in case they don't, the policy not followed will be mentioned.
</p>
<h1>Loading Policies...</h1>
</center>
</div>
`;
function changePage(to) {
content = document.getElementById("content");
if (to.toLowerCase() === "question") {
content.innerHTML = about;
} else if (to.toLowerCase() === "robot") {
content.innerHTML = bots;
fetch("bots.json").then(req => req.json()).then(data => {
bots = `
<div class="bots">
<center>
<img id="Berry" src="Berry.png">
<h1>Berry Bots</h1>
`;
for (let bot of data[0]["bots"]) {
bot_card_template = `
<div class="bot-card" style="background: ${bot["color"]["main"]};">
<img class="bot-card-img" src="${bot["icon"]}" `;
if (bot["color"]["need"]) {
bot_card_template += `style="background: ${bot["color"]["extra"]}"`;
}
bot_card_template += `>
</img>
<p class="bot-card-title" style="color: ${bot["color"]["font"]};">
${bot["name"]}
<br>
`;
if (bot["type"] === "discord") {
bot_card_template += `<i class="bot-card-ux fas fa-external-link-alt" onclick="window.open('${bot["links"]["website"]}')"></i>
<i class="bot-card-ux fas fa-plus" onclick="window.open('${bot["links"]["add"]}')"></i>
<i class='fab fa-discord fa-xs' style='opacity: 25%;'></i>
`;
}
bot_card_template += `</p>
</div>
`;
bots += bot_card_template;
}
bots += `</center>
</div>`;
content.innerHTML = bots;
});
} else if (to.toLowerCase() === "shield") {
content.innerHTML = policy;
fetch("policy/user-safety.md").then(req => req.text()).then(data => {
policy = `<div class="privacy">
<center>
<img id="Berry" src="Berry.png">
<h1>Berry Policies</h1>
<p>
Berry Tech has some policies it follows.
This includes terms and conditions.
These exist for user safety, safety for content rights and other rights.
All bots follow these policies and in case they don't, the policy not followed will be mentioned.
</p>
<h1>User Safety</h1>
<p class="policy-content">
`;
for (let line of data.split('\n')) {
policy += line + `<br>`;
}
policy += `</p><h1>Content Rights</h1><p class="policy-content">`;
fetch('policy/content-rights.md').then(req2 => req2.text()).then(data2 => {
for (let line of data2.split('\n')) {
policy += line + `<br>`;
}
policy += `</p><h1>Bot Rights</h1><p class="policy-content">`;
fetch('policy/bot-rights.md').then(req3 => req3.text()).then(data3 => {
for (let line of data3.split('\n')) {
policy += line + `<br>`;
}
policy += `</p><h1>Report Actions</h1><p class="policy-content">`;
fetch('policy/report-actions.md').then(req5 => req5.text()).then(data5 => {
for (let line of data5.split('\n')) {
policy += line + `<br>`;
}
policy += `</p><h1>Licensing</h1><p class="policy-content">`;
fetch('policy/licensing.md').then(req6 => req6.text()).then(data6 => {
for (let line of data6.split('\n')) {
policy += line + `<br>`;
}
policy += `</p><h1>Real Bot Identification</h1><p class="policy-content">`;
fetch('policy/rbi-auth.md').then(req7 => req7.text()).then(data7 => {
for (let line of data7.split('\n')) {
policy += line + `<br>`;
}
policy += `</p></center></div>`;
content.innerHTML = policy;
});
});
});
});
});
});
} else {
content.innerHTML = home;
}
}
changePage('asia');
if (location.href.includes("?")) {
__content = location.href.split('?')[1];
if (__content.toLowerCase() === "info") {
changePage('question');
} else if (__content.toLowerCase() === "bots") {
changePage('robot');
} else if (__content.toLowerCase() === "policy") {
changePage('shield');
}
}