From daa7c3b44c40d536862b49eb334221d378f78da7 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Thu, 23 Dec 2021 21:22:57 +0100 Subject: [PATCH] Rework CSS --- server/index.php | 50 ++++++++++++++++++++--- server/resources/gpass.css | 84 ++++++++++++++++++++++++++------------ server/resources/gpass.js | 10 ++++- 3 files changed, 110 insertions(+), 34 deletions(-) diff --git a/server/index.php b/server/index.php index 56cb48e..9c8abaa 100644 --- a/server/index.php +++ b/server/index.php @@ -95,7 +95,39 @@ else setTimeout(scrollToTop, 24); } - + + function enableMenu(elem, divFrom) + { + elem.style.display = "block"; + divFrom.style['font-weight'] = "bold"; + } + + function disableMenu(elem, divFrom) + { + elem.style.display = "none"; + divFrom.style['font-weight'] = "normal"; + } + + function switchMenuDisplay(id) + { + const array1 = ['admin', 'add_new_password', 'update_masterkey', 'export_database']; + + for (const _id of array1) + { + elem = document.getElementById(_id); + divFrom = document.getElementById("menu_" + _id); + if (_id === id) + { + if (elem.style.display == "block") + disableMenu(elem, divFrom); + else + enableMenu(elem, divFrom); + } + else + disableMenu(elem, divFrom); + } + } + @@ -103,9 +135,15 @@ else
+ \n";?> + + + +
>
@@ -155,7 +193,7 @@ else if ($user != "") { - echo "Add a new password
\n"; + echo "
Add a new password
\n"; echo 'URL '; echo 'login '; @@ -170,15 +208,13 @@ if ($user != "") } ?>
-
-
Update Masterkey
\n"; + echo "
Update Masterkey
\n"; echo 'Old master key '; echo 'New master key '; @@ -192,13 +228,15 @@ if ($user != "") if ($user != "") { - echo "Export
\n"; + echo "
Export
\n"; echo ''; echo 'Download'; } ?>
+
+
diff --git a/server/resources/gpass.css b/server/resources/gpass.css index 8bea133..cb4f3c6 100755 --- a/server/resources/gpass.css +++ b/server/resources/gpass.css @@ -1,34 +1,61 @@ body { - background-image:linear-gradient(#0096ff 30%, white); + background-color:#2d2e44; height:100%; width:100%; + color:white; } +input { + opacity:0.9; +} #logo { + display:inline; +} + +#logo img{ + display:inline; + width:250px; + height:170px; + margin-right:4%; +} + +#menu { display:block; - margin-left:auto; - margin-right:auto; - margin-top:30px; - margin-bottom:40px; - text-align:center; + padding-bottom:10pt; +} + +#menu div { + display:inline; + margin-right:2%; + font-size:x-large; + cursor: pointer; +} + +.title { + font-size:xx-large; + font-weight:bold; + margin-bottom:20pt; } #admin { - border-style:solid; - border-width:5px; - border-color:red; padding : 15px; margin : 15px; + border-radius: 25px; + border-style:solid; + border-width:5px; + border-color:grey; + display:none; } #admin form { text-align : center; } +#admin input { + margin-right:10px; +} + #user { - border-style:solid; - border-width:5px; - border-color:green; padding : 15px; margin : 15px; text-align:center; @@ -45,10 +72,12 @@ body { text-align : center; } +#selected_user { + margin-left:10px; + margin-right:10px; +} + #passwords { - border-style:solid; - border-width:5px; - border-color:grey; padding : 15px; margin : 15px; } @@ -57,34 +86,37 @@ body { padding:10px; text-align:center; font-size:xx-large; -} - -.hash { - width : 700px; + color:#de0036; } #add_new_password { + border-radius: 25px; border-style:solid; border-width:5px; - border-color:blue; + border-color:grey; padding : 15px; margin : 15px; + display:none; } #update_masterkey { - border-style:solid; - border-width:5px; - border-color:yellow; padding : 15px; margin : 15px; + border-radius: 25px; + border-style:solid; + border-width:5px; + border-color:grey; + display:none; } #export_database { - border-style:solid; - border-width:5px; - border-color:pink; padding : 15px; margin : 15px; + border-radius: 25px; + border-style:solid; + border-width:5px; + border-color:grey; + display:none; } #export_link { diff --git a/server/resources/gpass.js b/server/resources/gpass.js index 0bcfaa3..0f75ca1 100755 --- a/server/resources/gpass.js +++ b/server/resources/gpass.js @@ -523,13 +523,15 @@ async function change_master_key(warning_unciphered) url.setAttribute("class", "hash"); url.setAttribute("type", "text"); url.setAttribute("name", "URL"); + url.setAttribute("size", "32"); div.appendChild(url); div.appendChild(document.createTextNode("password")); password = document.createElement("input"); - password.setAttribute("class", "hash"); + password.setAttribute("class", "password_hash"); password.setAttribute("type", "text"); password.setAttribute("name", "password"); + password.setAttribute("size", "40"); div.appendChild(password); delete_button = document.createElement("input"); @@ -637,7 +639,11 @@ function update_master_key(warning_unciphered) function start() { - select_widget = document.getElementById('selected_user') ; + new_url = document.getElementById('new_url') ; + if (new_url.value !== "") + switchMenuDisplay('add_new_password'); + + select_widget = document.getElementById('selected_user') ; if (select_widget == null) return;