您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Ok tuşları UI'yi açmasın ama mouse hareketinde görünsün (tüm .ytp- elemanları otomatik algılanır)
当前为
- // ==UserScript==
- // @name YouTube Hide UI on Arrow Keys, Show on Mouse Move
- // @version 1.7
- // @namespace https://github.com/KaanAlper/youtube-ui-hide
- // @license GPL-3.0
- // @description Ok tuşları UI'yi açmasın ama mouse hareketinde görünsün (tüm .ytp- elemanları otomatik algılanır)
- // @author Kaan Alper Karaaslan
- // @match http://*.youtube.com/*
- // @match http://youtube.com/*
- // @match https://*.youtube.com/*
- // @match https://youtube.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- let hideTimeout;
- let hideUI = () => {
- document.querySelectorAll('[class^="ytp-"]').forEach(el => {
- el.style.opacity = '0';
- el.style.pointerEvents = 'none';
- });
- };
- let showUI = () => {
- document.querySelectorAll('[class^="ytp-"]').forEach(el => {
- el.style.opacity = '1';
- el.style.pointerEvents = 'auto';
- });
- };
- document.addEventListener('keydown', function(event) {
- if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
- clearTimeout(hideTimeout);
- setTimeout(hideUI, 100); // 100ms sonra UI tamamen gizle
- }
- });
- document.addEventListener('mousemove', function() {
- clearTimeout(hideTimeout);
- showUI();
- hideTimeout = setTimeout(hideUI, 2000); // 2 saniye sonra tekrar gizle
- });
- })();