// ==UserScript== // @name SoM'25 Userscript // @namespace http://saahild.com // @version 1.0 // @description Userscript to add some features to SoM'25 (edit the config in the file!) // @author Neon // @match https://summer.hackclub.com/* // ==/UserScript== // Main script logic that uses the config (function () { 'use strict'; const config = { hide_help: true, hide_music: true, fake_admin: false, hide_admin: true, } const adminButton = `
  • ` const shop_admin_per_block = `
    administrate it?
    ` // TODO: migrate to when new elemnt updated etc setInterval(() => { console.log("meow") let mconfig = { has_already_added_admin_btn: false, has_already_added_sadmin_btn: false, } if(config.hide_help) { let hqa = document.getElementById("tutorial-help-btn") if(hqa) { hqa.remove() } } if(config.hide_music) { let mqa = document.getElementById("music-toggle") if(mqa) { mqa.remove() } } if(config.fake_admin && !config.hide_admin) { const navqa = document.querySelector('[data-sidebar-target="links"]'); if(navqa && !mconfig.has_already_added_admin_btn) { navqa.insertAdjacentHTML('beforeend', adminButton); mconfig.has_already_added_admin_btn = true; } if(window.location.pathname === '/shop') { let amount_of_shop_items = document.querySelector('[class="flex flex-col sm:grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6"]').children.length // add top elemt let shop_number_thing = `

    ${amount_of_shop_items} items - edit them?

    ` if(mconfig.has_already_added_sadmin_btn) { let h1Under = document.querySelector('[class="text-4xl sm:text-5xl mb-0"]') h1Under.parentElement.insertBefore(shop_number_thing, h1Under.nextSibling); mconfig.has_already_added_sadmin_btn = true; } // TODO: work more on this } } if(config.hide_admin && !config.fake_admin) { Array.from(document.querySelectorAll('[class*="border-orange-500 bg-orange-500/10"]')).forEach(e=>e.remove()) if(window.location.href.includes('/admin')) { window.location.href = '/'; } } }, 50) })();