Personally speaking, I have a few different projects with their own casts of characters. I have a blog where I have all my characters in one character page, but I also have character pages for the projects themselves..! The card template that I use on my main oc blog is different to the one that I use for the projects themselves, since the context has changed...

So, my intent with releasing this code is not to lock you into a specific template design that likely doesn't suit your own projects, but instead to give you a framework you can use to build your own unique cards!

However! If you're not comfortable writing HTML and CSS, you may not know where to start or how to do that, so below are some templates you're free to use and edit as needed. I recommend the MDN intro to web development, and w3schools for picking up HTML & CSS!


Basic Template

A super simple template with no real styling to it, just the basic structure.

HTML

CSS

View Sample Spreadsheet

Spreadsheet notes: You'll notice that after most of the portrait urls is appended " style="filter: hue-rotate(##deg");, all this is doing is applying a css filter to the same image to make it different colours, so that I didn't need to make more... LOL.

You can just ignore it, but it does also show you one of many ways you can use the spreadsheet to control not only the contents but also the styling of the cards!


RPG Template

Live example

A more advanced template that shows how you can use spreadsheet formulae to control the content of the template. The stats and inventory are dynamically generated in the spreadsheet!

HTML

CSS

View Sample Spreadsheet

Spreadsheet notes: So there's a lot going on in this one.

The first thing you should note is that if you click on a cell from Inventory or from Stats, what's written in there is not actually the html string you see, but a simple little formula of =CONCATENATE(SheetName!$Cell#:#)

What's going on there is it's glueing together all the values in that cell range, such as Items!B4:4

Now why might you want to do this, as opposed to just adding the inventory slots to your template directly like?:

<span class='slot show-hide'><i class='sprite ${data[i].Item}'></i></span><span class='item-description show-hide-content'>${data[i].ItemDescription}</span>

Well, this way you can control how many slots there are on a per-character basis, and if you add more slots (by inserting new columns to the items sheet), you don't need to edit the template at all! If you take a look at the live example, you'll see that the item slots vary between characters.

It helps, I think, to think of the JS template as a static template, and the spreadsheet as a dynamic template.

With the spreadsheet, you can take advantage of its formulae to do anything from simple calculations (see the stats sheet - converting dnd stats into percentages to control the stat bar), to stringing together the values of multiple cells into one variable html string for you to insert into your static template.