Evergreen theme for flomo

Flomo 第三方主题插件

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Evergreen theme for flomo
// @version      1.1.2
// @author       zwithz
// @description  Flomo 第三方主题插件
// @match        https://flomo.app/*
// @namespace https://greasyfork.org/users/685325
// ==/UserScript==

(function() {
    'use strict';
    const url='https://gist.githubusercontent.com/zwithz/cbde0915b2675781675d89bcfd517f46/raw/';
    fetch(url).then(rsp=>rsp.text()).then(csstxt=>{
        let s = document.createElement('style');
        s.setAttribute('type', 'text/css');
        s.appendChild(document.createTextNode(csstxt));
        document.querySelector('head').appendChild(s);
        console.log('Inserted flomo evergreen theme, enjoy :\)');
    })

    function hideByClassName(className) {
        const target = document.getElementsByClassName(className)[0];
        target.style.display = target.style.display === "none" ? "" : "none";
    }

    function focusMode() {
        hideByClassName('el-aside');
        hideByClassName('input-box');
    }

    // Hide left sidebar and bottom input box
    let parentNode = document.querySelectorAll('div.topbar')[0];
    const siblingNode = document.querySelectorAll('div.search')[0];
    let focusModeButton = document.createElement('input');
    focusModeButton.setAttribute('type', 'button');
    focusModeButton.setAttribute('id', 'hide-sidebar');
    focusModeButton.setAttribute('value', '👨‍💻 ');
    focusModeButton.setAttribute('padding', '5px');
    focusModeButton.onclick = focusMode;
    parentNode.insertBefore(focusModeButton, siblingNode);
})();