diff --git a/README.md b/README.md index 985fd399..f8d60e7a 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,16 @@ # Authme -- A simple 2FA app for desktop built with Electron and Node.js. +- A simple 2FA cross platform app for desktop built with Electron and Node.js. # How to use -- Check out `extract/README.md` +- For technical people: Check out `extract/README.md` +- For simple people: Instructions in the app -# Build +# Development -`electron-packager . Authme --overwrite --platform=all --arch=x64 --icon=img/icon.icns --out=build` - -# NPM Pacages used - -### Dev - -- electron -- electron-packager - -### Main - -- bcrypt -- create-desktop-shortcuts -- cryptr -- speakeasy +- Start `npm run start` +- Build `npm run build` # License diff --git a/app/application/index.html b/app/application/index.html index 939baf84..078440cc 100644 --- a/app/application/index.html +++ b/app/application/index.html @@ -23,6 +23,16 @@
You can export everything form your saved config.
+ +If you saved your config you can export the secrects and the QR codes.
+ +diff --git a/app/application/src/css/index.css b/app/application/src/css/index.css index a604b79a..7cc81ea2 100644 --- a/app/application/src/css/index.css +++ b/app/application/src/css/index.css @@ -1,6 +1,7 @@ body { background: rgb(0, 0, 0); background: linear-gradient(90deg, rgba(0, 0, 0, 1) 30%, rgba(42, 36, 36, 1) 100%); + overflow-y: scroll; } .center { @@ -125,31 +126,44 @@ body { font-size: 1.3rem; } -#grid0, -#grid1, -#grid2, -#grid3, -#grid4, -#grid5, -#grid6, -#grid7, -#grid8, -#grid9, -#grid10, -#grid11, -#grid12, -#grid13, -#grid14, -#grid15, -#grid16, -#grid17, -#grid18, -#grid19 { +.input2 { + width: 300px; + margin: 0 auto; + color: rgb(0, 0, 0); + background-color: white; + border-color: white; + font-size: 1rem; + padding: 15px 30px; + border-radius: 30px; + cursor: text; + text-align: center; + transition: 0.2s ease-in; + margin-bottom: 50px; display: none; } +.input2:hover { + background-color: var(--df_gray); + color: white; + border-color: white; +} + +.input2::placeholder { + color: black; +} + #save { display: unset; visibility: hidden; margin-bottom: 20px; } + +input:focus::placeholder { + transition: 0.2s ease-in; + color: transparent; +} + +input:hover::placeholder { + transition: 0.2s ease-in; + color: transparent; +} diff --git a/app/application/src/js/index.js b/app/application/src/js/index.js index 4f4ac852..e3f9680e 100644 --- a/app/application/src/js/index.js +++ b/app/application/src/js/index.js @@ -47,6 +47,7 @@ let separation = () => { let go = () => { document.querySelector("#title").textContent = "Here are your 2FA codes" + document.querySelector("#search").style.display = "grid" let generate = () => { // counter @@ -133,5 +134,47 @@ let go = () => { } else { document.querySelector("#input").style.display = "none" document.querySelector("#save").style.display = "none" + document.querySelector("#search").style.display = "grid" + } +} + +//? search +let search = () => { + const querry = [] + let search = document.querySelector("#search") + let input = search.value.toLowerCase() + let i = 0 + + // restart + for (let i = 0; i < names.length; i++) { + let div = document.querySelector(`#grid${[i]}`) + div.style.display = "grid" + } + + // get names + for (let i = 0; i < names.length; i++) { + let name = document.querySelector(`#name${[i]}`) + + querry.push(name.textContent.toLowerCase().trim()) + } + + // search + console.log(input) + querry.forEach((e) => { + if (e.startsWith(input)) { + console.log("found") + } else { + let div = document.querySelector(`#grid${[i]}`) + div.style.display = "none" + } + i++ + }) + + // if search empty + if (search.value == "") { + for (let i = 0; i < names.length; i++) { + let div = document.querySelector(`#grid${[i]}`) + div.style.display = "grid" + } } } diff --git a/app/application/src/js/save.js b/app/application/src/js/save.js index 107b2bdf..77cfbf41 100644 --- a/app/application/src/js/save.js +++ b/app/application/src/js/save.js @@ -11,7 +11,8 @@ fs.readFile(path.join(file_path, "hash.md"), "utf-8", (err, content) => { if (err) { console.log("The hash.md fle dont exist!") - document.querySelector("#title").textContent = "Please choose your exported file" + document.querySelector("#title").textContent = + "Please choose your exported file, if you don't have one: Go to the top menu > Advanced > Import" } else { prev = true diff --git a/app/export/index.html b/app/export/index.html new file mode 100644 index 00000000..0c63a827 --- /dev/null +++ b/app/export/index.html @@ -0,0 +1,28 @@ + + +
+ +
+ + + + + + + + + +
+