trying to change the buttons and text of the shop site specificly, but the code I made so far (I dont know css, never did anything with it before either) changes all buttons on threads to this aswell, so I am kinda confused if you know what i mean
button.is-small {
visibility: hidden;
}
button.is-small:after {
content:'1 Schekels';
visibility: visible;
background-color: #4fa052;
display: block;
position: absolute;
color: #8cf90d;
padding: 5px;
top: 2px;
}
I am trying to change the coins text to Schekels by hiding the default one and replacing it with this, any suggestions what I should do? (also, dont know if this is the right place to ask for help)
Try this
.usershop button.is-small {
visibility: hidden;
}
.usershop button.is-small:after {
content:'1 Schekels';
visibility: visible;
background-color: #4fa052;
display: block;
position: absolute;
color: #8cf90d;
padding: 5px;
top: 2px;
}
The shop page's body tag has a class of .usershop, meaning you can specify to only apply the classes to buttons on that page.
you can't really do this using just css because there's no way to get the actual price using it
i made you this:
// ==UserScript==
// @name newpunch shop coin->shekel
// @include https://forum.facepunch.com/*
// @run-at document-end
// @grant none
// ==/UserScript==
if (document.body.matches(".usershop")) {
const selectors = [
// "you've got X coins"
"section.hero div.subtitle",
// form buttons
`form[action="/user/shop"] button`,
].join(",");
for (const element of document.querySelectorAll(selectors)) {
element.textContent = element.textContent.replace(/Coin/g, "Shekel");
}
}
install it in something like violentmonkey
Sorry, you need to Log In to post a reply to this thread.