IdlePixelMobile

A plugin to add mobile styling to idle-pixel.com

目前為 2023-01-24 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name IdlePixelMobile
// @namespace com.evolsoulx.idlepixel.mobile
// @version 1.0.4
// @description A plugin to add mobile styling to idle-pixel.com
// @author evolsoulx
// @license MIT
// @match *://idle-pixel.com/login/play*
// @grant GM_addStyle
// @require https://greasyfork.org/scripts/441206-idlepixel/code/IdlePixel+.js
// ==/UserScript==
(function() {
        'use strict';


    GM_addStyle(`
    #panels{background-color:blue !important;}
@media only screen and (max-width: 1000px) {

    body {}

    /*reworking panel grid layout to be vertical*/
    #panels {
        background-color: lightblue !important;
    }

    .top-bar {
        grid-column-start: 1 !important;
        grid-column-end: span 2 !important;
        grid-row-start: 1 !important;
        grid-row-end: span 1 !important;
    }

    #menu-bar {
        grid-column-start: 1 !important;
        grid-column-end: span 2 !important;
        grid-row-start: 2 !important;
        grid-row-end: span 1 !important;
    }

    #panels {
        grid-column-start: 1 !important;
        grid-column-end: span 2 !important;
        grid-row-start: 3 !important;
        grid-row-end: span 1 !important;
    }

    /*Menu rework*/
    .left-menu-item {
        margin-bottom: 3px;
        display: inline-block;
    }

    .hover.hover-menu-bar-item.left-menu-item {
        width: 90px;
        height: 90px;
        display: inline-block;
        border: 1px solid rgb(66, 66, 66);
        background-color: #54bcce;
        border-radius: 5pt;
        color: #F1F8F0;
        margin-bottom: 15px;
        text-align;
        center;
    }

    .hover.hover-menu-bar-item.left-menu-item img {
        width: 100%;
        height: 100%;
    }

    .color-light-red,
    .color-yellow,
    .color-silver {
        display: block;
        text-align: center;
        font-size: .9em;
    }

    div[data-tooltip*=menu-bar-oil] .color-silver,
    #menu-bar-oil-in,
    #menu-bar-oil-out {
        display: inline;
    }

    #menu-bar-buttons u {
        color: #F1F8F0;
        display: block;
        width: 100%;
        background-color: #0099A2;
        padding: 0px 10px;
        margin: 5px 0px;
        font-weight: bold;
        text-decoration: none;
        border: 1px none rgb(66, 66, 66);
        border-radius: 5pt;
    }

    .hover.hover-menu-bar-item.left-menu-item span:nth-of-type(1),
    #menu-bar-buttons hr,
    #menu-bar-buttons br {
        white-space: nowrap;
        overflow: hidden;
        display: none;
    }

    #menu-bar-buttons>hr:nth-child(26) {
        display: block;
    }

    .hover.hover-menu-bar-item.left-menu-item[onclick*=quests],
    .hover.hover-menu-bar-item.left-menu-item[onclick*=shop],
    .hover.hover-menu-bar-item.left-menu-item[onclick*=player-market],
    .hover.hover-menu-bar-item.left-menu-item[onclick*=donor-shop],
    .hover.hover-menu-bar-item.left-menu-item[onclick*=achievements] {
        white-space: nowrap;
        overflow: hidden;
    }


    /*rework notifications*/
    #notifications-area div[id*=notification] {
        width: 100%;
    }

    #ui-tweaks-notification-oil-full span {
        display: inline-block;
    }

    #panels {
        padding: 3px 0px;
    }

    .notifications-area {
        margin: 0px;
        padding: 0px;
    }

}
`);
        class MobilePlugin extends IdlePixelPlusPlugin {
            constructor() {
                super("mobile", {
                    about: {
                        name: GM_info.script.name,
                        version: GM_info.script.version,
                        author: GM_info.script.author,
                        description: GM_info.script.description,
                        grant: GM_info.script.grant
                    },
                    config: [{
                        type: "label",
                        label: "Is this a mobile script?"
                    },
                             {
                                 id: "MyCheckbox",
                                 label: "Yes / No",
                                 type: "boolean",
                                 default: true
                             }
                            ]
                });
            }

            onConfigsChanged() {
            }

            onLogin() {
                console.log("MobilePlugin.onLogin");
            }

            onMessageReceived(data) {
                // Will spam the console, uncomment if you want to see it
                //console.log("SamplePlugin.onMessageReceived: ", data);
            }

            onVariableSet(key, valueBefore, valueAfter) {
                // Will spam the console, uncomment if you want to see it
                //console.log("SamplePlugin.onVariableSet", key, valueBefore, valueAfter);
            }

            onChat(data) {
                // Could spam the console, uncomment if you want to see it
                //console.log("SamplePlugin.onChat", data);
            }

            onPanelChanged(panelBefore, panelAfter) {
                console.log("MobilePlugin.onPanelChanged", panelBefore, panelAfter);
            }

            onCombatStart() {
                console.log("MobilePlugin.onCombatStart");
            }

            onCombatEnd() {
                console.log("MobilePlugin.onCombatEnd");
            }

        }

        const plugin = new MobilePlugin();
        IdlePixelPlus.registerPlugin(plugin);

    })();