forked from HelloZeroNet/zeronet.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo.html
98 lines (85 loc) · 3.34 KB
/
go.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
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
<!DOCTYPE html>
<html>
<head>
<title>ZeroNet: Decentralized websites using Bitcoin cryptography and the BitTorrent network</title>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="media/main.css" />
<noscript><link rel="stylesheet" href="media/fonts.css" /></noscript>
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- Inline css... Thanks Google! -->
<style id='style'>
h2,h3,h4,h5,h6,a,li,ul,small,span { visibility: hidden; } /* Avoid font flicker */
h1 { opacity: 0; transition: all 0.3s ease-in-out; }
</style>
<link rel="preload" href="media/fonts.css" as="style">
</head>
<body class="page-landing">
<!-- Visit site -->
<div class="block block-100 visit-top">
<h1>Visiting ZeroNet P2P site</h1>
<div class="visit-links" id="visit-links">
<h4>Using your local client <small>(Faster, you help to keep the site alive)</small></h4>
<a href="#" class="visit-link local" id="visit-link-local"><span>http://127.0.0.1/1AnySiteAddress</span></a>
<div class="visit-local-install" id="visit-local-install">Local client not detected: <a href="https://zeronet.io" target="_blank">Install instructions</a></div>
<h4>Using proxy <small>(Slower, No installation required, may be overloaded)</small></h4>
<div id="proxies"></div>
</div>
<h4 class="link-what-is"><a href="https://zeronet.io" target="_blank">What is ZeroNet?</a></h4>
</div>
<script>
function getLandingSiteAddress(hash) {
var match = hash.match(/^#site:(([A-Za-z0-9\.]+)(\/.*|$))/i);
if (match)
return match[1]
}
proxies = ["https://zeronet.now.im/"];
function createElem(html_body) {
var div = document.createElement('div');
div.innerHTML = html_body.trim();
return div.firstChild;
}
site_address = getLandingSiteAddress(location.hash)
if (!site_address)
site_address = ""
var elem_local = document.getElementById("visit-link-local");
var address = "http://127.0.0.1:43110/" + site_address;
elem_local.href = address;
elem_local.firstChild.innerText = address;
// Add proxies
proxies.forEach(function(proxy_address) {
var elem = createElem('<a href="address" class="visit-link"><span>address</span></a>');
var address = proxy_address + site_address;
elem.href = address;
elem.firstChild.innerText = address;
document.getElementById("proxies").appendChild(elem);
});
// Check if local client running
elem_local_test = createElem('<img src="http://127.0.0.1:43110/favicon.ico?random=' + Date.now() + '" style="display: none"/>');
elem_local_test.onerror = function() {
document.getElementById("visit-links").classList.add("no-local");
};
document.body.appendChild(elem_local_test);
</script>
<!-- Load fonts -->
<script>
var cb = function() {
var l = document.createElement('link'); l.rel = 'stylesheet';
l.href = 'media/fonts.css';
var h = document.getElementsByTagName('head')[0]; h.parentNode.insertBefore(l, h);
};
setTimeout(cb, 0);
var raf = requestAnimationFrame || mozRequestAnimationFrame ||
webkitRequestAnimationFrame || msRequestAnimationFrame;
if (raf) raf(cb);
else window.addEventListener('load', cb);
setTimeout(function() {
document.querySelectorAll("h1").forEach(function (elem) {
elem.style.opacity = 1
elem.style.transform = "none"
})
}, 100)
</script>
<!-- EOF Load fonts -->
</body>
</html>