Skip to content

Commit

Permalink
Dialog styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Apr 8, 2022
1 parent d40b501 commit 6465d6b
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 7 deletions.
5 changes: 0 additions & 5 deletions app/settings/src/css/index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
body {
overflow: hidden;
display: block;
}

.tabcontent {
animation: fadeEffect 1s;
}
Expand Down
51 changes: 51 additions & 0 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { shell, app, dialog, BrowserWindow } = require("@electron/remote")
const { convert, localization, time } = require("@levminer/lib")
const logger = require("@levminer/lib/logger/renderer")
const { ipcRenderer: ipc } = require("electron")
const bcrypt = require("bcryptjs")
const path = require("path")
const fs = require("fs")
const { createBackupFile, loadBackupFile, changePassword } = require(path.join(__dirname, "src", "js", "security.js"))
Expand Down Expand Up @@ -757,7 +758,10 @@ const removeButtonStyles = () => {
}

// control menu

const menu = (name) => {
storage = dev ? JSON.parse(localStorage.getItem("dev_storage")) : JSON.parse(localStorage.getItem("storage"))

let i

if (name === "shortcuts") {
Expand Down Expand Up @@ -966,3 +970,50 @@ const screenCapture = () => {
const experimentalDocs = () => {
shell.openExternal("https://docs.authme.levminer.com/#/settings?id=experimental-features")
}

/**
* Show password
*/
let password_shown = false

const showPassword = (id) => {
if (password_shown === false) {
document.querySelector(`#password_input${id}`).setAttribute("type", "text")

document.querySelector(`#show_pass_${id}`).style.display = "none"
document.querySelector(`#show_pass_${id}1`).style.display = "flex"

password_shown = true
} else {
document.querySelector(`#password_input${id}`).setAttribute("type", "password")

document.querySelector(`#show_pass_${id}`).style.display = "flex"
document.querySelector(`#show_pass_${id}1`).style.display = "none"

password_shown = false
}
}

/* Show/hide load backup file dialog */
const loadBackupFileDialog = () => {
const dialog = document.querySelector(".dialog1")
const close_dialog = document.querySelector(".dialog1Close")

close_dialog.addEventListener("click", () => {
dialog.close()
})

dialog.showModal()
}

/* Show/hide change password dialog */
const changePasswordDialog = () => {
const dialog = document.querySelector(".dialog0")
const close_dialog = document.querySelector(".dialog0Close")

close_dialog.addEventListener("click", () => {
dialog.close()
})

dialog.showModal()
}
2 changes: 1 addition & 1 deletion styles/global.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions styles/partials/components/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@
stroke: white;
}

.input:hover ~ #show_pass_2 {
transition: 0.2s ease-in;
stroke: white;
}

.input:hover ~ #show_pass_21 {
transition: 0.2s ease-in;
stroke: white;
}

.input:hover ~ #show_pass_3 {
transition: 0.2s ease-in;
stroke: white;
}

.input:hover ~ #show_pass_31 {
transition: 0.2s ease-in;
stroke: white;
}

/* button */
.buttoni > svg {
position: relative;
Expand All @@ -64,3 +84,25 @@
background-color: rgb(30, 30, 30) !important;
border-color: rgb(30, 30, 30) !important;
}

/* dialog */
.dialog {
text-align: center;
background-color: #191919 !important;
color: white;
padding: 3rem;
border-radius: 15px;
margin: auto;

& > * {
margin: 0 0 0.5rem 0;
}
}

.dialog::backdrop {
background: rgb(0 0 0 / 0.9);
}

dialog[open] {
animation: fadeEffect 0.5s;
}
Loading

0 comments on commit 6465d6b

Please sign in to comment.