-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
145 lines (133 loc) · 5.16 KB
/
index.html
File metadata and controls
145 lines (133 loc) · 5.16 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Rexchain Wallet</title>
<link rel="stylesheet" type="text/css" href="css/sequentiawallet.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-rc.5/css/uikit.min.css" />
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,900" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-rc.5/js/uikit.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-rc.5/js/uikit-icons.min.js"></script>
<script src="js/modernizr-custom.js"></script>
</head>
<body>
<!-- Main menu -->
<nav class="uk-navbar-container" uk-navbar="boundary-align: true; align: right;">
<div class="uk-navbar-left">
<ul class="uk-navbar-nav">
<li><a class="uk-navbar-item uk-logo" href="index.html"> RexChain Wallet </a></li>
</ul>
</div>
<div class="uk-navbar-right">
<ul class="uk-navbar-nav">
<li>
<a class="uk-navbar-toggle" uk-navbar-toggle-icon href=""></a>
<div class="uk-navbar-dropdown">
<ul class="uk-nav uk-navbar-dropdown-nav">
<li id="menu_item"><a href="mailto:hola@prescrypto.com?Subject=RexChain-Contact">Contact</a></li>
</ul>
</div>
</li>
</ul>
</div>
</nav>
<!-- Closing Main menu -->
<div id="index_content">
<div class="grey-background">
<div class="uk-grid-medium" style="width:30%;padding-bottom:20px;">
<h1 class="welcome">Welcome<br>to <strong> Rexchain Wallet</strong> </h1>
<p class="main-subtitle">Access to your information</p>
</div>
</div>
<br>
<div class="uk-grid-medium" style="width:30%; padding-top:0;">
<a class="main-button uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom" href="enterkeys.html">Enter your keys</a>
<a id="create_entropy" class=" main-button uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom" >Create new keys</a>
</div>
<!-- Move mouse for 5 secs -->
<div id="modal-example" uk-modal>
<div class="createkeys-modal uk-modal-dialog uk-modal-body uk-margin-auto-vertical">
<h2 class="uk-modal-title">Create your keys!</h2>
<p id="greytxt">Please move your mouse cursor, to activate the button "Create"</p>
<p class="uk-text-right">
<div>
<progress id="js-progressbar" class="uk-progress" value="10" max="100"></progress>
<script>
var page_width = window.screen.availWidth;
var deviceAgent = navigator.userAgent.toLowerCase();
var isTouchDevice = Modernizr.touch ||
(deviceAgent.match(/(iphone|ipod|ipad)/) ||
deviceAgent.match(/(android)/) ||
deviceAgent.match(/(iemobile)/) ||
deviceAgent.match(/iphone/i) ||
deviceAgent.match(/ipad/i) ||
deviceAgent.match(/ipod/i) ||
deviceAgent.match(/blackberry/i) ||
deviceAgent.match(/bada/i));
UIkit.util.ready(function () {
var bar = document.getElementById('js-progressbar');
if(isTouchDevice ){
document.getElementById("greytxt").innerHTML = "Entropy generated! please click on 'Create'";
bar.value = 100;
document.entropy = Math.floor((Math.random() * 2000) + 1201);
$("#create_keys").removeAttr("disabled");
}
else{
var animate = setInterval(function () {
bar.value += 10;
if(document.entropy >= 1200) {
bar.value=100;
}
}, 5000);
}
});
</script>
</div>
<button id="create_keys" class="uk-button uk-button-default" href="createkeys.html" disabled>Create</button>
</p>
</div>
</div>
</div>
<script src="js/localforage.min.js"></script>
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="js/jsencrypt.js"></script>
<script src="js/wallet.js"></script>
<script>
// Functions
function save_keys(private_key, public_key){
//Save keys in localforage
localforage.setItem('privatekey', private_key).then(function(value){
// set privatekey
localforage.setItem('publickey', public_key).then(function(value){
console.log("Success Generated Keys!");
window.open("./createkeys.html","_self");
});
}).catch(function(e){
console.log(e);
});
}
function create_keys(){
// Create RSA keysan and save in local forage
var crypt = new JSEncrypt({default_key_size: 2048});
crypt.getKey();
var private_key = crypt.getPrivateKey();
var public_key = crypt.getPublicKey();
save_keys(private_key, public_key);
}
// Events
$('#create_entropy').on('click', function() {
UIkit.modal($("#modal-example")).show();
setInterval(function(){
if(document.entropy >= 1200){
$("#create_keys").removeAttr("disabled");
}
}, 1000);
});
$('#create_keys').on('click', function(e) {
e.preventDefault();
create_keys();
});
</script>
</body>
</html>