-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.template.html
More file actions
128 lines (109 loc) · 2.1 KB
/
index.template.html
File metadata and controls
128 lines (109 loc) · 2.1 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
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
<!doctype html>
<html lang="{{LANG}}">
<title>ip.dog</title>
<meta name="description" content="The fastest way to get your IP address.">
<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);
margin: 0;
cursor: pointer;
}
.container {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.ip {
text-align: center;
}
h1 {
margin: 0;
padding: 50px 0;
font-size: 50px;
font-weight: 600;
}
@media (min-width: 768px) {
h1 {
font-size: 100px;
}
}
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;
cursor: inherit;
outline: none;
}
@media (min-width: 600px) {
button {
font-size: 35px;
}
}
.notice {
color: var(--small-color);
font-size: 20px;
margin: 0 1em;
}
a {
color: var(--action-color);
}
textarea {
position: absolute;
left: -9999px;
}
</style>
<div class="container">
<div class="ip">
<h1>{{IP}}</h1>
<button>{{LINE1}}</button>
</div>
<div class="notice">
<p>{{LINE3}}
<ul>
<li>{{LINE4}}
<li>{{LINE5}}
<li>{{LINE6}}
<li>{{LINE7}}
<li>{{LINE8}}
</ul>
<p>{{LINE9}}
</div>
</div>
<textarea readonly>{{IP}}</textarea>
<script>
const copyElement = document.querySelector('textarea');
function listener(event) {
if (event.target.tagName == 'A') {
return;
}
copyElement.select();
copyElement.setSelectionRange(0, copyElement.value.length);
document.execCommand('copy');
document.querySelector('button').innerHTML = '{{LINE2}}';
}
document.body.addEventListener('click', listener);
document.addEventListener('keypress', listener);
</script>