Skip to content

Commit

Permalink
Edit page better instructions and edit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Nov 26, 2021
1 parent 05655c1 commit 80ffa58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions app/edit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h5 class="mx-3 flex flex-row m-0 font-bold build-content text-center">You are r
<div class="mx-auto rounded-2xl bg-gray-700 w-3/5 text-center mt-40">
<img src="../../img/header.png" class="h-16 w-16 relative top-5" />
<h2>Edit codes</h2>
<h4>You can edit, delete or add more codes.</h4>
<h4>You can edit or delete your existing codes and you can add more codes.</h4>
<button class="buttoni mb-6" onclick="hide()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
Expand All @@ -38,7 +38,7 @@ <h4>You can edit, delete or add more codes.</h4>
<!-- rollback -->
<div class="mx-auto rounded-2xl hidden bg-gray-800 w-2/3 rollback mt-20">
<h2 id="rollbackText" class="pt-5">Rollback</h2>
<h3>You can rollback to the latest save. If you load your codes below it will overwrite the current rollback save!</h3>
<h3>You can rollback to the latest save. If you load your codes below it will overwrite the current save!</h3>
<button class="buttoni mb-5" onclick="loadRollback()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
Expand All @@ -49,7 +49,7 @@ <h3>You can rollback to the latest save. If you load your codes below it will ov
<!-- load codes -->
<div class="mx-auto rounded-2xl bg-gray-800 w-2/3 mb-20 mt-20 beforeLoad">
<h2 id="rollbackBut" class="pt-5">Load saved code(s)</h2>
<h3>You can load the code(s) you saved. After that you can edit them or add more.</h3>
<h3>You can load the codes you saved. After that you can edit or delete them and you can add more codes.</h3>
<button class="buttoni mb-5" onclick="loadCodes()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
Expand All @@ -61,7 +61,7 @@ <h3>You can load the code(s) you saved. After that you can edit them or add more
<div class="afterLoad hidden">
<div class="mx-auto rounded-2xl bg-gray-800 w-2/3 mt-20 mb-20">
<h2 id="rollbackBut" class="pt-5">Edit mode</h2>
<h3>Now you can modify existing codes or add more.</h3>
<h3>Now you can modify existing codes or add more codes.</h3>
<div class="flex flex-row justify-center gap-3 flex-wrap pb-5">
<button class="buttoni" onclick="createSave()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
Expand All @@ -77,7 +77,7 @@ <h3>Now you can modify existing codes or add more.</h3>
Add code(s)
</button>
</div>
<div class="mx-auto pb-3">
<div class="mx-auto pb-5">
<details class="mb-5 transform ease-in duration-200">
<summary class="font-bold mb-3 cursor-pointer">More options</summary>
<div class="flex flex-row justify-center gap-3 flex-wrap">
Expand All @@ -99,7 +99,7 @@ <h3>Now you can modify existing codes or add more.</h3>
</div>
</div>
<!-- codes -->
<div class="codes_container mb-16"></div>
<div class="codes_container mb-20"></div>
</div>
</div>
</body>
Expand Down
5 changes: 3 additions & 2 deletions app/edit/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ const edit = (number) => {
const edit_but = document.querySelector(`#edit_but_${number}`)
const edit_inp = document.querySelector(`#edit_inp_${number}`)

document.querySelector(`#edit_inp_${number}`).value = `${edit_inp.value} `
edit_inp.focus()
const length = edit_inp.value.length
edit_inp.setSelectionRange(length, length)

if (edit_mode === false) {
edit_but.style.color = "green"
Expand Down Expand Up @@ -354,7 +355,7 @@ const saveModifications = () => {
encrypted: true,
codes: encrypted.toString("base64"),
date: time.timestamp(),
version: "3",
version: 3,
}

fs.writeFileSync(path.join(folder_path, "codes", "codes.authme"), JSON.stringify(codes, null, "\t"))
Expand Down
Loading

0 comments on commit 80ffa58

Please sign in to comment.