summaryrefslogtreecommitdiff
path: root/htdocs/public
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-04 10:58:59 +0100
committerMinteck <contact@minteck.org>2021-12-04 10:58:59 +0100
commite618c3f52c1c4ae161650679cda24eecbba579bb (patch)
treea160a9f18847be1be73fb1c2ac2bc25b1e756e27 /htdocs/public
parentbce13ee94deb2a4914784bb4268dc1d7bc0f11ed (diff)
downloadrainbow-e618c3f52c1c4ae161650679cda24eecbba579bb.tar.gz
rainbow-e618c3f52c1c4ae161650679cda24eecbba579bb.tar.bz2
rainbow-e618c3f52c1c4ae161650679cda24eecbba579bb.zip
Code is now more cute!
Diffstat (limited to 'htdocs/public')
-rw-r--r--htdocs/public/TODO/index.ejs1
-rw-r--r--htdocs/public/archive/index.ejs23
-rw-r--r--htdocs/public/index.ejs8
-rw-r--r--htdocs/public/legal/index.ejs223
-rw-r--r--htdocs/public/metranslator/api/index.ejs33
-rw-r--r--htdocs/public/metranslator/index.ejs194
-rw-r--r--htdocs/public/projects/index.ejs35
7 files changed, 283 insertions, 234 deletions
diff --git a/htdocs/public/TODO/index.ejs b/htdocs/public/TODO/index.ejs
new file mode 100644
index 0000000..2e2dcaa
--- /dev/null
+++ b/htdocs/public/TODO/index.ejs
@@ -0,0 +1 @@
+<%- fs.readFileSync(serverRoot + "/TODO") %> \ No newline at end of file
diff --git a/htdocs/public/archive/index.ejs b/htdocs/public/archive/index.ejs
index 3fdda40..24af393 100644
--- a/htdocs/public/archive/index.ejs
+++ b/htdocs/public/archive/index.ejs
@@ -1,37 +1,32 @@
-<% global.title = "Archives"; %>
+<% global.title = lang.archives.title; %>
<%- include(`${private}/header.ejs`) %>
<a href="/">← Go back home</a>
<hr class="rnbwsquare-separator rnbwsquare-outer">
-<h1>Archives</h1>
-<!--<p>This is the page where all my active projects are, it is regularly updated from the projects I created on <a-->
-<!-- href="https://source.minteck.org" target="_blank">source.minteck.org</a>. For projects I don't maintain-->
-<!-- anymore, refer to the <a href="/archive">Archives</a> page.</p>-->
+<h1><%- lang.archives.title %></h1>
<div class="grid-3 projects">
<%
- const monthNames = ["January", "February", "March", "April", "May", "June",
- "July", "August", "September", "October", "November", "December"
- ];
+ const monthNames = lang.archives.months;
archives = [];
- for (let archive of fs.readdirSync(serverRoot + "/archives")) {
+ for (let archive of fs.readdirSync(serverRoot + "/data/archives")) {
data = {};
if (archive.endsWith(".json")) {
- json = JSON.parse(fs.readFileSync(serverRoot + "/archives/" + archive).toString())
+ json = JSON.parse(fs.readFileSync(serverRoot + "/data/archives/" + archive).toString())
data.id = archive.substr(0, archive.length - 5);
data.name = json.title;
- data.description = json.description.en;
+ data.description = json.description[slang] ?? json.description.en;
data.date = (json.date.substr(3) + json.date.substr(0, 2)) - 1 + 1;
if (json.unreleased) {
let date = new Date(json.date.substr(3) + "-" + json.date.substr(0, 2) + "-01");
- data.info = "<span style='color:gold;'>Never released</span> · " + monthNames[date.getMonth()] + " " + date.getFullYear();
+ data.info = "<span style='color:gold;'>" + lang.archives.never + "</span> · " + monthNames[date.getMonth()] + " " + date.getFullYear();
} else {
let date = new Date(json.date.substr(3) + "-" + json.date.substr(0, 2) + "-01");
- data.info = "Officially released · " + monthNames[date.getMonth()] + " " + date.getFullYear();
+ data.info = lang.archives.released + " · " + monthNames[date.getMonth()] + " " + date.getFullYear();
}
archives.push(data);
@@ -49,7 +44,7 @@
<a
href="https://archive.cdn.minteck.org/<%- archive.id %>.zip"
target="_blank"
- class="big-button big-button-bg3">Download</a>
+ class="big-button big-button-bg3"><%- lang.archives.download %></a>
</p>
<p style="text-align: center;"><small><%- archive.info %></small></p>
</div>
diff --git a/htdocs/public/index.ejs b/htdocs/public/index.ejs
index 59b21cd..a004f52 100644
--- a/htdocs/public/index.ejs
+++ b/htdocs/public/index.ejs
@@ -1,6 +1,8 @@
<% global.title = lang.main.page; %>
<%- include(`${private}/header.ejs`) %>
+<a href="/TODO">TODO</a>
+
<div id="intro" style="height:100vh;display:flex;align-items: center;justify-content: center;margin: -20px;">
<div style="text-align: center;">
<img src="/assets/sky.svg" class="sky">
@@ -28,7 +30,7 @@
<img src="/assets/icons/projects.svg" class="main-icon">
<h2 class="main-icon-sub"><%- lang.main.elements.projects.title %></h2>
<h3><%- lang.main.elements.projects.description %></h3>
- <a href="<%- slang %>/projects" class="big-button bb-main-mobile"><%- lang.main.elements.projects.action %> →</a>
+ <a href="https://gitlab.minteck.org/users/minteck/projects" target="_blank" class="big-button bb-main-mobile"><%- lang.main.elements.projects.action %> →</a>
</div>
<div style="text-align: center;">
<img src="/assets/icons/contact.svg" class="main-icon">
@@ -44,7 +46,7 @@
</div>
<div style="height: 41px;text-align: center;">
- <a href="<%- slang %>/projects" class="big-button bb-main-desktop"><%- lang.main.elements.projects.action %> →</a>
+ <a href="https://gitlab.minteck.org/users/minteck/projects" target="_blank" class="big-button bb-main-desktop"><%- lang.main.elements.projects.action %> →</a>
</div>
<div style="text-align: center;">
<a href="#/contact" class="big-button bb-main-desktop"><%- lang.main.elements.contact.action %> ↓</a>
@@ -210,7 +212,7 @@
<div style="text-align: center;">
<h2><%- lang.main.about.archives.title %></h2>
<h3><%- lang.main.about.archives.description %></h3>
- <a href="<%- slang %>/archive" target="_blank" class="big-button big-button-bg2"><%- lang.main.about.archives.action %> →</a>
+ <a href="<%- slang %>/archive" class="big-button big-button-bg2"><%- lang.main.about.archives.action %> →</a>
</div>
<div style="text-align: center;">
<h2><%- lang.main.about.general.title %></h2>
diff --git a/htdocs/public/legal/index.ejs b/htdocs/public/legal/index.ejs
index db9c215..6888391 100644
--- a/htdocs/public/legal/index.ejs
+++ b/htdocs/public/legal/index.ejs
@@ -1,20 +1,19 @@
-<% global.title = "Legal portal"; %>
+<% global.title = lang.legal.page; %>
<%- include(`${private}/header.ejs`) %>
-<a href="/">← Go back home</a>
+<a href="/">← <%- lang.global.back %></a>
<hr class="rnbwsquare-separator rnbwsquare-outer">
-<h1>Legal Portal</h1>
-<p>This is the page where all legal documents are posted. All the content is signed using a GPG key, it's very important
- that you check for the validity of the legal content you see on this website, as it may have been compromised.</p>
+<h1><%- lang.legal.intro.title %></h1>
+<p><%- lang.legal.intro.description %></p>
<details id="/pubkey">
- <summary style="cursor: pointer;">Click here to view my GPG public key (also get it from: <a
- href="https://source.minteck.org/minteck/minteck/raw/branch/trunk/GPG%20key">Git</a>, <a
+ <summary style="cursor: pointer;"><%- lang.legal.intro.pubkey.text %> (<%- lang.legal.intro.pubkey.other %> <a
+ href="https://gitlab.minteck.org/minteck/minteck/-/raw/trunk/GPG%20key">Git</a>, <a
href="https://bucket.minteck.org/gpg">CDN</a>)
</summary>
- <b>Fingerprint:</b> <code style="font-family: monospace;">AEA7 73DB 0620 C57C FFB0 7A91 EFBD C684 35A5
+ <b><%- lang.legal.intro.pubkey.fingerprint %></b> <code style="font-family: monospace;">AEA7 73DB 0620 C57C FFB0 7A91 EFBD C684 35A5
74B7</code><br>
<pre style="font-family:monospace;">
-----BEGIN PGP PUBLIC KEY BLOCK-----
@@ -94,11 +93,11 @@ t57Xl7Bb4NLwkD8v+gZillka+3NaYKbaQc9arUMiOWVrKKbAL+60YzlQKe2uHArX
<hr>
-<h2 id="/notices">Legal Notices</h2>
-<p>This website is developed, managed and hosted by:</p>
+<h2 id="/notices"><%- lang.legal.notices.title %></h2>
+<p><%- lang.legal.notices.content.intro %></p>
<ul>
- <li>Developed and edited by Minteck</li>
- <li>Server managed by Minteck
+ <li><%- lang.legal.notices.content.developer %></li>
+ <li><%- lang.legal.notices.content.management %>
<ul>
<li>Loiret<br>
Centre Val-de-Loire<br>
@@ -106,7 +105,7 @@ t57Xl7Bb4NLwkD8v+gZillka+3NaYKbaQc9arUMiOWVrKKbAL+60YzlQKe2uHArX
</li>
</ul>
</li>
- <li>Internet access managed by Orange SAS (RCS Nanterre 380 129 866)
+ <li><%- lang.legal.notices.content.isp %> Orange SAS (RCS Nanterre 380 129 866)
<ul>
<li>111, quai du Président Roosevelt<br>
92130 ISSY-LES-MOULINEAUX<br>
@@ -119,184 +118,45 @@ t57Xl7Bb4NLwkD8v+gZillka+3NaYKbaQc9arUMiOWVrKKbAL+60YzlQKe2uHArX
</li>
</ul>
-<details>
- <summary>GPG signed: Legal Notices</summary>
- <pre style="font-family:monospace;">
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
-Minteck.org Legal Notices
-=========================
-
-This website is developed, managed and hosted by:
-
-* Developed and edited by Minteck
-* Server managed by Minteck
- * Loiret
- Centre Val-de-Loire
- France
-* Internet access managed by Orange SAS (RCS Nanterre 380 129 866)
- * 111, quai du Président Roosevelt
- 92130 ISSY-LES-MOULINEAUX
- and domiciled for the purposes hereof
- 1 avenue Nelson Mandela
- 94745 ARCUEIL
- * +33 1 44 44 22 22
-
-This message is signed using a GPG key of which you can find the public key on:
-https://minteck.org/legal/#/pubkey
------BEGIN PGP SIGNATURE-----
-
-iQGzBAEBCAAdFiEErqdz2wYgxXz/sHqR773GhDWldLcFAmF+1I4ACgkQ773GhDWl
-dLfi/QwApgJnlscqUbYDeolQjVC++RHlhjYvELHLLCku0S0O20McbRTTMvo+ZRxB
-ubk5S8zr9Q9/1wBQ4CCqUpRzTLSioIu3tdN7uJp4WVF6YkWofCAih+tRF4NwVNDp
-pSi7MTzrRH226GRfyb/G6YXcuRXJniJPibt7P7GST2BKyv+lLhIQUaMSwcwWZKzu
-3i1Hc9tD1r0wLaZdaQivTaO4aLXYpKNW76qCH2hXerKsGArB+SEkC3Ul+AztiQkJ
-S9BGoVgHUaAA2FUzaw/mFWVeQNu3N1dWw+p+tsnrDulsQwf29601Y1G6scc2A/El
-GWq3hwWXvJYHG+WXqrw3i3pJN9EGAozV8lc9PicahNd3m/5h2PHdxrRtz+bzeKc0
-SIwfdsypoMkW1zKMtSki/MAvucg6X6tpLQdGova59bK/1UaKuA0KCVFTIuFc9HA4
-fQXxQ1KPZBrw0vJ2nTjnOCZOVIt0ikUhHHkvLZ3tsU8cSXOJOwCvacNV42wckCLt
-SajcnPKI
-=osNf
------END PGP SIGNATURE-----
- </pre>
-</details>
-
<hr>
-<h2 id="/terms">Terms and Conditions</h2>
-<p>The following Terms and Conditions apply to the following services:</p>
+<h2 id="/terms"><%- lang.legal.tos.title %></h2>
+<p><%- lang.legal.tos.content[0] %></p>
<ul>
- <li>Minteck Account</li>
+ <li><%- lang.legal.tos.content[1] %></li>
<li>Minteck Trunk</li>
<li>Kartik Online</li>
- <li>UnchainedTech Comments</li>
+ <li><%- lang.legal.tos.content[2] %></li>
</ul>
-<p>The Minteck services are made of an online authentication service delivered by Minteck that can extend the features
- of their
- projects (such as Kartik Online). The Minteck Account service is submitted to the following terms of use:</p>
+<p><%- lang.legal.tos.content[3] %></p>
-<p>You must not use Minteck Account and any connected application for the following purposes:</p>
+<p><%- lang.legal.tos.content[4] %></p>
<ul>
- <li>activity that is illegal in France</li>
- <li>prevent other users from accessing parts of the service or all the service</li>
- <li>try to circumvent security systems and escalate privileges</li>
- <li>publish private information of another user</li>
- <li>achieve a commercial or professional goal</li>
+ <li><%- lang.legal.tos.content[5] %></li>
+ <li><%- lang.legal.tos.content[6] %></li>
+ <li><%- lang.legal.tos.content[7] %></li>
+ <li><%- lang.legal.tos.content[8] %></li>
+ <li><%- lang.legal.tos.content[9] %></li>
</ul>
-<details>
- <summary>GPG signed: Terms and Conditions</summary>
- <pre style="font-family:monospace;">
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
-Minteck.org Terms and Conditions
-================================
-
-The following Terms and Conditions apply to the following services:
-
-* Minteck Account
-* Minteck Trunk
-* Kartik Online
-* UnchainedTech Comments
-
-The Minteck services are made of an online authentication service
-delivered by Minteck that can extend the features of their
-projects (such as Kartik Online). The Minteck Account service is
-submitted to the following terms of use:
-
-You must not use Minteck Account and any connected application for the
-following purposes:
-
-* activity that is illegal in France
-* prevent other users from accessing parts of the service or all the service
-* try to circumvent security systems and escalate privileges
-* publish private information of another user
-* achieve a commercial or professional goal
-
-This message is signed using a GPG key of which you can find the public key on:
-https://minteck.org/legal/#/pubkey
------BEGIN PGP SIGNATURE-----
-
-iQGzBAEBCAAdFiEErqdz2wYgxXz/sHqR773GhDWldLcFAmF+1t4ACgkQ773GhDWl
-dLdYJgwAnyt2y9B0Wm4MOvRKlalS1BGyvCS3mxVOTLiOoatZn6ZVZjzzi2e3hm/k
-lWU1p3W2j3ZthWoI3oF+6Jvx4TTfIrRbN22162faBw6HB+KUKyZvOZen32tel/yX
-+w3Hrre1UsO7C2TnIp2Z/t4NPY21P8a+NFYDHwDVRrneC6hjwi1URkn+2H5q4jdw
-aYPHeg+ewxHNMedW6+hfb5b1Jsx9xMYu0qA4ObOQhtpKoeTtfYh2IsoNSomTIuTg
-ZRlcDVmbZ+BS+f2J0LmcNPkSf51q8JtcM3Ksd7iCY3OqvV7LVjqXLYd8mPRbjBIa
-6IMc0f+IKsmxiKvp8I3FRyCLwgW3pW8i5yitlK35YtyJ+SyTnerGtwNjYlkYCZyu
-KKCIQ92+FrET1tBccDA0wM9Z/CBEdGOrtl01vmlKCjCnhQXN0YwhFaGRil0rrxXZ
-BnFt6reXJbSS3hTpwtVbWJ/Ygjp9JpVofssXuVhVatWd8gVo3V9YOur7ye0Zuo6H
-2Qr15MLe
-=dBYz
------END PGP SIGNATURE-----
- </pre>
-</details>
-
<hr>
-<h2 id="/privacy">Privacy Policy</h2>
-<p>We don't use your data other than to strictly provide the service you want. Period.</p>
-<p>The data we collect is only the data you explicitly give us access to (e.g. via a registration form) is kept for as
- long as you choose to keep the data on our servers. Upon deletion by the user, we ensure this data is
- removed from all of our servers.</p>
-<p>To enforce laws, we may collect additional data (IP address, URL, timestamps, operating system, browser version) upon
- identification of suspicious activity. This data is deleted every year near January. You can require early deletion
- of this data if we think there hasn't been any dangerous activity by sending an email to <a
- href="mailto:legal@minteck.org">legal@minteck.org</a></p>
-
-<details>
- <summary>GPG signed: Privacy Policy</summary>
- <pre style="font-family:monospace;">
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
-Minteck.org Privacy Policy
-==========================
-
-We don't use your data other than to strictly provide the service you want. Period.
-
-The data we collect is only the data you explicitly give us access to (e.g. via a
-registration form) is kept for as long as you choose to keep the data on our
-servers. Upon deletion by the user, we ensure this data is removed from all of our
-servers.
-
-To enforce laws, we may collect additional data (IP address, URL, timestamps,
-operating system, browser version) upon identification of suspicious activity. This
-data is deleted every year near January. You can require early deletion of this data
-if we think there hasn't been any dangerous activity by sending an email to:
-legal@minteck.org
------BEGIN PGP SIGNATURE-----
-
-iQGzBAEBCAAdFiEErqdz2wYgxXz/sHqR773GhDWldLcFAmF+9UsACgkQ773GhDWl
-dLfjvgv/Q5ZvxcnPfQ6Hr/CTD2BgLq8yd2zRn8/f/zuloNZWNuuUqV9kgbe3GVT5
-7Bj8nP/XvHW8i7KQOt2ZuMPUEZDpQDrdOjEP79GnGYvq+YpkATk+rKOgS/656GMr
-mT5o78CFdVptscKqmyq+O4B82W2RmvovTNe4yyDmDeRDNno3XuAuBiS6OK4QMf7d
-/K4W4LkHmxBaMypimHAqO7UCalTjeRBPPgC/h7/c7c9a/7F+PzAZbtuU8LGNKC4n
-mzZZhn12Vc8L80DWFPIrXw/FhR9MFqFd8FZ9xVC/g5ann6PUqp+DqXOTTt+rW6BK
-C9p5lidQBb5Tsb3mn3RZQIpumbuy5WkTQp2goUn/3DQXGj/wLP15oGMcExKoK73J
-xePZ60AAypxIy01bIxZ6OP5n2evJsqMs2QY+RPbBzZmhtUMFwWMporzfwcCHB6Qx
-j5jQhAxfCvrbS9RJbN8AQ//Gs+CgW4pIlTn8f0QCYvNS+L3vususfokLRxeTYQFC
-LjxKOq2a
-=HIPo
------END PGP SIGNATURE-----
- </pre>
-</details>
+<h2 id="/privacy"><%- lang.legal.privacy.title %></h2>
+<p><%- lang.legal.privacy.content[0] %></p>
+<p><%- lang.legal.privacy.content[1] %></p>
+<p><%- lang.legal.privacy.content[2].replace("%1", "<a href='mailto:legal@minteck.org'>").replace("%2", "</a>") %></p>
<hr>
-<h2 id="/warrant">Warrant Canary</h2>
-<details>
- <summary>Show warrant canary</summary>
- <pre style="font-family:monospace;">
+<h2 id="/warrant"><%- lang.legal.warrant.title %></h2>
+<pre style="font-family:monospace;">
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Minteck.org Warrant Canary
==========================
-As of 2021-11-01, Minteck (minteck.org) &lt;legal@minteck.org&gt;
+As of 2021-12-01, Minteck (minteck.org) &lt;legal@minteck.org&gt;
has received no requests from any government agencies.
This message is updated every month between the 1st and 7th
@@ -306,18 +166,17 @@ This message is signed using a GPG key of which you can find the public key on:
https://minteck.org/legal/#/pubkey
-----BEGIN PGP SIGNATURE-----
-iQGzBAEBCAAdFiEErqdz2wYgxXz/sHqR773GhDWldLcFAmF+3J4ACgkQ773GhDWl
-dLe5Mwv9Exai8UC9N8/6c6yylch2AF6qC1uVDsk1vrzemuIgpbSKffh53p9tdy5E
-wh6OQr51+F/8c6DW45RkmjR1q6W07n9HIMnYOp/LdhVR+iemRopJ5DF5ppmkIR9T
-uU++XZ8Sxo/TVdjUo2rCIhk/55Dgg+ZtdR96XqeE4y5VBgYTuQzcjYNHDvVEEiNB
-k2WmxtUU1aLPrR1E5e+Nt335Kkr3yUTWj2nK793gmAjr2haHC6Xqm3tSTcUBo9qc
-1Vv7sjoPGgTcd/sDwQPzW7RQXlh5ipuPvnmDY5CGLEvlalME4JDeOQF5IFCDqsh6
-RWO118Pp/YLjBFh5lpwkwwePIfPnakNA1QlnfVw/25w63es3JZ8TQ6j7W2iGJCjZ
-SY/iwxOdxypfDQzL8d1mtK1QHPUqwgJSGZdDoXHHpsMwFAvPhgB9T6pFHFGNombK
-RsSq7z80WAXn2SAZCYLO1tvdUdfxBSOvZadAcjP/PX4Mvy5Lokr0uRp92iCImxLZ
-9Try1VLC
-=+ld4
+iQGzBAEBCAAdFiEErqdz2wYgxXz/sHqR773GhDWldLcFAmGn6UoACgkQ773GhDWl
+dLfQJwv+NJhVqG/76EQEukj1i/roC4FCXWEYnQEWpS09NjnE9sFXF6F69TLpilJU
+iJO8P8gSRlMAxFXYNrW/vscGqNfCru+DQyzaqYAijTk+aY429hZgm6t6R+c28Mn3
+jjRE+wBHisE3cvWUqUt5rxKdgMmzTK/aVDUsoYp6IxDCmtpRajhVaylgHZ9iSVgh
+DxfpYCEWD4kTKMcUUJz5ytIMHphQHDA9/L0D4ixQrqil/38nbrjFrNP0i7puXxMg
+sZ0FXd+gsvg03BHWzJzJNuLJJ1+kv1gt3Ng7X36uF0gtzF4xUvv8SU4o6Jsv6xjy
+Vs38e+c9DWn4BPlZH7Y2z1i1/tZPEADJysC3yCRnbYZ461mehGtbQkAsIpWyG0n2
+kOmxOAB18MKNzdcxbssLgJge5l4bu3NnFYw08+Wm4YPJEU85uQJ/b9rlYY35qq8+
+iQJ0/WHIR7vyMlizI75E+rEoJ3UvpbUgKD4qDlynD46SiMMawv1gNZ6Vh3B6Hdo3
+ADIB0mxm
+=CJH7
-----END PGP SIGNATURE-----
</pre>
-</details>
<%- include(`${private}/footer.ejs`) %> \ No newline at end of file
diff --git a/htdocs/public/metranslator/api/index.ejs b/htdocs/public/metranslator/api/index.ejs
new file mode 100644
index 0000000..47800bd
--- /dev/null
+++ b/htdocs/public/metranslator/api/index.ejs
@@ -0,0 +1,33 @@
+<%
+
+ res.writeHead(200, {'Content-Type': "application/json"});
+
+ if (get['t']) {
+ if (get['t'] === "en") {
+ target = "en";
+ } else {
+ target = "mt";
+ }
+ } else {
+ res.end();
+ }
+
+ if (get['u']) {
+ text = get['u'];
+
+ if (text.length > 500) {
+ res.end();
+ }
+
+ text = text.split("\"").join("''");
+ } else {
+ res.end();
+ }
+
+ aw = JSON.parse(child_process.execSync(`cd /mnt/metranslator-api && node index.js api ${target} "${text}"`).toString());
+ last = child_process.execSync("cd /mnt/metranslator-api && git log -1 --pretty=format:'%an'")
+ aw["system"]["version"] = aw["system"]["version"] + "-" + fs.readFileSync("/mnt/metranslator-api/.git/refs/heads/trunk").toString().substr(0, 8);
+ aw["system"]["last_author"] = last;
+ aw["call"] = "cd /mnt/metranslator-api && node index.js api {$target} \"{$text}\"";
+
+ %><%- JSON.stringify(aw); %> \ No newline at end of file
diff --git a/htdocs/public/metranslator/index.ejs b/htdocs/public/metranslator/index.ejs
new file mode 100644
index 0000000..943d772
--- /dev/null
+++ b/htdocs/public/metranslator/index.ejs
@@ -0,0 +1,194 @@
+<% global.title = "MeTranslator"; %>
+<%- include(`${private}/header.ejs`) %>
+
+<a href="/">← <%- lang.global.back %></a>
+
+<hr class="rnbwsquare-separator rnbwsquare-outer">
+
+<div class="container" style="min-height: 100vh;margin-left: 5vw;margin-right: 5vw;">
+ <style>
+ mark {
+ background: transparent;
+ color: #ff6161;
+ padding: 0;
+ font-weight: bold;
+ }
+ </style>
+
+ <h2 style="text-align:center;">Metroz Translate</h2>
+ <p style="text-align:center;">💡 <i>Click one of the languages to invert</i></p>
+ <div style="display:grid;grid-template-columns: 1fr 1fr;background:#111;padding-top:10px;border-radius:5px;">
+ <div>
+ <a style="cursor:pointer;color: white !important; text-decoration: none;" onclick="switchLangs();"><p
+ id="lang-source"
+ style="text-align:center;font-weight:bold;">
+ English</p></a>
+ <textarea maxlength="500" placeholder="Start typing here..." onresize="resizeTarget();"
+ onchange="process();"
+ onkeydown="process();" onkeyup="process();"
+ id="text-source"
+ style="padding:20px;outline:none;overflow:hidden;resize:none;background: #222;border: none;width: 100%;margin-bottom: -3px;color: #eee;border-right:1px solid #151515;"></textarea>
+ <script>document.getElementById('text-source').value = "";</script>
+ </div>
+ <div>
+ <a style="cursor:pointer;color: white !important; text-decoration: none;" onclick="switchLangs();"><p
+ id="lang-target"
+ style="text-align:center;font-weight:bold;">
+ Metroz</p></a>
+ <div id="text-target" disabled
+ style="padding:20px;outline:none;overflow:hidden;resize: none;background: #222;border: none;width: 100%;margin-bottom: -3px;color: #eee;"></div>
+ <script>document.getElementById('text-target').innerText = "";</script>
+ </div>
+ </div>
+ <div id="facts"
+ style="background:#424242;padding: 3px 10px;width:100%;border-bottom-left-radius:5px;border-bottom-right-radius:5px;">
+ <span id="facts-inner">No facts available about this text</span>
+ </div>
+
+ <details style="margin-top:20px;">
+ <summary>Translator Insights</summary>
+ <ul>
+ <li>Database Name: <span id="insights-01">n/a</span></li>
+ <li>Database Version: <span id="insights-02">n/a</span></li>
+ <li>Database Size: <span id="insights-03">n/a</span></li>
+ <li>Processing Time: <span id="insights-04">n/a</span></li>
+ </ul>
+ </details>
+</div>
+
+<script>
+
+ function switchLangs() {
+ if (document.getElementById("text-target").innerHTML === "...") return;
+
+ tval = document.getElementById("text-target").innerText;
+ sval = document.getElementById("text-source").value;
+
+ document.getElementById("text-target").innerText = "...";
+ document.getElementById("text-source").value = tval;
+
+ if (document.getElementById("lang-target").innerText === "English") {
+ document.getElementById("lang-target").innerText = "Metroz";
+ document.getElementById("lang-source").innerText = "English";
+ } else {
+ document.getElementById("lang-source").innerText = "Metroz";
+ document.getElementById("lang-target").innerText = "English";
+ }
+
+ translate();
+ }
+
+ typing = false;
+
+ function startTyping() {
+ typing = true;
+ document.getElementById("facts-inner").innerText = "Waiting for end of input...";
+ document.getElementById("text-target").innerText = "...";
+ }
+
+ function stopTyping() {
+ typing = false;
+ translate();
+ }
+
+ setInterval(() => {
+ if (typing) stopTyping();
+ }, 2000)
+
+ function translate() {
+ if (document.getElementById("text-source").value.trim() === "") {
+ document.getElementById("facts-inner").innerText = "No facts available for this text";
+ document.getElementById("text-target").innerText = "";
+ return;
+ }
+
+ document.getElementById("facts-inner").innerText = "Translating...";
+ document.getElementById("text-target").innerText = "...";
+
+ if (document.getElementById("lang-target").innerText === "English") {
+ target = "en";
+ } else {
+ target = "mt";
+ }
+
+ document.getElementById("insights-01").innerText = "n/a";
+ document.getElementById("insights-02").innerText = "n/a";
+ document.getElementById("insights-03").innerText = "n/a";
+ document.getElementById("insights-04").innerText = "n/a";
+
+ window.fetch("/<%- slang %>/metranslator/api?t=" + target + "&u=" + encodeURI(document.getElementById("text-source").value)).then((a) => {
+ a.blob().then((b) => {
+ b.text().then((c) => {
+ try {
+ data = JSON.parse(c);
+
+ words = data.output.split(" ");
+ newds = [];
+ initw = document.getElementById("text-source").value.toLowerCase().split(" ");
+
+ for (word of words) {
+ if (initw.includes(word)) {
+ newds.push("<mark>" + word + "</mark>");
+ data.facts.push("The word '" + word + "' does not have a translation in " + document.getElementById("lang-target").innerText)
+ } else {
+ newds.push(word);
+ }
+ }
+
+ if (data.facts.length > 0) {
+ document.getElementById("facts-inner").innerHTML = "<ul style='margin-bottom: 0;'><li>" + data.facts.join("</li><li>") + "</li></ul>";
+ } else {
+ document.getElementById("facts-inner").innerText = "No facts available for this text";
+ }
+
+ document.getElementById("text-target").innerHTML = newds.join(" ");
+ } catch (e) {
+ console.error(e);
+ document.getElementById("text-target").innerHTML = "<i>An error occurred, please try again later<ul><li>You are a developer? Additional details have been displayed in the console</li><li>You are a regular user? Contact the administrators so they fix the problem</li></ul></i>";
+ document.getElementById("facts-inner").innerText = "No facts available for this text";
+ document.getElementById("insights-01").innerText = "n/a";
+ document.getElementById("insights-02").innerText = "n/a";
+ document.getElementById("insights-03").innerText = "n/a";
+ document.getElementById("insights-04").innerText = "n/a";
+ }
+
+ if (data.system.version.startsWith("-")) {
+ document.getElementById("insights-01").innerText = "n/a";
+ document.getElementById("insights-02").innerText = "n/a";
+ document.getElementById("insights-03").innerText = "n/a";
+ document.getElementById("insights-04").innerText = "n/a";
+ } else {
+ document.getElementById("insights-01").innerText = data.system.name;
+ document.getElementById("insights-02").innerText = data.system.version + " (last update by " + data.system.last_author + ")";
+ document.getElementById("insights-03").innerText = data.system.length + " entries";
+ document.getElementById("insights-04").innerText = data.duration + " ms";
+ }
+ resizeTarget()
+
+ if (data.system.version.startsWith("-")) {
+ document.getElementById("insights-01").innerText = "n/a";
+ document.getElementById("insights-02").innerText = "n/a";
+ document.getElementById("insights-03").innerText = "n/a";
+ document.getElementById("insights-04").innerText = "n/a";
+ }
+ })
+ })
+ })
+ }
+
+ function process() {
+ resizeTarget()
+ startTyping()
+ }
+
+ function resizeTarget() {
+ size = 167;
+
+ document.getElementById("text-source").style.height = size + "px";
+ document.getElementById("text-target").style.height = size + "px";
+ }
+
+ resizeTarget()
+
+</script>
+<%- include(`${private}/footer.ejs`) %> \ No newline at end of file
diff --git a/htdocs/public/projects/index.ejs b/htdocs/public/projects/index.ejs
deleted file mode 100644
index 88749f9..0000000
--- a/htdocs/public/projects/index.ejs
+++ /dev/null
@@ -1,35 +0,0 @@
-<% global.title = "Projects"; %>
-<%- include(`${private}/header.ejs`) %>
-
-<a href="/">← Go back home</a>
-
-<hr class="rnbwsquare-separator rnbwsquare-outer">
-
-<h1>Projects</h1>
-<p>This is the page where all my active projects are, it is regularly updated from the projects I created on <a
- href="https://source.minteck.org" target="_blank">source.minteck.org</a>. For projects I don't maintain
- anymore, refer to the <a href="/archive">Archives</a> page.</p>
-
-<div class="grid-3 projects">
- <% for (let project of JSON.parse(fs.readFileSync(serverRoot + "/global/gitea.json").toString()).sort((a, b) => a.update - b.update).reverse()) { %>
- <div class="project">
- <img class="project-icon" src="<%- project.icon ?? "/assets/icons/project.svg" %>">
- <h2 class="project-name"><%- project.name %></h2>
- <p class="project-description"><%- project.description %></p>
- <p class="project-buttons">
- <% if (project.website !== null) { %>
- <a href="<%- project.website %>" target="_blank" class="big-button big-button-bg3 big-button-pt1">Website
- </a><a
- href="https://source.minteck.org/<%- project.id %>" target="_blank"
- class="big-button big-button-bg3 big-button-pt2">View</a>
- <% } else { %>
- <a
- href="https://source.minteck.org/<%- project.id %>" target="_blank"
- class="big-button big-button-bg3">View</a>
- <% } %>
- </p>
- </div>
- <% } %>
-</div>
-
-<%- include(`${private}/footer.ejs`) %> \ No newline at end of file