diff --git a/build/icon.png b/build/icon.png index 95b03c4..529d169 100644 Binary files a/build/icon.png and b/build/icon.png differ diff --git a/css/app.css b/css/app.css index e5710bb..0a96cde 100644 --- a/css/app.css +++ b/css/app.css @@ -91,6 +91,17 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { height: 5px; } +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +/* Firefox */ +input[type=number] { + -moz-appearance: textfield; +} + @keyframes fade { 0% { opacity: 0; @@ -151,7 +162,7 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { padding: .2em 2em; } -.keycard__ident-container { +.keycard-ident__container { height: 60%; box-sizing: border-box; padding: 2em 0; @@ -165,18 +176,18 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { display: inherit; } -.keycard__ident-form-container { +.keycard-ident__form-container { width: 80%; box-sizing: border-box; margin: 1em auto; } -.keycard__ident-form-field-container { +.keycard-ident__form-field-container { padding: .8em 0; box-sizing: border-box; } -.keycard__ident-form-field-label { +.keycard-ident__form-field-label { float: left; width: 37%; font-weight: bold; @@ -258,7 +269,7 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { .keycard__btn-container { text-align: center; - padding: 2em 0; + padding: 1em 0; } .keycard__btn { @@ -283,6 +294,7 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { height: 148px; margin: 4em auto; } + .keycard__loading div { position: absolute; border: 4px solid rgb(112, 112, 191); @@ -290,9 +302,11 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { border-radius: 50%; animation: keycard__loading 1s cubic-bezier(0, 0.2, 0.8, 1) infinite; } + .keycard__loading div:nth-child(2) { animation-delay: -0.5s; } + @keyframes keycard__loading { 0% { top: 72px; @@ -310,11 +324,11 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { } } -.keycard__ident-form-enc-field-container { +.keycard-ident__form-enc-field-container { position: relative; } -.keycard__ident-file-field { +.keycard-ident__file-field { float: left; margin: .8em 0; position: relative; @@ -322,7 +336,7 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { border: none; } -.keycard__ident-file-label { +.keycard-ident__file-label { position: relative; z-index: 0; display: inline-block; @@ -340,7 +354,7 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { font-weight: bold; } -.keycard__ident-file-input { +.keycard-ident__file-input { display: inline-block; position: absolute; z-index: 1; @@ -356,49 +370,7 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { display: block; padding-top: .4em; overflow-x: scroll; - width: 200%; -} - -.keycard__check { - padding: 0; - height: initial; - width: initial; - margin-bottom: 0; - display: none; - cursor: pointer; -} - -.keycard__check-label { - position: relative; - cursor: pointer; - margin-right: 2.5em; -} - -.keycard__check-label:before { - content:''; - -webkit-appearance: none; - background-color: transparent; - border: 2px solid rgb(72, 151, 127); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05); - padding: .56em; - display: inline-block; - position: relative; - vertical-align: middle; - cursor: pointer; - margin-right: .8em; -} - -.keycard__check:checked + .keycard__check-label:after { - content: ''; - display: block; - position: absolute; - top: .1em; - left: .5em; - width: .25em; - height: .8em; - border: solid rgb(72, 151, 127); - border-width: 0 2px 2px 0; - transform: rotate(45deg); + width: 220%; } .keycard-ident__destination-path-container { @@ -408,7 +380,7 @@ input[disabled="disabled"], input[disabled="disabled"]:hover { .keycard-ident__select-btn { font-family: "Material Symbols Outlined", monospace; - margin-top: .4em; + margin-top: .65em; float: right; background: white; border-radius: 5px; diff --git a/img/app_info_bg.png b/img/app_info_bg.png deleted file mode 100644 index 380f19e..0000000 Binary files a/img/app_info_bg.png and /dev/null differ diff --git a/img/smartcard_install.png b/img/smartcard_install.png deleted file mode 100644 index 4b1702f..0000000 Binary files a/img/smartcard_install.png and /dev/null differ diff --git a/img/smartcard_unpair.png b/img/smartcard_unpair.png deleted file mode 100644 index d51023f..0000000 Binary files a/img/smartcard_unpair.png and /dev/null differ diff --git a/img/smartcard_update.png b/img/smartcard_update.png deleted file mode 100644 index b7d62a6..0000000 Binary files a/img/smartcard_update.png and /dev/null differ diff --git a/index.html b/index.html index af08276..4886495 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - Keycard Desktop + Keycard Certify @@ -12,38 +12,38 @@
-
-
-
-
- - +
+
+
+
+ +
-
- - +
+ +
-
- Destination file +
+ Destination file
No destination file selected
-
- -
+
+ +
- - + + Choose File
No file selected
-
- +
+
diff --git a/package.json b/package.json index cfb8fad..93d9bac 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "postinstall": "electron-builder install-app-deps" }, "build": { - "appId": "com.github.choppu.keycard-desktop", - "productName": "Keycard Desktop", + "appId": "com.github.choppu.keycard-certify", + "productName": "Keycard Certify", "files": [ "**/*", "!tsconfig.json", diff --git a/src/card.ts b/src/card.ts index 433ffb0..cbe5e57 100644 --- a/src/card.ts +++ b/src/card.ts @@ -19,7 +19,6 @@ const path = require('path'); const maxPINRetryCount = 3; const maxPUKRetryCount = 5; -const maxPairing = 5; const dataHeader = "80e2000082"; export class Card { @@ -211,15 +210,15 @@ export class Card { this.window.send("certificate-creation-success"); } - openDestinationDialog() : void { + openDestinationDialog(): void { let options = { title: 'Select the destination path to save the processed file', buttonLabel: "Choose", defaultPath: path.join(__dirname, 'certificates.csv.asc'), filters: [ { - name: 'ASC Files', - extensions: ['csv.asc'] + name: 'ASC Files', + extensions: ['csv.asc'] } ] }; @@ -227,7 +226,7 @@ export class Card { dialog.showSaveDialog(options).then((path) => { this.window.send("destination-path-selected", path.filePath); }).catch((err) => { - throw(err); + throw (err); }); } diff --git a/src/ident.ts b/src/ident.ts index 224bc45..b6bc53e 100644 --- a/src/ident.ts +++ b/src/ident.ts @@ -2,9 +2,8 @@ import { ipcRenderer } from "electron"; import { UI } from "./ui"; export namespace Ident { - export function initUI() : void { + export function initUI(): void { let filePath: string | undefined; - let destinationPath: string; let fileLabel = document.getElementById("file-enc-path-label"); let fileField = document.getElementById("encryption-key") as HTMLInputElement; let lot = document.getElementById("lot-number") as HTMLInputElement; @@ -49,7 +48,7 @@ export namespace Ident { }); } - export function setDestinationPath(path: string) : void { + export function setDestinationPath(path: string): void { let destinationPathLabel = document.getElementById("show-destination-path"); destinationPathLabel!.innerHTML = path; } diff --git a/src/main.ts b/src/main.ts index 4b1b0b0..d47fb14 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,7 +28,7 @@ export namespace Main { mainWindow.webContents.once("dom-ready", () => { card.start(); }); - mainWindow.webContents.openDevTools(); + //mainWindow.webContents.openDevTools(); mainWindow.on('closed', Main.onClose); } diff --git a/src/pin.ts b/src/pin.ts index 8190cde..15d08d8 100644 --- a/src/pin.ts +++ b/src/pin.ts @@ -3,7 +3,7 @@ import { Utils } from "./utils"; import { ipcRenderer } from "electron"; export namespace PIN { - export function verifyPIN() : void { + export function verifyPIN(): void { let pin = document.getElementById("verify-pin-inp") as HTMLInputElement; let submitBtn = document.getElementById("verify-pin-btn") as HTMLInputElement; let cancelBtn = document.getElementById("verify-pin-cancel"); diff --git a/src/renderer.ts b/src/renderer.ts index 22d5d74..2ec1ee1 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -67,7 +67,7 @@ ipcRenderer.on("pub-key", (_, key) => { ipcRenderer.on("pairing-needed", (_, defpair: boolean) => { UI.addMessageToLog("No pairing found"); - if(defaultPass) { + if (defaultPass) { defaultPass = false; ipcRenderer.send("pairing-pass-submitted", "KeycardDefaultPairing"); } else { diff --git a/src/session-info.ts b/src/session-info.ts index d37e1d0..6b35154 100644 --- a/src/session-info.ts +++ b/src/session-info.ts @@ -20,7 +20,7 @@ export class SessionInfo { this.reset(); } - setApplicationInfo(appInfo: ApplicationInfo) { + setApplicationInfo(appInfo: ApplicationInfo) : void { this.instanceUID = Utils.hx(appInfo.instanceUID); this.appVersion = appInfo.getAppVersionString(); this.pairingSlots = appInfo.freePairingSlots.toString(); @@ -28,12 +28,12 @@ export class SessionInfo { this.hasMasterKey = appInfo.hasMasterKey(); } - setApplicationStatus(appStatus: ApplicationStatus) { + setApplicationStatus(appStatus: ApplicationStatus) : void { this.pinRetry = appStatus.pinRetryCount; this.pukRetry = appStatus.pukRetryCount; } - reset() { + reset() : void { this.cashAddress = ""; this.instanceUID = ""; this.appVersion = ""; diff --git a/src/ui.ts b/src/ui.ts index 5a3af1b..4777db9 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -12,7 +12,7 @@ export namespace UI { const btns = document.getElementsByClassName("keycard__cmd-disabled"); - export function saveCardInfo(appInfo: SessionInfo) : void { + export function saveCardInfo(appInfo: SessionInfo): void { cardInfo = appInfo; } @@ -32,18 +32,18 @@ export namespace UI { let msg = document.getElementById("no-card-detected-msg"); } - export function renderCmdScreenLayout(btn: HTMLElement, layoutPath: string, onLoad: () => void) : void { + export function renderCmdScreenLayout(btn: HTMLElement, layoutPath: string, onLoad: () => void): void { btn.addEventListener("click", (e) => { loadFragment(layoutPath, onLoad); e.preventDefault(); }); } - export function renderVerifyPinLayout(layoutPin: string, layoutPuk: string, pinFunc: () => void, pukFunc: () => void) : void { - cardInfo.pinRetry > 0 ? loadFragment(layoutPin, pinFunc) : loadFragment(layoutPuk, pukFunc); + export function renderVerifyPinLayout(layoutPin: string, layoutPuk: string, pinFunc: () => void, pukFunc: () => void): void { + cardInfo.pinRetry > 0 ? loadFragment(layoutPin, pinFunc) : loadFragment(layoutPuk, pukFunc); } - export function loadFragment(filename: string, onLoad: () => void) : void { + export function loadFragment(filename: string, onLoad: () => void): void { let path = `${__dirname}/../layouts/${filename}`; layoutContainer!.innerHTML = ""; @@ -82,14 +82,14 @@ export namespace UI { }); } - export function renderErrorMess(errMessage: string, messField: HTMLElement) : void { + export function renderErrorMess(errMessage: string, messField: HTMLElement): void { messField.innerHTML = errMessage; setTimeout(() => { messField.innerHTML = ""; }, 10000); } - export function renderNoAppInfo() : void { + export function renderNoAppInfo(): void { let header = document.getElementById("app-info-header"); header!.innerHTML = "No card connected"; header!.classList.remove("keycard__app-info-header");