dアニメストア 照準表示

真正面からアニメを視聴したい変人向け。動画再生ページでミドルボタンをクリックすると照準表示を切り替えられます。

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         dアニメストア 照準表示
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  真正面からアニメを視聴したい変人向け。動画再生ページでミドルボタンをクリックすると照準表示を切り替えられます。
// @match        https://animestore.docomo.ne.jp/animestore/sc_d_pc?partId=*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // Add CSS for the focus overlay
    GM_addStyle(`
        #focus-overlay {
            position: fixed;
            top: 50%;
            left: 50%;
            width: 10px;
            height: 10px;
            background: rgba(255, 255, 255, 0.7);
            border: 2px solid #fff;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            display: none;
            z-index: 9999;
        }
    `);

    // Create the focus overlay element
    const focusOverlay = document.createElement('div');
    focusOverlay.id = 'focus-overlay';
    document.body.appendChild(focusOverlay);

    // Toggle functionality
    let isFocused = false;
    function toggleFocus() {
        isFocused = !isFocused;
        focusOverlay.style.display = isFocused ? 'block' : 'none';
    }

    // Add event listener for middle mouse button click
    document.addEventListener('mousedown', (event) => {
        if (event.button === 1) { // 1 is the middle mouse button
            event.preventDefault(); // Prevent default middle click action
            toggleFocus();
        }
    });
})();