Browse Source

I need someone to help me do this, seriously

master
SeraphJACK 3 years ago
parent
commit
87323924f1
Signed by: SeraphJACK <seraphjack@outlook.com> GPG Key ID: 14162B46567AB06F
5 changed files with 56 additions and 0 deletions
  1. +3
    -0
      static/css/style.css
  2. +15
    -0
      static/index.html
  3. +22
    -0
      static/js/chalenge.js
  4. +9
    -0
      static/js/sha256.min.js
  5. +7
    -0
      static/js/vote.js

+ 3
- 0
static/css/style.css View File

@@ -0,0 +1,3 @@
.main {

}

+ 15
- 0
static/index.html View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style.css">
<title>Votes</title>
</head>
<body class="main">
<div id="description">
<p class="question">你认为 zzzz 是大佬吗</p>
<button onclick="voteIsDL()">是</button>
<button onclick="voteIsNotDL()">不是</button>
</div>
</body>
</html>

+ 22
- 0
static/js/chalenge.js View File

@@ -0,0 +1,22 @@
function fetchChallenge() {
fetch("/challenge").then(response => {
if (!response.ok) {
alert(response.body)
}
localStorage.setItem("challengeString", response.body)
})
}

function findMagic() {
let challenge = localStorage.getItem("challenge")
if (challenge !== "") {
for (let i=0; true; i++) {
let result = sha256.array(challenge + i.toString())
if (result[0] === 0 && result[1] === 0) {
localStorage.setItem("magicString", i.toString())
return i.toString()
}
}
}
return ""
}

+ 9
- 0
static/js/sha256.min.js
File diff suppressed because it is too large
View File


+ 7
- 0
static/js/vote.js View File

@@ -0,0 +1,7 @@
function voteIsDL() {
// TODO
}

function voteIsNotDL() {
// TODO
}

Loading…
Cancel
Save