Procházet zdrojové kódy

fix: better version notif dialog

Sv443 před 1 rokem
rodič
revize
4d5551a097

+ 9 - 2
src/components/BytmDialog.css

@@ -135,12 +135,19 @@
 }
 
 .bytm-dialog-close {
+  cursor: pointer;
+}
+
+.bytm-dialog-header-img,
+.bytm-dialog-close
+{
   width: 32px;
   height: 32px;
-  cursor: pointer;
 }
 
-.bytm-dialog-close.small {
+.bytm-dialog-header-img.small,
+.bytm-dialog-close.small
+{
   width: 24px;
   height: 24px;
 }

+ 17 - 2
src/dialogs/versionNotif.ts

@@ -1,5 +1,5 @@
 import { host, scriptInfo } from "../constants";
-import { getChangelogMd, onInteraction, parseMarkdown, t } from "../utils";
+import { getChangelogMd, getResourceUrl, onInteraction, parseMarkdown, t } from "../utils";
 import { BytmDialog, createToggleInput } from "../components";
 import { getFeatures, setFeatures } from "../config";
 import pkg from "../../package.json" assert { type: "json" };
@@ -28,13 +28,28 @@ export async function getVersionNotifDialog({
       closeOnEscPress: true,
       destroyOnClose: true,
       smallDialog: true,
+      renderHeader,
       renderBody: () => renderBody({
         latestTag,
         changelogHtml,
       }),
     });
   }
-  return verNotifDialog!;
+  return verNotifDialog;
+}
+
+async function renderHeader() {
+  const headerEl = document.createElement("div");
+  headerEl.role = "heading";
+  headerEl.ariaLevel = "1";
+
+  const logoEl = document.createElement("img");
+  logoEl.classList.add("bytm-dialog-header-img", "bytm-no-select");
+  logoEl.src = await getResourceUrl("img-logo");
+  logoEl.alt = "BetterYTM logo";
+
+  headerEl.appendChild(logoEl);
+  return headerEl;
 }
 
 let disableUpdateCheck = false;

+ 1 - 1
src/features/layout.ts

@@ -624,7 +624,7 @@ export async function initHideCursorOnIdle() {
       };
 
       vidContainer.addEventListener("mouseenter", onMove);
-      vidContainer.addEventListener("mousemove", debounce(onMove, 25, "rising"));
+      vidContainer.addEventListener("mousemove", debounce(onMove, 10, "rising"));
       vidContainer.addEventListener("mouseleave", () => {
         clearTimeout(cursorHideTimer);
         hide();

+ 1 - 1
src/menu/menu_old.css

@@ -349,7 +349,7 @@
   display: flex;
   flex-direction: column;
   overflow-y: auto;
-  font-size: 1.5em;
+  font-size: 1.5rem;
   line-height: 20px;
 }