2024-01-14 15:08:38 -05:00
|
|
|
<!--
|
|
|
|
This Source Code Form is subject to the terms of the GNU General Public License:
|
|
|
|
|
|
|
|
Copyright (C) 2021-2024 PokeTube (https://codeberg.org/Ashley/poketube)
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
|
|
|
-->
|
2024-01-13 15:55:18 -05:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>PokeTranslate</title>
|
|
|
|
<link rel="icon" href="/static/yt-ukraine.svg">
|
2024-01-14 15:08:38 -05:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<meta content="PokeTranslate" property=og:title>
|
|
|
|
<meta content="Translate text - Anonymously!" property=twitter:description>
|
2024-10-04 15:07:49 -04:00
|
|
|
<meta content="https://cdn.glitch.global/d68d17bb-f2c0-4bc3-993f-50902734f652/aa70111e-5bcd-4379-8b23-332a33012b78.image.png?v=1701898829884" property="og:image" />
|
2024-01-14 15:08:38 -05:00
|
|
|
<meta content=summary_large_image name=twitter:card>
|
2024-01-13 15:55:18 -05:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'">
|
2024-10-04 15:07:49 -04:00
|
|
|
<meta name="referrer" content="no-referrer">
|
2024-01-14 15:08:38 -05:00
|
|
|
<link rel="manifest" href="/manifest.json">
|
2024-10-04 15:07:49 -04:00
|
|
|
<link rel="stylesheet" href="/static/calendar-page-style.css">
|
2024-01-13 15:55:18 -05:00
|
|
|
<style>
|
2024-10-04 15:07:49 -04:00
|
|
|
body {
|
|
|
|
background-color: #212529;
|
|
|
|
color: #f8f9fa;
|
|
|
|
font-family: sans-serif;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
height: 100vh;
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
.container {
|
|
|
|
max-width: 1200px;
|
|
|
|
width: 100%;
|
|
|
|
padding: 1em;
|
|
|
|
background-color: #1a1a1a;
|
|
|
|
border-radius: 1em;
|
|
|
|
margin-top: 2em;
|
|
|
|
}
|
2024-01-13 15:55:18 -05:00
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
header {
|
|
|
|
text-align: center;
|
|
|
|
margin-bottom: 1em;
|
|
|
|
}
|
2024-01-13 15:55:18 -05:00
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
header h1 {
|
|
|
|
font-size: 2rem;
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
form {
|
|
|
|
display: grid;
|
|
|
|
gap: 1.5em;
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
.languages {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
gap: 1em;
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
select {
|
|
|
|
border-radius: 1em;
|
|
|
|
padding: 10px;
|
|
|
|
background-color: #131618;
|
|
|
|
color: #f8f9fa;
|
|
|
|
border: 2px solid #495057;
|
|
|
|
width: 100%;
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
textarea {
|
2024-10-04 15:07:49 -04:00
|
|
|
width: 100%;
|
|
|
|
resize: vertical;
|
|
|
|
padding: 1em;
|
|
|
|
font-size: 1rem;
|
|
|
|
border-radius: 1em;
|
|
|
|
border: 2px solid #495057;
|
2024-01-13 15:55:18 -05:00
|
|
|
background-color: #131618;
|
|
|
|
color: #f8f9fa;
|
|
|
|
}
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
.center {
|
|
|
|
text-align: center;
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
button {
|
|
|
|
padding: 10px 20px;
|
|
|
|
font-size: 1rem;
|
|
|
|
border: 2px solid #888888;
|
|
|
|
border-radius: 1em;
|
|
|
|
background-color: #131618;
|
|
|
|
color: #f8f9fa;
|
|
|
|
cursor: pointer;
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
button:hover {
|
|
|
|
background-color: #478061;
|
|
|
|
border-color: #478061;
|
|
|
|
color: #ffffff;
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
@media screen and (max-width: 768px) {
|
|
|
|
.container {
|
|
|
|
padding: 1em;
|
|
|
|
}
|
|
|
|
|
|
|
|
header h1 {
|
|
|
|
font-size: 1.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.languages {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
button {
|
|
|
|
width: 100%;
|
|
|
|
}
|
2024-01-13 15:55:18 -05:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2024-10-04 15:07:49 -04:00
|
|
|
<div class="container">
|
|
|
|
<header>
|
|
|
|
<h1>PokeTranslate</h1>
|
|
|
|
</header>
|
2024-01-13 15:55:18 -05:00
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
|
2024-01-13 15:55:18 -05:00
|
|
|
<% const languageOptions = [
|
|
|
|
{ code: 'autodetect', name: 'Autodetect' },
|
|
|
|
{ code: 'af', name: 'Afrikaans' },
|
|
|
|
{ code: 'sq', name: 'Albanian' },
|
|
|
|
{ code: 'am', name: 'Amharic' },
|
|
|
|
{ code: 'ar', name: 'Arabic' },
|
|
|
|
{ code: 'hy', name: 'Armenian' },
|
|
|
|
{ code: 'as', name: 'Assamese' },
|
|
|
|
{ code: 'ay', name: 'Aymara' },
|
|
|
|
{ code: 'az', name: 'Azerbaijani' },
|
|
|
|
{ code: 'bm', name: 'Bambara' },
|
|
|
|
{ code: 'eu', name: 'Basque' },
|
|
|
|
{ code: 'be', name: 'Belarusian' },
|
|
|
|
{ code: 'bn', name: 'Bengali' },
|
|
|
|
{ code: 'bh', name: 'Bhojpuri' },
|
|
|
|
{ code: 'bs', name: 'Bosnian' },
|
|
|
|
{ code: 'bg', name: 'Bulgarian' },
|
|
|
|
{ code: 'ca', name: 'Catalan' },
|
|
|
|
{ code: 'ceb', name: 'Cebuano' },
|
|
|
|
{ code: 'ny', name: 'Chichewa' },
|
|
|
|
{ code: 'zh-cn', name: 'Chinese (Simplified)' },
|
|
|
|
{ code: 'zh-tw', name: 'Chinese (Traditional)' },
|
|
|
|
{ code: 'co', name: 'Corsican' },
|
|
|
|
{ code: 'hr', name: 'Croatian' },
|
|
|
|
{ code: 'cs', name: 'Czech' },
|
|
|
|
{ code: 'da', name: 'Danish' },
|
|
|
|
{ code: 'dv', name: 'Dhivehi' },
|
|
|
|
{ code: 'doi', name: 'Dogri' },
|
|
|
|
{ code: 'nl', name: 'Dutch' },
|
|
|
|
{ code: 'en', name: 'English' },
|
|
|
|
{ code: 'eo', name: 'Esperanto' },
|
|
|
|
{ code: 'et', name: 'Estonian' },
|
|
|
|
{ code: 'ee', name: 'Ewe' },
|
|
|
|
{ code: 'tl', name: 'Filipino' },
|
|
|
|
{ code: 'fi', name: 'Finnish' },
|
|
|
|
{ code: 'fr', name: 'French' },
|
|
|
|
{ code: 'fy', name: 'Frisian' },
|
|
|
|
{ code: 'gl', name: 'Galician' },
|
|
|
|
{ code: 'ka', name: 'Georgian' },
|
|
|
|
{ code: 'de', name: 'German' },
|
|
|
|
{ code: 'el', name: 'Greek' },
|
|
|
|
{ code: 'gn', name: 'Guarani' },
|
|
|
|
{ code: 'gu', name: 'Gujarati' },
|
|
|
|
{ code: 'ht', name: 'Haitian Creole' },
|
|
|
|
{ code: 'ha', name: 'Hausa' },
|
|
|
|
{ code: 'haw', name: 'Hawaiian' },
|
|
|
|
{ code: 'he', name: 'Hebrew' },
|
|
|
|
{ code: 'hi', name: 'Hindi' },
|
|
|
|
{ code: 'hmn', name: 'Hmong' },
|
|
|
|
{ code: 'hu', name: 'Hungarian' },
|
|
|
|
{ code: 'is', name: 'Icelandic' },
|
|
|
|
{ code: 'ig', name: 'Igbo' },
|
|
|
|
{ code: 'ilo', name: 'Ilocano' },
|
|
|
|
{ code: 'id', name: 'Indonesian' },
|
|
|
|
{ code: 'ga', name: 'Irish' },
|
|
|
|
{ code: 'it', name: 'Italian' },
|
|
|
|
{ code: 'ja', name: 'Japanese' },
|
|
|
|
{ code: 'jv', name: 'Javanese' },
|
|
|
|
{ code: 'kn', name: 'Kannada' },
|
|
|
|
{ code: 'kk', name: 'Kazakh' },
|
|
|
|
{ code: 'km', name: 'Khmer' },
|
|
|
|
{ code: 'rw', name: 'Kinyarwanda' },
|
|
|
|
{ code: 'kok', name: 'Konkani' },
|
|
|
|
{ code: 'ko', name: 'Korean' },
|
|
|
|
{ code: 'kri', name: 'Krio' },
|
|
|
|
{ code: 'ku', name: 'Kurdish (Kurmanji)' },
|
|
|
|
{ code: 'sd', name: 'Sindhi' },
|
|
|
|
{ code: 'si', name: 'Sinhala' },
|
|
|
|
{ code: 'sk', name: 'Slovak' },
|
|
|
|
{ code: 'sl', name: 'Slovenian' },
|
|
|
|
{ code: 'so', name: 'Somali' },
|
|
|
|
{ code: 'es', name: 'Spanish' },
|
|
|
|
{ code: 'su', name: 'Sundanese' },
|
|
|
|
{ code: 'sw', name: 'Swahili' },
|
|
|
|
{ code: 'sv', name: 'Swedish' },
|
|
|
|
{ code: 'tg', name: 'Tajik' },
|
|
|
|
{ code: 'ta', name: 'Tamil' },
|
|
|
|
{ code: 'tt', name: 'Tatar' },
|
|
|
|
{ code: 'te', name: 'Telugu' },
|
|
|
|
{ code: 'th', name: 'Thai' },
|
|
|
|
{ code: 'ti', name: 'Tigrinya' },
|
|
|
|
{ code: 'ts', name: 'Tsonga' },
|
|
|
|
{ code: 'tr', name: 'Turkish' },
|
|
|
|
{ code: 'tk', name: 'Turkmen' },
|
|
|
|
{ code: 'twi', name: 'Twi' },
|
|
|
|
{ code: 'uk', name: 'Ukrainian' },
|
|
|
|
{ code: 'ur', name: 'Urdu' },
|
|
|
|
{ code: 'ug', name: 'Uyghur' },
|
|
|
|
{ code: 'uz', name: 'Uzbek' },
|
|
|
|
{ code: 'vi', name: 'Vietnamese' },
|
|
|
|
{ code: 'cy', name: 'Welsh' },
|
|
|
|
{ code: 'xh', name: 'Xhosa' },
|
|
|
|
{ code: 'yi', name: 'Yiddish' },
|
|
|
|
{ code: 'yo', name: 'Yoruba' },
|
|
|
|
{ code: 'zu', name: 'Zulu' }
|
|
|
|
]; %>
|
|
|
|
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
<form action="/translate" method="GET" id="translation-form">
|
|
|
|
<div class="languages">
|
|
|
|
<!-- Source language select -->
|
|
|
|
<select name="from_language" id="from_language" aria-label="Source language">
|
|
|
|
<% languageOptions.forEach(language => { %>
|
|
|
|
<option value="<%= language.code %>" <%= language.code === (from_language || 'autodetect') ? 'selected' : '' %>><%= language.name %></option>
|
|
|
|
<% }); %>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- Target language select -->
|
|
|
|
<select name="to_language" id="to_language" aria-label="Target language">
|
|
|
|
<% languageOptions.slice(1).forEach(language => { %>
|
|
|
|
<option value="<%= language.code %>" <%= language.code === to_language ? 'selected' : '' %>><%= language.name %></option>
|
|
|
|
<% }); %>
|
|
|
|
</select>
|
2024-01-13 15:55:18 -05:00
|
|
|
</div>
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
<textarea autofocus class="item" id="input" name="input" dir="auto" placeholder="<%- text %>"><%- text %></textarea>
|
2024-01-13 15:55:18 -05:00
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
<textarea id="output" class="translation item" dir="auto" placeholder="Translation" readonly><%- translation %></textarea>
|
2024-01-13 15:55:18 -05:00
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
<div class="center">
|
|
|
|
<!-- translate button -->
|
|
|
|
<button type="submit">Translate :3</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2024-01-13 15:55:18 -05:00
|
|
|
|
|
|
|
<script>
|
2024-10-04 15:07:49 -04:00
|
|
|
// Submit the translation form when pressing Ctrl/Meta+Enter while focused on the input text field
|
2024-01-13 15:55:18 -05:00
|
|
|
document.getElementById("input").addEventListener("keydown", function(event) {
|
|
|
|
if (event.keyCode === 13 && (event.metaKey || event.ctrlKey)) {
|
|
|
|
document.getElementById("translation-form").submit();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2024-10-04 15:07:49 -04:00
|
|
|
// Auto resize textarea to fit words inside it without the need to scroll
|
2024-01-13 15:55:18 -05:00
|
|
|
var input = document.getElementById("input");
|
|
|
|
var output = document.getElementById("output");
|
|
|
|
input.setAttribute("style", "height:" + output.scrollHeight + "px;overflow-y:scroll;");
|
|
|
|
output.setAttribute("style", "height:" + output.scrollHeight + "px;overflow-y:scroll;");
|
|
|
|
input.addEventListener("input", function(e) {
|
|
|
|
this.style.height = 150 + "px";
|
|
|
|
this.style.height = this.scrollHeight + "px";
|
|
|
|
});
|
|
|
|
</script>
|
2024-10-04 15:07:49 -04:00
|
|
|
<script src="/static/custom-css.js"></script>
|
2024-01-13 15:55:18 -05:00
|
|
|
</body>
|
2024-10-04 15:07:49 -04:00
|
|
|
</html>
|