YouTube Music volume control shortcut

YouTube Musicで音量を変更するキーボードショートカットを追加

// ==UserScript==
// @name                YouTube Music volume control shortcut
// @name:ja             YouTube Music volume control shortcut
// @name:en             YouTube Music volume control shortcut
// @name:zh-CN          YouTube Music volume control shortcut
// @name:ko             YouTube Music volume control shortcut
// @name:ru             YouTube Music volume control shortcut
// @name:de             YouTube Music volume control shortcut
// @description         YouTube Musicで音量を変更するキーボードショートカットを追加
// @description:ja      YouTube Musicで音量を変更するキーボードショートカットを追加
// @description:en      Add keyboard shortcuts to change the volume of YouTube Music
// @description:zh-CN   添加键盘快捷键来改变YouTube Music的音量
// @description:ko      YouTube Music의 볼륨을 변경하는 키보드 단축키 추가
// @description:ru      Добавьте сочетания клавиш для изменения громкости YouTube Music
// @description:de      Fügen Sie Tastaturkürzel hinzu, um die Lautstärke von YouTube Music zu ändern
// @version             1.0.6
// @author              Yos_sy
// @match               https://music.youtube.com/*
// @namespace           http://tampermonkey.net/
// @icon                data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAvjklEQVR4Xu2dB5iURdLHBzGHM1xQz/PuvktIOkCQJKKiggEDiOcpGBFFBSOgCMuSBHYJkleyAQR2F4RFUFAUBEEwK0eWlSRyBypBXBW2vv51T8+82zuzOzM7y76Efp56Fmbet7vqX93V1dXVPYHAIVIkI7OijMzqpGiyjJ2xVYZPFek9VuTJ50Ra9xS55WmRax4RadhG5MJWIhVbiPzf9SLnNBE54zKRkxuInFBP5Ng6IuVqiQRqFiQ+4zue4Vne4V3qoC7qpG7aoC3apG14gBd4gjd4VLy6/B8tJSxHO8ARUiRj2h8kI/svMjKzsmRk1VKAtlTUTlGajHl1vgJ6pwyZLNJjtFFAm14i/1IKufZRkcseEKl9p0iVf4n89UaR868V+e2VIr9qKHJSfZHj6yol1y6iA9Q2z/As7/AudVAXdVI3bdAWbdI2PMALPMEbPMLryGx4bmlkQBYlk5LNlfdoCRYF0J8UYDcrwB5Vf9MVTZLxOZ+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WEQ4VGyaMOpuZgwku0GlimEK8++9eZVKXzUSiDdqiTdqGB3ixczs8wis8wzsyIAsyIRsyIms8Z/UO9xI8i9hKH1/mDDsXGTBSuNKEe20AkMOXxMS5644sXIIljC4CJ1yCzE3YRNDYNiWowhqbn0hBYSjPdoZoncAq3yqdd3iXOqiLOqmbNmiLNmkbHuAFnuANHuEVnuEdGczx7F1aNnNEu9VR5TtFjYiqwv0EXGCgI19Zk8x9Ntnr9c1WgIjDhBnltkuuPOXeWy4/ZqRxSpezd3jXKIjRSFgV5dlkTW8nKNQBHOXzDu9SB3VRJ3XTBm3RJm3DA7zAE7zBI7zCM7wjg76WRadsIdvNyOrKf7QEi7mphOtqMtW8mFVLuL1sZFY7MYdT5utbLrnqlBi591Aod+DzQwgkTXC8C+fLriQw1V5LEK0DeEc+71gPnrqok7ppg7a8h0ThBZ7gzVzCyKEMeG5pZEAWJVO0mzmOluKLAvIqMbdbTtb33DKf2pPBmFt+AIFfwcAU83s4bKWSREG0jXmaH0rUCSp1iugAwewbnuUd3qUO6qJO6qYN2qJNe0JYX7+ieDLXr3YqcAHj0ZKccrQDlE75f9m3TRiumfLbAAAAAElFTkSuQmCC
// @license             MIT
// @run-at              document-start
// @grant               none
// ==/UserScript==

(function () {
  "use strict";

  // 翻訳オブジェクト
  const TRANSLATIONS = {
    en: { volumeChanged: "Volume" },
    ja: { volumeChanged: "音量" },
    zh: { volumeChanged: "音量" },
    ko: { volumeChanged: "볼륨" },
    ru: { volumeChanged: "Громкость" },
    de: { volumeChanged: "Lautstärke" },
  };

  const lang =
    (navigator.language || navigator.userLanguage).split("-")[0] || "en";

  // 音量変更のキーボードショートカット
  function setupKeyboardShortcuts() {
    document.addEventListener("keydown", handleVolumeChange);
  }

  // キーボードイベントを処理
  function handleVolumeChange(event) {
    const volumeSlider = document.querySelector(
      'tp-yt-paper-slider[id="volume-slider"]'
    );
    if (!volumeSlider) return;

    const isVolumeUp = event.key === "ArrowUp";
    const isVolumeDown = event.key === "ArrowDown";

    if (!(isVolumeUp || isVolumeDown)) return;

    event.preventDefault();

    const currentVolume = volumeSlider.value;
    let newVolume = calculateNewVolume(currentVolume, isVolumeUp, event);

    if (newVolume !== null) {
      updateVolume(volumeSlider, newVolume);
    }
  }

  // キーボードショートカットの設定
  function calculateNewVolume(currentVolume, isVolumeUp, event) {
    if (event.altKey && !event.ctrlKey && !event.shiftKey) {
      // Alt + ↑/↓: 音量を1%上げる/下げる
      return isVolumeUp
        ? Math.min(100, currentVolume + 1)
        : Math.max(0, currentVolume - 1);
    } else if (event.ctrlKey && event.altKey && !event.shiftKey) {
      // Ctrl + Alt + ↑/↓: 音量を5%上げる/下げる
      return isVolumeUp
        ? Math.min(100, currentVolume + 5)
        : Math.max(0, currentVolume - 5);
    } else if (event.ctrlKey && event.shiftKey && event.altKey) {
      // Ctrl + Shift + Alt + ↑/↓: 0% / 50% / 100% 変更
      return isVolumeUp
        ? currentVolume < 50
          ? 50
          : 100
        : currentVolume > 50
          ? 50
          : 0;
    }
    return null;
  }

  // 音量を更新し、通知を表示
  function updateVolume(volumeSlider, newVolume) {
    volumeSlider.value = newVolume;
    volumeSlider.dispatchEvent(new Event("change"));
    updateVolumeNotification(newVolume);
  }

  // 音量変更通知を更新
  function updateVolumeNotification(volume) {
    let notification = document.getElementById("ytmusic-volume-notification");

    if (!notification) {
      notification = createNotificationElement();
    }

    notification.textContent = `${TRANSLATIONS[lang].volumeChanged}: ${volume}%`;
    notification.style.display = "block";

    // 既存のタイムアウトをクリアし、新しいタイムアウトを設定
    clearTimeout(notification.hideTimeout);
    notification.hideTimeout = setTimeout(() => {
      notification.style.display = "none";
    }, 2000);
  }

  // 通知を作成
  function createNotificationElement() {
    const notification = document.createElement("div");
    notification.id = "ytmusic-volume-notification";
    notification.style.cssText = `
            position: fixed; bottom: 20px; right: 20px; background-color: rgba(0, 0, 0, 0.7);
            color: white; padding: 10px; border-radius: 5px; z-index: 9999; display: none;
        `;
    document.body.appendChild(notification);
    return notification;
  }

  setupKeyboardShortcuts();
})();