Hide Inoreader Navigation Bar on Click

Shrinks and dims Inoreader's top navigation bar. Clicking restores original size. Clicking again shrinks the navigation bar.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Hide Inoreader Navigation Bar on Click
// @namespace    http://tampermonkey.net/
// @license      MIT
// @version      1.0
// @description  Shrinks and dims Inoreader's top navigation bar. Clicking restores original size. Clicking again shrinks the navigation bar. 
// @author       Rekt
// @match        *://*.inoreader.com/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const navBar = document.getElementById('subscriptions_buttons');
    let isNavBarExpanded = true; // Track the state of the navigation bar

    if (navBar) {
        const expandNavBar = () => {
            navBar.style.height = 'auto';
            navBar.style.overflow = 'visible';
            navBar.style.opacity = '1';
            isNavBarExpanded = true;
        };

        const minimizeNavBar = () => {
            navBar.style.height = '10px';
            navBar.style.overflow = 'hidden';
            navBar.style.opacity = '0.2';
            isNavBarExpanded = false;
        };

        document.addEventListener('click', (event) => {
            if (!event.target.closest('button, input[type="text"], img, .inno_toolbar_button_menu, .inno_toolbar_button_menu_item')) {
                if (navBar.contains(event.target)) {
                    // Toggle the navigation bar when clicking inside
                    isNavBarExpanded ? minimizeNavBar() : expandNavBar();
                } else {
                    // Automatically minimize if clicking outside the navbar/container
                    minimizeNavBar();
                }
            }
        });

        // Initialize with the navigation bar fully visible
        expandNavBar();
    }

})();