Bit of a complicated question here.
Can I delete a CSS class from the stylesheet through a button?
My story is set up with special text effects, different colors, etc. based on who’s talking. I understand this can be a little hard to read for some people, so I’d like for there to be a button, that, when clicked, asks the user if they’re sure about the change (and allows them to cancel the action) and then stops the CSS class from being displayed.
Here’s the CSS classes, where .ptalk is the player’s speech, and .samtalk and .yewtalk are NPC’s text effects:
.ptalk {
background: -webkit-linear-gradient(90deg, #0c0c0c 1%, #796693 100%);
-webkit-background-clip: text;
color: transparent;
}
.samtalk {
background: -webkit-linear-gradient(90deg, #0c0c0c 1%, #768F7C 100%);
-webkit-background-clip: text;
color: transparent
}
.yewtalk {
background: -webkit-linear-gradient(90deg, #0c0c0c 1%, #5E6B8C 100%);
-webkit-background-clip: text;
color: transparent;
}
I know I don’t need to delete the text wrappers, for example:
@@.ptalk;Dreaming might not be for me@@, $pname thinks.
@@.samtalk;What about for me?@@ Sandwich asks.
@@.yewtalk;And me! Don't forget me!@@ Yew adds.
Because Twine automatically hides the @@.ptalk;@@
even if it doesn’t have an applicable class.
I just don’t know how to make the class stop displaying while still showing the text the class wraps.
I’d like to be able to put this button in the side bar, and have a second “undo” sort of button, which re-applies the CSS class in case the user wishes to see the text effects again.
I’m using Sugarcube 2.37.3.
Thanks for any help!