[GC] Missing Instruments

Lists all of the instruments that you need still need.

目前为 2024-11-12 提交的版本。查看 最新版本

// ==UserScript==
// @name         [GC] Missing Instruments
// @namespace    https://www.grundos.cafe/
// @version      1.9
// @description  Lists all of the instruments that you need still need.
// @match        https://www.grundos.cafe/instruments/?pet_name=*
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // List of instruments with images and links
    const instrumentData = {
        "Accordion": ["https://grundoscafe.b-cdn.net/items/mus_accordian.gif", "/search/items/?item_name=Accordion"],
        "Air Faerie Guitar": ["https://grundoscafe.b-cdn.net/items/inst_guitar_faerie.gif", "/search/items/?item_name=Air Faerie Guitar"],
        "Baby Drum": ["https://grundoscafe.b-cdn.net/items/inst_baby_drum.gif", "/search/items/?item_name=Baby Drum"],
        "Baby Whistle": ["https://grundoscafe.b-cdn.net/items/inst_baby_whistle.gif", "/search/items/?item_name=Baby Whistle"],
        "Bagpipes": ["https://grundoscafe.b-cdn.net/items/inst_bagpipes.gif", "/search/items/?item_name=Bagpipes"],
        "Bass Guitar": ["https://grundoscafe.b-cdn.net/items/mus_bass.gif", "/search/items/?item_name=Bass Guitar"],
        "Blueberry Jelly Bass": ["https://grundoscafe.b-cdn.net/items/inst_jelly_bass.gif", "/search/items/?item_name=Blueberry Jelly Bass"],
        "Blue Kazoo": ["https://grundoscafe.b-cdn.net/items/inst_kazoo_blue.gif", "/search/items/?item_name=Blue Kazoo"],
        "Blue Moehawk Guitar": ["https://grundoscafe.b-cdn.net/items/moehawk_guitar2.gif", "/search/items/?item_name=Blue Moehawk Guitar"],
        "Bongo Drums": ["https://grundoscafe.b-cdn.net/items/toy_bongo.gif", "/search/items/?item_name=Bongo Drums"],
        "Bruce Maracas": ["https://grundoscafe.b-cdn.net/items/inst_bruce_maracas.gif", "/search/items/?item_name=Bruce Maracas"],
        "Castanets": ["https://grundoscafe.b-cdn.net/items/imus_castanets.gif", "/search/items/?item_name=Castanets"],
        "Cello": ["https://grundoscafe.b-cdn.net/items/mus_cello.gif", "/search/items/?item_name=Cello"],
        "Clarinet": ["https://grundoscafe.b-cdn.net/items/toy_clarinet.gif", "/search/items/?item_name=Clarinet"],
        "Colourful Xylophone": ["https://grundoscafe.b-cdn.net/items/toy_xylophone.gif", "/search/items/?item_name=Colourful Xylophone"],
        "Earth Faerie Recorder": ["https://grundoscafe.b-cdn.net/items/inst_recorder_faerie.gif", "/search/items/?item_name=Earth Faerie Recorder"],
        "Faerie Saxophone": ["https://grundoscafe.b-cdn.net/items/inst_saxaphone_faerie.gif", "/search/items/?item_name=Faerie Saxophone"],
        "Fire Violin": ["https://grundoscafe.b-cdn.net/items/fire_violin.gif", "/search/items/?item_name=Fire Violin"],
        "Flower Bass": ["https://grundoscafe.b-cdn.net/items/inst_flowerbass.gif", "/search/items/?item_name=Flower Bass"],
        "Flower Cello": ["https://grundoscafe.b-cdn.net/items/inst_flower_cello.gif", "/search/items/?item_name=Flower Cello"],
        "Flower Trumpet": ["https://grundoscafe.b-cdn.net/items/inst_flowertrumpet.gif", "/search/items/?item_name=Flower Trumpet"],
        "Flute": ["https://grundoscafe.b-cdn.net/items/toy_flute.gif", "/search/items/?item_name=Flute"],
        "French Horn": ["https://grundoscafe.b-cdn.net/items/mus_frenchhorn.gif", "/search/items/?item_name=French Horn"],
        "Ghostkerchief Banjo": ["https://grundoscafe.b-cdn.net/items/inst_ghostkerchief_banjo.gif", "/search/items/?item_name=Ghostkerchief Banjo"],
        "Gloomy Drums": ["https://grundoscafe.b-cdn.net/items/inst_gloomy_drums.gif", "/search/items/?item_name=Gloomy Drums"],
        "Gloomy Harp": ["https://grundoscafe.b-cdn.net/items/inst_gloomy_harp.gif", "/search/items/?item_name=Gloomy Harp"],
        "Grand Piano": ["https://grundoscafe.b-cdn.net/items/mus_grandpiano.gif", "/search/items/?item_name=Grand Piano"],
        "Grape Jelly Bongos": ["https://grundoscafe.b-cdn.net/items/inst_jelly_bongos.gif", "/search/items/?item_name=Grape Jelly Bongos"],
        "Gruundo Guitar": ["https://grundoscafe.b-cdn.net/items/gif_band_guitar.gif", "/search/items/?item_name=Gruundo Guitar"],
        "Harmonica": ["https://grundoscafe.b-cdn.net/items/toy_harmonica.gif", "/search/items/?item_name=Harmonica"],
        "Harp": ["https://grundoscafe.b-cdn.net/items/mus_harp.gif", "/search/items/?item_name=Harp"],
        "Heart Drums": ["https://grundoscafe.b-cdn.net/items/inst_valentinedrums.gif", "/search/items/?item_name=Heart Drums"],
        "Ice Accordion": ["https://grundoscafe.b-cdn.net/items/ice_accordion.gif", "/search/items/?item_name=Ice Accordion"],
        "Ice Harp": ["https://grundoscafe.b-cdn.net/items/ice_harp.gif", "/search/items/?item_name=Ice Harp"],
        "Jelly Triangle": ["https://grundoscafe.b-cdn.net/items/inst_jelly_triangle.gif", "/search/items/?item_name=Jelly Triangle"],
        "Jelly Xylophone": ["https://grundoscafe.b-cdn.net/items/inst_jelly_xylophone.gif", "/search/items/?item_name=Jelly Xylophone"],
        "Kau Bell": ["https://grundoscafe.b-cdn.net/items/imus_cowbell.gif", "/search/items/?item_name=Kau Bell"],
        "Light Faerie Harp": ["https://grundoscafe.b-cdn.net/items/inst_harp_faerie.gif", "/search/items/?item_name=Light Faerie Harp"],
        "Maccy Synth": ["https://grundoscafe.b-cdn.net/items/toy_synth.gif", "/search/items/?item_name=Maccy Synth"],
        "Mandolin": ["https://grundoscafe.b-cdn.net/items/inst_mandolin.gif", "/search/items/?item_name=Mandolin"],
        "Mystic Guitar": ["https://grundoscafe.b-cdn.net/items/inst_acoustic_guit.gif", "/search/items/?item_name=Mystic Guitar"],
        "Oboe": ["https://grundoscafe.b-cdn.net/items/toy_oboe.gif", "/search/items/?item_name=Oboe"],
        "Orange Jelly Guitar": ["https://grundoscafe.b-cdn.net/items/inst_jelly_guitar.gif", "/search/items/?item_name=Orange Jelly Guitar"],
        "Piano": ["https://grundoscafe.b-cdn.net/items/toy_piano.gif", "/search/items/?item_name=Piano"],
        "Pink Ukulele": ["https://grundoscafe.b-cdn.net/items/pink_ukulele.gif", "/search/items/?item_name=Pink Ukulele"],
        "Pink Violin": ["https://grundoscafe.b-cdn.net/items/inst_pink_violin.gif", "/search/items/?item_name=Pink Violin"],
        "Plushie Banjo": ["https://grundoscafe.b-cdn.net/items/inst_banjo_plushie.gif", "/search/items/?item_name=Plushie Banjo"],
        "Plushie Drum": ["https://grundoscafe.b-cdn.net/items/inst_drum_plushie.gif", "/search/items/?item_name=Plushie Drum"],
        "Plushie Trumpet": ["https://grundoscafe.b-cdn.net/items/inst_trumpet_plushie.gif", "/search/items/?item_name=Plushie Trumpet"],
        "Rainbow Guitar": ["https://grundoscafe.b-cdn.net/items/inst_rainbow_guitar.gif", "/search/items/?item_name=Rainbow Guitar"],
        "Recorder": ["https://grundoscafe.b-cdn.net/items/toy_recorder.gif", "/search/items/?item_name=Recorder"],
        "Red Moehawk Guitar": ["https://grundoscafe.b-cdn.net/items/moehawk_guitar1.gif", "/search/items/?item_name=Red Moehawk Guitar"],
        "Saxophone": ["https://grundoscafe.b-cdn.net/items/toy_saxaphone.gif", "/search/items/?item_name=Saxophone"],
        "Spirited Fiddle": ["https://grundoscafe.b-cdn.net/items/mus_fiddle.gif", "/search/items/?item_name=Spirited Fiddle"],
        "Stone Trumpet": ["https://grundoscafe.b-cdn.net/items/inst_stone_trumpet.gif", "/search/items/?item_name=Stone Trumpet"],
        "Trombone": ["https://grundoscafe.b-cdn.net/items/toy_trombone.gif", "/search/items/?item_name=Trombone"],
        "Trumpet": ["https://grundoscafe.b-cdn.net/items/toy_trumpet.gif", "/search/items/?item_name=Trumpet"],
        "Violin": ["https://grundoscafe.b-cdn.net/items/toy_violin.gif", "/search/items/?item_name=Violin"],
        "Wadjet Saxophone": ["https://grundoscafe.b-cdn.net/items/mus_wadjet_saxophone.gif", "/search/items/?item_name=Wadjet Saxophone"],
        "Wock Til You Drop Guitar": ["https://grundoscafe.b-cdn.net/items/special_wock_guitar.gif", "/search/items/?item_name=Wock Til You Drop Guitar"],
        "Wooden Washboard": ["https://grundoscafe.b-cdn.net/items/mus_washboard.gif", "/search/items/?item_name=Wooden%20Washboard"]
    };

    const displayedInstruments = Array.from(document.querySelectorAll('.instrument-name')).map(el => el.textContent.trim());
    const missingInstruments = Object.keys(instrumentData).filter(instrument => !displayedInstruments.includes(instrument));

    if (missingInstruments.length > 0) {
        const missingContainer = document.createElement('div');
        missingContainer.className = 'missing-instruments-grid';
        missingContainer.style.display = 'grid';
        missingContainer.style.gridTemplateColumns = 'repeat(auto-fill, minmax(120px, 1fr))';
        missingContainer.style.gap = '10px';
        missingContainer.style.marginTop = '20px';
        missingContainer.style.padding = '10px';
        missingContainer.style.backgroundColor = '#f9f9f9';
        missingContainer.style.border = '1px solid #ccc';
        missingContainer.style.borderRadius = '8px';

        const title = document.createElement('h2');
        title.textContent = "Missing Instruments";
        title.style.textAlign = 'center';
        title.style.gridColumn = 'span 4';
        missingContainer.appendChild(title);

        missingInstruments.forEach(instrument => {
            const cardLink = document.createElement('a');
            cardLink.href = instrumentData[instrument][1];
            cardLink.target = "_blank";
            cardLink.style.textDecoration = 'none';
            cardLink.style.color = 'inherit';

            const card = document.createElement('div');
            card.style.display = 'flex';
            card.style.flexDirection = 'column';
            card.style.alignItems = 'center';
            card.style.textAlign = 'center';
            card.style.padding = '10px';
            card.style.border = '1px solid #ccc';
            card.style.borderRadius = '8px';
            card.style.backgroundColor = '#fff';

            const image = document.createElement('img');
            image.src = instrumentData[instrument][0];
            image.alt = instrument;
            image.style.width = '80px';
            image.style.height = '80px';
            image.style.marginBottom = '8px';

            const name = document.createElement('div');
            name.textContent = instrument;
            name.style.fontWeight = 'bold';

            card.appendChild(image);
            card.appendChild(name);
            cardLink.appendChild(card);
            missingContainer.appendChild(cardLink);
        });

        const instrumentsGrid = document.querySelector('.instruments-grid');
        if (instrumentsGrid) {
            instrumentsGrid.parentNode.insertBefore(missingContainer, instrumentsGrid.nextSibling);
        }
    }
})();