diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 5438bbab..fe9b9a58 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -263,19 +263,19 @@ "description": "The second line of the message displayed after the notice was upgraded." }, "setSkipShortcut": { - "message": "Set key for skipping a segment" + "message": "Skip segment", + "description": "Keybind label" }, "setStartSponsorShortcut": { - "message": "Set key for start/stop segment keybind" + "message": "Start/stop segment", + "description": "Keybind label" }, "setSubmitKeybind": { - "message": "Set key for submission keybind" + "message": "Submit segments", + "description": "Keybind label" }, "keybindDescription": { - "message": "Select a key by typing it" - }, - "keybindDescriptionComplete": { - "message": "The keybind has been set to: " + "message": "Select a key by typing it and choose any modifier keys you wish to use." }, "0": { "message": "Connection Timeout. Check your internet connection. If your internet is working, the server is probably overloaded or down." @@ -384,9 +384,6 @@ "createdBy": { "message": "Created By" }, - "keybindCurrentlySet": { - "message": ". It is currently set to:" - }, "supportOtherSites": { "message": "Support 3rd Party YouTube-Sites" }, @@ -511,11 +508,8 @@ "copyDebugInformationComplete": { "message": "The debug information has been copied to the clip board. Feel free to remove any information you would rather not share. Save this in a text file or paste into the bug report." }, - "theKey": { - "message": "The key" - }, "keyAlreadyUsed": { - "message": "is bound to another action. Please select another key." + "message": "This shortcut is bound to another action. Please select a different one." }, "to": { "message": "to", @@ -859,7 +853,7 @@ "description": "Appears in Options as a tab header for options related to GUI and sounds. To fit inside the button, it should not be longer than ~20-25 characters (depending on their width)." }, "optionsTabKeyBinds": { - "message": "Key Bindings", + "message": "Keyboard shortcuts", "description": "Appears in Options as a tab header for keybinds. To fit inside the button, it should not be longer than ~20-25 characters (depending on their width)." }, "optionsTabPrivacy": { @@ -877,5 +871,18 @@ "noticeVisibilityLabel": { "message": "Skip notice appearance", "description": "Option label" + }, + "unbind": { + "message": "Unbind", + "description": "Unbind keyboard shortcut" + }, + "notSet": { + "message": "Not set" + }, + "change": { + "message": "Change" + }, + "youtubeKeybindWarning": { + "message": "This is a built-in YouTube shortcut. Are you sure you want to use it?" } } diff --git a/public/options/options.css b/public/options/options.css index 1742e0d5..fabd9c4e 100644 --- a/public/options/options.css +++ b/public/options/options.css @@ -7,7 +7,7 @@ html { body { background-color: #333333; } -#navigation { +#navigation, #keybind-dialog .dialog { background-color: #181818; color: white; } @@ -41,6 +41,9 @@ h1,h2,h3,h4,h5,h6 { .categoryTableElement td { border-top: 1px solid #484848; } +.key, #keybind-dialog .dialog { + border-color: white; +} /* Light mode, if requested */ @media only screen and (prefers-color-scheme: light) { @@ -50,7 +53,7 @@ h1,h2,h3,h4,h5,h6 { body { background-color: #f9f9f9; } - #navigation { + #navigation, #keybind-dialog .dialog { background-color: #dbdbdb; color: #212121; } @@ -84,6 +87,9 @@ h1,h2,h3,h4,h5,h6 { .categoryTableElement td { border-top: 1px solid #d9d9d9; } + .key, #keybind-dialog .dialog { + border-color: black; + } } html, body { @@ -140,7 +146,7 @@ html, body { padding: 20px 0; } -.option-group > div:last-child { +.option-group > div:last-child, .option-group > #keybind-dialog { border-bottom: inherit; } @@ -148,10 +154,94 @@ html, body { font-size: 14px; } +div[data-type="keybind-change"] .optionLabel { + display: inline-block; + min-width: 150px; + margin-right: 20px; +} + input[type='number'] { width: 50px; } +.key { + border-width: 1px; + border-style: solid; + border-radius: 5px; + display: inline-block; + min-width: 33px; + text-align: center; + font-weight: bold; +} + +.unbound, .key { + padding: 8px; +} + +.keybind-buttons { + border-radius: 5px; + padding: 5px 3px; + cursor: pointer; + margin-right: 10px; +} + +.keybind-buttons:hover { + background-color: #00000080; +} + +.keybind-buttons > div, .keybind-buttons > span { + margin: 0 2px; +} + +#keybind-dialog .dialog { + position: fixed; + border-width: 3px; + border-style: solid; + border-radius: 15px; + max-height: 100vh; + width: 400px; + overflow-x: auto; + z-index: 100; + padding: 15px; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + +#change-keybind-buttons { + float: right; +} + +#change-keybind-buttons > .option-button { + margin: 0 2px; +} + +#change-keybind-settings { + margin: 15px 15px 30px; +} + +#change-keybind-settings .key { + vertical-align: top; + margin: 15px 0 0 40px; + height: 34px; +} + +#change-keybind-error { + margin-bottom: 15px; + color: red; + font-weight: bold; +} + +.blocker { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 90; + background-color: #00000080; +} + .low-profile { height: 23px; line-height: 5px; diff --git a/public/options/options.html b/public/options/options.html index b843c108..c907889e 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -289,54 +289,19 @@