Greasy Fork

偶像大师闪耀色彩跳过培育动画 [大概双端适配?]

跳过培育动画自用,不懂代码,gpt写的.jpg icon引用的萌娘百科图片

目前为 2023-08-14 提交的版本。查看 最新版本

// ==UserScript==
// @name         偶像大师闪耀色彩跳过培育动画 [大概双端适配?]
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  跳过培育动画自用,不懂代码,gpt写的.jpg icon引用的萌娘百科图片
// @author       ER@关注b站EreRe_看折纸纸片人谢谢喵
// @match        https://shinycolors.enza.fun/produce/home
// @match        https://shinycolors.enza.fun/produce
// @match        https://shinycolors.enza.fun/produce/?a=#
// @match        https://shinycolors.enza.fun/produce/?a=
// @match        https://shinycolors.enza.fun/produce/?#
// @match        https://shinycolors.enza.fun/produce/?
// @icon         https://img.moegirl.org.cn/common/thumb/4/41/IM%40S_SC_Swan_Mark.svg/99px-IM%40S_SC_Swan_Mark.svg.png
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    const buttonA = document.createElement('button');
    buttonA.textContent = 'A';
    buttonA.style.cssText = `
        position: absolute;
        bottom: 3vw;
        left: 41vw; /* 宽度的一半,居中 */
        opacity: 0.4;
        background-color: gray;
        color: white;
        font-weight: bold;
        border: none;
        padding: 0;
        cursor: pointer;
        width: 8vw; /* 宽度为8vw */
        height: 8vw; /* 高度为8vw */
    `;

    // 创建按钮b
    const buttonB = document.createElement('button');
    buttonB.textContent = 'B';
    buttonB.style.cssText = `
        position: absolute;
        bottom: 3vw; /* 底部距离 */
        left:51vw; /* 宽度的一半 + 宽度 + 间距,居中 */
        opacity: 0.4;
        background-color: gray;
        color: white;
        font-weight: bold;
        border: none;
        padding: 0;
        cursor: pointer;
        width: 8vw; /* 宽度为8vw */
        height: 8vw; /* 高度为8vw */
    `;

    // 将按钮添加到页面
    document.body.appendChild(buttonA);
    document.body.appendChild(buttonB);

    const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);

    // 按钮a的点击事件
    buttonA.addEventListener('click', function() {
        if (isMobile) {
            window.location.href = 'https://shinycolors.enza.fun/produce/?';
        } else {
            window.location.href = 'https://shinycolors.enza.fun/produce/?a=';
        }
    });

    // 按钮b的点击事件
    buttonB.addEventListener('click', function() {
        if (isMobile) {
            window.location.href = 'https://shinycolors.enza.fun/produce/?#';
        } else {
            window.location.href = 'https://shinycolors.enza.fun/produce/?a=#';
        }
    });

})();