From 7bbbac61e9c12284999696673e845786b986761f Mon Sep 17 00:00:00 2001 From: Wumbo <58399748+WumboSpasm@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:43:25 -0400 Subject: [PATCH] web: Run formatter because I forgot to before --- web/packages/core/src/ruffle-player.ts | 22 +++++++++++++--------- web/packages/core/src/shadow-template.ts | 21 +++++++++++---------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/web/packages/core/src/ruffle-player.ts b/web/packages/core/src/ruffle-player.ts index 5a328981d8c18..5b7acbeeb076f 100644 --- a/web/packages/core/src/ruffle-player.ts +++ b/web/packages/core/src/ruffle-player.ts @@ -360,8 +360,8 @@ export class RufflePlayer extends HTMLElement { if (videoHolder) { videoHolder.textContent = ""; } - } - + }; + modalElement.parentNode!.addEventListener("click", hideModal); const modalArea = modalElement.querySelector(".modal-area"); if (modalArea) { @@ -391,9 +391,15 @@ export class RufflePlayer extends HTMLElement { "#volume-mute", ) as HTMLLabelElement; const volumeIcons = [ - volumeControlsModal.querySelector("#volume-min") as HTMLLabelElement, - volumeControlsModal.querySelector("#volume-mid") as HTMLLabelElement, - volumeControlsModal.querySelector("#volume-max") as HTMLLabelElement, + volumeControlsModal.querySelector( + "#volume-min", + ) as HTMLLabelElement, + volumeControlsModal.querySelector( + "#volume-mid", + ) as HTMLLabelElement, + volumeControlsModal.querySelector( + "#volume-max", + ) as HTMLLabelElement, ]; const volumeSlider = volumeControlsModal.querySelector( "#volume-slider", @@ -405,16 +411,14 @@ export class RufflePlayer extends HTMLElement { const setVolumeIcon = () => { if (this.volumeSettings.isMuted) { volumeMuteIcon.style.display = "inline"; - volumeIcons.forEach(icon => { + volumeIcons.forEach((icon) => { icon.style.display = "none"; }); } else { volumeMuteIcon.style.display = "none"; const iconIndex = Math.round(this.volumeSettings.volume / 50); volumeIcons.forEach((icon, i) => { - icon.style.display = i == iconIndex - ? "inline" - : "none"; + icon.style.display = i === iconIndex ? "inline" : "none"; }); } }; diff --git a/web/packages/core/src/shadow-template.ts b/web/packages/core/src/shadow-template.ts index 338b7c849384e..eabe0e9d335a8 100644 --- a/web/packages/core/src/shadow-template.ts +++ b/web/packages/core/src/shadow-template.ts @@ -353,7 +353,7 @@ export function applyStaticStyles(styleElement: HTMLStyleElement) { padding: 4px 0 12px; border-bottom: 2px solid rgba(var(--modal-foreground-rgb), 0.3); }`, - + `#backup-saves { background-color: rgba(var(--modal-foreground-rgb), 0.2); padding: 4px 8px; @@ -368,17 +368,17 @@ export function applyStaticStyles(styleElement: HTMLStyleElement) { height: calc(100% - 45px); min-height: 30px; }`, - + `#local-saves td { border-bottom: 2px solid rgba(var(--modal-foreground-rgb), 0.15); height: 30px; }`, - + `#local-saves td:nth-child(1) { width: 100%; word-break: break-all; }`, - + `.save-option { display: inline-block; width: 24px; @@ -388,19 +388,19 @@ export function applyStaticStyles(styleElement: HTMLStyleElement) { vertical-align: middle; opacity: 0.4; }`, - + `#local-saves > tr:hover .save-option { opacity: 1; }`, - + `#download-save { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='black'%3E%3Cpath d='M480-337q-8 0-15-2.5t-13-8.5L308-492q-12-12-11.5-28t11.5-28q12-12 28.5-12.5T365-549l75 75v-286q0-17 11.5-28.5T480-800q17 0 28.5 11.5T520-760v286l75-75q12-12 28.5-11.5T652-548q11 12 11.5 28T652-492L508-348q-6 6-13 8.5t-15 2.5ZM240-160q-33 0-56.5-23.5T160-240v-80q0-17 11.5-28.5T200-360q17 0 28.5 11.5T240-320v80h480v-80q0-17 11.5-28.5T760-360q17 0 28.5 11.5T800-320v80q0 33-23.5 56.5T720-160H240Z'/%3E%3C/svg%3E"); }`, - + `#replace-save { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -1080 960 1200' width='24px' fill='black'%3E%3Cpath d='M440-367v127q0 17 11.5 28.5T480-200q17 0 28.5-11.5T520-240v-127l36 36q6 6 13.5 9t15 2.5q7.5-.5 14.5-3.5t13-9q11-12 11.5-28T612-388L508-492q-6-6-13-8.5t-15-2.5q-8 0-15 2.5t-13 8.5L348-388q-12 12-11.5 28t12.5 28q12 11 28 11.5t28-11.5l35-35ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h287q16 0 30.5 6t25.5 17l194 194q11 11 17 25.5t6 30.5v447q0 33-23.5 56.5T720-80H240Zm280-560q0 17 11.5 28.5T560-600h160L520-800v160Z'/%3E%3C/svg%3E"); }`, - + `#delete-save { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -1020 960 1080' width='24px' fill='black'%3E%3Cpath d='M280-120q-33 0-56.5-23.5T200-200v-520q-17 0-28.5-11.5T160-760q0-17 11.5-28.5T200-800h160q0-17 11.5-28.5T400-840h160q17 0 28.5 11.5T600-800h160q17 0 28.5 11.5T800-760q0 17-11.5 28.5T760-720v520q0 33-23.5 56.5T680-120H280Zm120-160q17 0 28.5-11.5T440-320v-280q0-17-11.5-28.5T400-640q-17 0-28.5 11.5T360-600v280q0 17 11.5 28.5T400-280Zm160 0q17 0 28.5-11.5T600-320v-280q0-17-11.5-28.5T560-640q-17 0-28.5 11.5T520-600v280q0 17 11.5 28.5T560-280Z'/%3E%3C/svg%3E"); }`, @@ -842,8 +842,9 @@ volumeMuteIcon.title = text("volume-controls-unmute"); const volumeMinIcon = createLabelElement("volume-min", "mute-checkbox"); const volumeMidIcon = createLabelElement("volume-mid", "mute-checkbox"); const volumeMaxIcon = createLabelElement("volume-max", "mute-checkbox"); -[volumeMinIcon, volumeMidIcon, volumeMaxIcon] - .forEach(icon => icon.title = text("volume-controls-mute")); +[volumeMinIcon, volumeMidIcon, volumeMaxIcon].forEach( + (icon) => (icon.title = text("volume-controls-mute")), +); const volumeSliderText = createElement("span", "volume-slider-text"); const volumeModalClose = createElement("span", undefined, "close-modal");