-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathxip.html
70 lines (58 loc) · 1.24 KB
/
xip.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>xip.io URL Generator</title>
<style>
body {
font-size: 20px;
}
form {
width: 20em;
margin: 0 auto;
}
label {
display: block;
margin-top: 1em;
}
input {
font-size: 1em;
display: block;
width: 100%;
}
button {
font-size: 1em;
width: 100%;
margin-top: 1em;
}
</style>
</head>
<body>
<form id="xip">
<label for="ip">Your IP</label>
<input id="ip">
<label for="domain">Domain</label>
<input id="domain">
<label for="path">Path</label>
<input id="path">
<button type="submit">Go to xip.io!</button>
</form>
<script>
(function() {
var ip = document.getElementById( "ip" );
var domain = document.getElementById( "domain" );
var path = document.getElementById( "path" );
ip.value = localStorage.getItem( "ip" );
domain.value = localStorage.getItem( "domain" );
path.value = localStorage.getItem( "path" );
document.getElementById( "xip" ).onsubmit = function( event ) {
event.preventDefault();
localStorage.setItem( "ip", ip.value );
localStorage.setItem( "domain", domain.value );
localStorage.setItem( "path", path.value );
document.location = "http://" + domain.value + "." + ip.value + ".xip.io/" + path.value;
};
})();
</script>
</body>
</html>