GC - Mark Gardening Items - Red text

Makes gardening items text red on Grundos Cafe inventory, quickstock, and SDB. Easy to change color, just change the 3 "red" to whatever you want.

// ==UserScript==
// @name         GC - Mark Gardening Items - Red text
// @namespace    https://greasyfork.org/users/1295622
// @version      1.0
// @description  Makes gardening items text red on Grundos Cafe inventory, quickstock, and SDB. Easy to change color, just change the 3 "red" to whatever you want.
// @author       spiderpool1855
// @match        https://www.grundos.cafe/inventory/*
// @match        https://www.grundos.cafe/quickstock*
// @match        https://www.grundos.cafe/safetydeposit*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // List of gardening items from /~Plant
    const gardeningItems = ["Blossom", "Fire Bush", "Furrn", "Glass Roses", "Rowzes", "Spiky Bush", "Boadaisy", "Dragonbud", "Dunkydoos", "Dwarf Tree", "Gardenias", "Instant Roses", "Orb Plant", "Pebeanjay Flowers", "Perfume Mallows", "Rock Tree", "Rubber Plant", "Sparkling Flotsam Fountain", "Zobamints", "Blumbs", "Curious Moehog Gnome", "Flower Picking Xweetok Gnome", "Lazydels", "Meepie Tree", "Pineapple Plant", "Potting Bench", "Candy Floss Tree", "Cave Rock", "Cheeky Cybunny Gnome", "Curious Blumaroo Gnome", "Curious Jubjub Gnome", "Digging Lupe Gnome", "Day Dreaming Nimmo Gnome", "Extra Wild Orchid", "Fishing Jetsam Gnome", "Fishing Kiko Gnome", "Flower Picking Gelert Gnome", "Fuzz Collars", "Gardening Grundo Gnome", "Green Kau Gnome", "Happy Acara Fishing Gnome", "Happy Yurble Fishing Gnome", "Hunting Grarrl Gnome", "Kollie Flower", "Korbat Flower Gnome", "Lightning Fern", "Musical Lupe Gnome", "Nimmo Athlete Statue", "Nose Picking Mynci Gnome", "Rose Tree", "Sitting Aisha Gnome", "Sitting Bruce Gnome", "Sleeping Hissi Gnome", "Star of Paradise Flower", "Straining Aisha Fishing Gnome", "Sulky Ixi Gnome", "Sunday Bush", "Swimming Flotsam Statue", "Swirlypop Plant", "Tree Weed", "Unlucky Usul Fishing Gnome", "Yellow Birdhouse", "Yellow Eesa Tree", "Face Pulling Kiko Gnome", "Flower Picking Bori Gnome", "Gardening Lenny Gnome", "Gazebo", "Green Hissi Gnome", "Halloween Acara Gnome", "Negg Muncher", "Orange Yurble Gnome", "Pink Bonsai Tree", "Pink Pteri Fountain", "Purple Peophin Gnome", "Rainbow Morning Flower", "Rainbow Turnip", "Roped Bridge", "Sand Pit", "Sillie Daisy", "Snakebush", "Song Flowers", "Bad Seed", "Blumaroo Statue", "Bonsai Chia", "Chia Statue", "Floating Cactus Flower", "Flower Picking Kiko Gnome", "Furry Autumn Bushes", "Garden Bench", "Halloween Meerca Gnome", "Quiggle Statue", "Rainbow Flower", "Regal Bridge", "Scarescorchio", "Shoyru Statue", "Star Tree", "Strange Bulb", "Sugar Bridge", "Techo Statue", "Twisting Vines", "White Picket Fence", "Giant Green Kelp", "Mossy Rock", "Plushie Fungus", "Spongy Algae", "Magic Crystalline Kelp", "Shimmery Seagrass", "Darigan Seaweed", "Cinder Block Sea Fungus", "Void Plant", "Cubical Sea Fungus", "Grey Sea Fern", "Prismatic Sea Fern", "Starry Sea Fern", "Giant Brown Kelp", "Cheery Plant", "Giant Red Kelp", "Yellow Daffodil", "White Daffodil", "Chewing Dung", "Dung Arm Chair", "Dung Basket", "Dung Bath Tub", "Dung Bed", "Dung Box", "Dung Cake", "Dung Carpet", "Dung Fireplace", "Dung Jelly", "Dung Pizza", "Dung Reclining Chair", "Dung Scarab", "Dung Shelf", "Dung Shield", "Dung Slushie", "Dung Sofa", "Dung Table", "Frozen Pile of Dung", "How its Dung", "Pile of Dung", "Rainbow Dung", "Bucket of Sludge", "Sludge Iced Coffee", "Pile of Sludge", "Sludge Pie", "Apple Core", "Zeenana Peel", "Compost Dung Right", ];

    // mark inventory items
    function markInventoryItems() {
        const items = document.querySelectorAll('.inv-item');

        items.forEach(item => {
            const itemNameElement = item.querySelector('.inv-item-name');
            if (itemNameElement) {
                const itemName = itemNameElement.textContent.trim();
                if (gardeningItems.includes(itemName)) {
                    item.style.color = 'red'; // Marking by changing text color
                }
            }
        });
    }

    // mark quickstock items
    function markQuickstockItems() {
        const items = document.querySelectorAll('.data .reset');

        items.forEach(item => {
            const itemName = item.textContent.trim();
            if (gardeningItems.includes(itemName)) {
                item.style.color = 'red'; // Marking by changing text color
            }
        });
    }

    // mark safety deposit items
    function markSafetyDepositItems() {
        const items = document.querySelectorAll('.data.flex-column.small-gap.break.bg-alt, .data.flex-column.small-gap.break');

        items.forEach(item => {
            const itemNameElement = item.querySelector('strong');
            if (itemNameElement) {
                const itemName = itemNameElement.textContent.trim();
                if (gardeningItems.includes(itemName)) {
                    item.style.color = 'red'; // Marking by changing text color
                }
            }
        });
    }

    // Determine which page we are on and run the appropriate function
    if (window.location.href.includes('/inventory/')) {
        markInventoryItems();
    } else if (window.location.href.includes('/quickstock')) {
        markQuickstockItems();
    } else if (window.location.href.includes('/safetydeposit')) {
        markSafetyDepositItems();
    }
})();