Please specify version and format if asking for help, or apply optional tags above:
Twine Version:2.3
Story Format: 2.34.1
Hello everybody!
For a business simulation game I am currently trying to randomly generate very simple business logos at the start of game. As a start, I had a look at these CSS shapes. I figured, I could just randomly pick one of those shapes and apply them to a <div> using the <<addclass>> macro. But then, to increase randomness, I thought it would be nice to randomly apply additional CSS such as transform, clip-paths, fill and outline colors, etc.
This would just happen once per logo, I guess best in the StoryInit-Passage. How can I apply such random CSS to selected elements? Thank you!
For what you’re describing, I’d actually recommend using SVG (Scalable Vector Graphics) images instead. SVG images are actually made up of HTML compatible elements, so that should make generating and manipulating them much easier.
Each path is a different chunk of the image. The first path is the curved border around the edges, and the next three are the “F” character at different sizes and opacities.
If you’re looking for examples of business logos in SVG format, see the “Brands” section of the Font Awesome fonts. I built this code in Twine which lets you see all of the Font Awesome icons and you can click on the icons to build up a list of the ones you’ve clicked on.