-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtranslate.template.html
More file actions
72 lines (61 loc) · 1.39 KB
/
translate.template.html
File metadata and controls
72 lines (61 loc) · 1.39 KB
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
<!doctype html>
<html lang="en">
<title>Translate ip.dog</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
--color: black;
--background: white;
--small-color: #444;
--action-color: deepskyblue;
}
@media (prefers-color-scheme: dark) {
:root {
--color: white;
--background: black;
--small-color: #bbb;
}
}
body {
font: 25px/1.4 system-ui, sans-serif;
background: var(--background);
color: var(--color);
}
a {
color: var(--action-color);
}
textarea {
font-size: inherit;
font-family: inherit;
width: 90%;
height: 350px;
}
.button {
background: var(--action-color);
font-size: 25px;
padding: .25em 1em .3em;
margin-bottom: 50px;
border: none;
border-radius: 16px;
font-family: inherit;
color: white;
text-shadow: 0 1px 0 black;
outline: none;
text-decoration: none;
cursor: pointer;
}
</style>
<header>
<a href="/">< ip.dog home page</a>
</header>
<p>Translate the following text and send it to me by mail:</p>
<p><textarea>{{TEXT}}</textarea></p>
<p><a class="button" href="/">Send by mail</a></p>
<script>
const textarea = document.querySelector('textarea');
const button = document.querySelector('.button');
const email = ['adieulot', 'gmail.com'].join('@');
textarea.addEventListener('input', function (event) {
button.href = `mailto:${email}?body=${encodeURIComponent(textarea.value)}`;
})
</script>