forked from japakar/webturtle
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
180 lines (171 loc) · 7.2 KB
/
index.html
File metadata and controls
180 lines (171 loc) · 7.2 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>FTSCoin Webminer [Mine from anywhere]</title>
<link rel="icon" href="assets/favicon.png">
<link rel="stylesheet" href="assets/fts-ui-kit.css">
</head>
<body id="body">
<style>
@import url('https://fonts.googleapis.com/css?family=Sen&display=swap');
body {
margin: 0;
font-family: 'Sen', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 1rem;
font-weight: normal;
line-height: 1.75;
}
#logo {
text-align: center;
width: 100%;
}
#body {
background: rgb(137,114,179);
background: -moz-linear-gradient(90deg, rgba(137,114,179,1) 0%, rgba(48,27,87,1) 47%, rgba(52,107,180,1) 100%);
background: -webkit-linear-gradient(90deg, rgba(137,114,179,1) 0%, rgba(48,27,87,1) 47%, rgba(52,107,180,1) 100%);
background: linear-gradient(90deg, rgba(137,114,179,1) 0%, rgba(48,27,87,1) 47%, rgba(52,107,180,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#8972b3",endColorstr="#346bb4",GradientType=1);
}
#img {
width: 100px;
margin-top: 5px;
}
.toggleinfo {
display: none;
}
.toggleinfo .is-visible {
display: block;
}
.container {
max-width: 80%;
margin-left: 10%;
}
input[type=text], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=number],select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.button {
background-color: white;
border: none;
color: green;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
}
label{
color: white;
}
#button {
text-align: center;
}
#stop {
color: red;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div id="logo">
<img src="assets/ftslogo.png" id="img"></img>
</div>
<div class="container">
<div class="row">
<div class="col-6">
<label>Threads:</label>
<input id="threads" type="number" min="1" max="64" value="4" placeholder="Number of threads">
</div>
<div class="col-6">
<label>Mining speed:</label>
<input id="speed" type="number" placeholder="Mining speed in percent" min="1" max="100" value="100">
</div>
</div>
<!--<div id="#result">
</div>-->
<div>
<label>Your wallet address:</label>
<input id="wallet" type="text" placeholder="Your FTSCoin address" value="fts1QBRNsfv4WwC3X25C8zBJt2ek6bxkPc4kEz7uhcFMe4YQ8w9v474LmTeXdFmMH8VYPMVYYhVtsZ9LGMZ1va5P7D22QUqV8f">
</div>
<div>
<label>Pool:</label>
<input id="pool" type="text" placeholder="Your favourite mining pool" value="www.ftscoinpool.xyz">
</div>
<div class="row">
<div class="col-6">
<label>Port:</label>
<input id="port" type="number" placeholder="Your pools port" value="3333">
</div>
<div class="col-6">
<label>Worker name:</label>
<input id="workerName" type="text" placeholder="Your worker name" value="WebMiner">
</div>
</div>
<div class="row mt-3">
<div class="col-md-6 col-sm-12 p-2 text-center" >
<a class="btn btn-lg btn-fts-info has-shadow minw-xs-180 radius30" onclick="js:updateValues();miner.start();" id="btnstart">Start</a>
</div>
<div class="col-md-6 col-sm-12 p-2 text-center">
<a class="btn btn-lg btn-fts-warning has-shadow minw-xs-180 radius30" onclick="js:miner.stop();" id="btnstop">Stop</a>
</div>
</div>
<div class="row mt-3">
<div class="col-12 text-white" id="notif">
</div>
</div>
</div>
<script src='turtleminer.js'></script>
<!--<script src='assets/webcpu.js'></script>-->
<script>
const config = {
pool: "www.ftscoinpool.xyz", // pool url
port: 3333, // pool port
wallet: "fts1QBRNsfv4WwC3X25C8zBJt2ek6bxkPc4kEz7uhcFMe4YQ8w9v474LmTeXdFmMH8VYPMVYYhVtsZ9LGMZ1va5P7D22QUqV8f", // your wallet address
speed: 100, // cpu speed/usage in %
threads: 4, // number of threads using for mining
workerName: "WebMiner" // the miner name also knows as 'password' for the pool, default 'x'
}
const miner = new TurtleMiner(config);
console.log(miner.dump());
miner.on("report", function(rep) {
console.log(rep);
});
function updateValues() { // updates values entered by user
for (let i in config) {
config[i] = document.getElementById(i).value;
miner[i] = document.getElementById(i).value;
}
}
</script>
<!--<script>
async function main() {
const container = document.querySelector('#result');
container.innerHTML = '<div class="orange">Estimating CPU Cores...</div>';
const start = performance.now();
const result = await webcpu.WebCPU.detectCPU();
const end = performance.now();
container.innerHTML = '<div class="orange">Estimated CPU Cores</div>';
container.innerHTML += `<div class="yellow">Took ${Math.round(end - start)}ms</div>`;
container.innerHTML += `<div><span class="purple">Reported Cores:</span> ${result.reportedCores}</div>`;
container.innerHTML += `<div><span class="purple">Estimated Idle Cores:</span> ${result.estimatedIdleCores}</div>`;
container.innerHTML += `<div><span class="purple">Estimated Physical Cores:</span> ${result.estimatedPhysicalCores}</div>`;
}
document.addEventListener('DOMContentLoaded', main);
</script>-->
</html>