1
0

2 Commits ad465b6a44 ... 7a11374392

Autor SHA1 Nachricht Datum
  apollo 7a11374392 Merge branch 'master' of ssh://gitgreen/david/Key.Card vor 1 Woche
  apollo d25dd5bdcc card.py restore & skript menu/css vor 1 Woche
2 geänderte Dateien mit 34 neuen und 17 gelöschten Zeilen
  1. 7 7
      card.py
  2. 27 10
      skript.js

+ 7 - 7
card.py

@@ -1,8 +1,8 @@
 #!/usr/bin/env python3
 
 # Configuration!
-spacebar = "36a5my"
-keys = "i08rljtyhp2bkexoaf3w7946ncugd51qszmv"
+spacebar = "1rzys0"
+keys = "4bald5hozx8f6veqrp0mw13s9njktyug7ci2"
 
 # The code
 # Do not edit below, change at your own peril
@@ -40,23 +40,23 @@ def modify_self(what: str, data: str):
     with open("card.py", "r") as f:
         for line in f:
             if line.startswith(what):
-                old.append(f"{what} = \"{data}\"\n")
+                old.append(f"{what} = \"{data.strip()}\"\n")
             else:
                 old.append(line)
     with open("card.py", "w") as f:
         for line in old:
             f.write(line)
 
-def modify_skript(spacebar, card):
+def modify_skript(spacebar: str, card: str):
     old = []
     if not exists("skript.js"):
         return False
     with open("skript.js", "r") as f:
         for line in f:
             if line.startswith("let spacebar"):
-                old.append(f"let spacebar = \"{spacebar}\";\n")
+                old.append(f"let spacebar = \"{spacebar.strip()}\";\n")
             elif line.startswith("let keys"):
-                old.append(f"let keys = \"{card}\".split(\"\");\n")
+                old.append(f"let keys = \"{card.strip()}\".split(\"\");\n")
             else:
                 old.append(line)
     with open(".user.js", "w") as f:
@@ -142,6 +142,6 @@ card = gen_card()
 domain = "".join(argv[1:]).lower()
 _passwd = "" + spacebar
 for i in domain:
-    _passwd += card[i] or "?"
+    _passwd += card[i] or ""
 set_clipboard(_passwd)
 print(f"Generated password for '{domain}'")

+ 27 - 10
skript.js

@@ -57,13 +57,13 @@ const convert_card = () => {
 
 addCSS(`
 .keycardmenu{
-  position:absolute;
-  top:55px;
+  position:fixed;
+  top:5px;
   left:-450px;
   padding: 0.5em 1em;
   margin: 2em 0;
   width: 400px;
-  background: #444444AA;
+  background: #444444CC;
   border: solid 5px #00A182FF;
   border-radius: 14px;
   margin: 10px;
@@ -72,12 +72,29 @@ addCSS(`
   overflow: auto;
   text-align: left;
   width: 450px;
-  height: 130px;
+  height: 160px;
   transition-duration: 0.5s;
+  transition-delay: 3s;
+  z-index: 9999;
 }
 .keycardmenu:hover{
-	position:absolute;
-  left:-20px;
+	position:fixed;
+  top:5px;
+  left:-10px;
+  transition-delay: 0s;
+}
+.keycardh1{
+  color: white;
+  font-size: 32px;
+}
+.keycardtxt{
+  color: white;
+  font-size: 14px;
+}
+.keycardbtn {
+  background: grey;
+  color: white;
+  border: 1px solid black;
 }
 `);
 addJS(`
@@ -104,10 +121,10 @@ const generate_pass = () => {
 `);
 const my_bod = `
 <div class="keycardmenu" oncopy="return false;" onselectstart="return false;" oncontextmenu="return false;">
-  <h1>Key Card</h1><br>
-  <p>Domain: ${domain}</p>
-  <button onclick="copy2Clipboard(generate_pass())">Copy Password</button>
+  <h1 class="keycardh1">Key Card</h1>
+  <p class="keycardtxt">Domain: ${domain}</p>
+  <button class="keycardbtn" onclick="copy2Clipboard(generate_pass())">Copy Password</button>
 </div>
 `;
 
-document.body.innerHTML = my_bod + document.body.innerHTML;
+document.body.innerHTML = document.body.innerHTML + my_bod;