-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
2,273 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Authme</title> | ||
<!-- js --> | ||
<script defer src="./src/js/index.js"></script> | ||
<script defer src="./src/js/convert.js"></script> | ||
<!-- css --> | ||
<link rel="stylesheet" href="../.././src/dragonfly@1.1.0.css" /> | ||
<link rel="stylesheet" href="./src/css/index.css" /> | ||
<!-- favicon --> | ||
<link rel="shortcut icon" href="../../img/icon.ico" type="image/x-icon" /> | ||
</head> | ||
<body> | ||
<div class="center"> | ||
<h1>Authme</h1> | ||
<h2>Export</h2> | ||
<p class="text3">You can export everything form your saved config.</p> | ||
<button class="button1" onclick="hide()">Close</button> | ||
<h3>Export</h3> | ||
<p class="text3">If you saved your config you can export the secrects and the QR codes.</p> | ||
<button class="button1" id="but0" onclick="exp()">Export</button> | ||
<br /> | ||
<textarea readonly="readonly" id="result" cols="30" rows="10"></textarea> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
body { | ||
background: rgb(0, 0, 0); | ||
background: linear-gradient(90deg, rgba(0, 0, 0, 1) 30%, rgba(42, 36, 36, 1) 100%); | ||
} | ||
|
||
.center { | ||
top: -50px; | ||
width: 1000px; | ||
height: auto; | ||
padding-bottom: 50px; | ||
} | ||
|
||
.button1 { | ||
color: black; | ||
background-color: white; | ||
border-color: white; | ||
} | ||
|
||
.button1:hover { | ||
color: white; | ||
border-color: white; | ||
} | ||
|
||
.input1 { | ||
color: black; | ||
background-color: white; | ||
border-color: white; | ||
width: 250px; | ||
} | ||
|
||
.input1:hover { | ||
color: white; | ||
border-color: white; | ||
} | ||
|
||
#password_input2 { | ||
position: relative; | ||
top: 20px; | ||
} | ||
|
||
#password_label2 { | ||
position: relative; | ||
top: 20px; | ||
} | ||
|
||
#button1 { | ||
position: relative; | ||
top: 45px; | ||
} | ||
|
||
.link1 { | ||
font-size: 1rem !important; | ||
position: relative; | ||
top: 50px; | ||
color: white !important; | ||
} | ||
|
||
#result { | ||
position: relative; | ||
top: 50px; | ||
margin: 0 auto; | ||
border: 1px solid rgb(0, 0, 0); | ||
padding: 1rem; | ||
border-radius: 28px; | ||
width: 550px; | ||
height: 250px; | ||
transition: 0.3s; | ||
background-color: rgb(0, 0, 0); | ||
color: rgb(255, 255, 255); | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 20px; | ||
margin-bottom: 100px; | ||
display: none; | ||
} | ||
|
||
#result::-webkit-scrollbar { | ||
width: 0px; | ||
background: transparent; /* make scrollbar transparent */ | ||
} | ||
|
||
.qr { | ||
padding-top: 250px; | ||
background-color: black; | ||
margin-top: 50px; | ||
border-radius: 30px; | ||
margin: 0 auto; | ||
margin-top: 20px; | ||
width: 600px; | ||
height: 500px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
let data = [] | ||
let save_text | ||
|
||
const handlefiles = (files) => { | ||
// read file | ||
if (window.FileReader) { | ||
getastext(files[0]) | ||
console.log("File uploaded successfully!") | ||
/* state = 1 */ | ||
} else { | ||
console.log("Can't upload file!") | ||
} | ||
} | ||
|
||
const getastext = (fileToRead) => { | ||
const reader = new FileReader() | ||
reader.onload = loadhandler | ||
reader.onerror = errorhandler | ||
reader.readAsText(fileToRead) | ||
} | ||
|
||
const loadhandler = (event) => { | ||
const text = event.target.result | ||
console.log(text) | ||
save_text = text | ||
console.log(save_text) | ||
processdata(text) | ||
} | ||
|
||
const errorhandler = (evt) => { | ||
if (evt.target.error.name == "NotReadableError") { | ||
alert("Failed to upload the file! You uploaded a corrupted or not supported file!") | ||
} | ||
} | ||
|
||
const processdata = (text) => { | ||
// remove double qoutes | ||
const pre_data1 = text.replace(/"/g, "") | ||
|
||
// new line | ||
const pre_data2 = pre_data1.replace(/,/g, "\n") | ||
|
||
// make the array | ||
const pre_data3 = pre_data2.split(/\n/) | ||
while (pre_data3.length) { | ||
data.push(pre_data3.shift()) | ||
} | ||
|
||
// remove first blank | ||
data.splice(0, 1) | ||
|
||
data = data.filter((_, i) => { | ||
return (i + 1) % 5 | ||
}) | ||
|
||
console.log("Data:") | ||
console.log(data.length) | ||
console.log(data) | ||
|
||
separation() | ||
} |
Oops, something went wrong.