• Purrgatory is officially open and like many openings we expect to come across a little bit of scuff here and there, thanks for your patience with us and let us know if you find anything or have questions! Why not drop into the Arrival and Farewells channel to say hi!
  • Reminder to make sure the codes you use are legible and easy to read to other users! No too small text, scrollbars or dark color on dark colors etc...
Status
Not open for further replies.

Noia

I really like birds
Admin
Site Coder
44
8
Pronouns
she/her
Affiliation
site coder
On Purrgatory, we have an extensive coding system that uses a mixture of BBCODE and CSS codes to make beautiful templates and posts! This guide will crash course you through the very basics of coding templates on Purrgatory. This is by no means an exhaustive list, or even a complete tutorial, but serves as an introduction! If you find at any point you need more help, feel free to reach out to one of our site coders here or on discord. We'll be happy to help!

Please be mindful that your templates are legible and mobile-friendly. We have no set aesthetic on Purrgatory, but any templates using excessive neon colors or intentionally made to be difficult to read or understand will be asked to not be used on site. As a general rule of thumb, anything meant to be character text should be kept at a minimum of 11-12px in size depending on font. Colors should be easy to read without highlighting.

If you are uncertain if your template is legible, please ask in our discord in Coding Discussions!



 


FANCYPOSTS
Fancyposts are named in honor of the code from a long forgotten roleplay site. The fancypost gives you all the customization you could need using CSS parameters! It's a fancy - hah - term to basically say 'make a box!'

BASICS

All codes are made with an opening tag, and a closing tag (usually denoted with a /). When we make fancyposts, or any codes in general, it's SUPER important to make sure that all your tags get closed properly. If they aren't, things will break immediately and often in soul-crushing ways, so when coding, it's a great idea to start right away by putting in all the closing tags. With that disclaimer out of the way, let's look at a fancypost.

[fancypost=WIDTH%; margin:auto;] Text goes here! [/fancypost]

This is the most basic box you can make. A fancypost must have a width put in place. On Purrgatory, this is defined with a PERCENTAGE WIDTH. This can be any number from 1%-100%. What this does is says, "Take up THIS PERCENT of the available screen." This means anything you make in a fancypost box will also adjust to mobile screens and devices with different screen sizes.
The semi-colon ; you see at the end of that code says, 'I'm done with this code and ready for the next.'

Fancyposts will not be automatically centered. In order to center them, we add a margin:auto into our template. It is VERY important that this margin goes at the beginning of your template, or any margins you use afterwards will not work. You can choose not to have your template be centered (it will default to a left-align), by removing that code.

If you do not set a height for your fancypost, it will default to stretch with the amount of text that is in it. This is usually the easiest way. However, there are some exceptions for times when you might want a set height. To do this, it's as simple as adding, height:AMOUNTpx

CSS

The codes we have been using so far are part of a coding language called CSS. We are using a simplified version of CSS to make our codes - meaning we're just using the code snippets to make things happen. The list is almost endless, and I won't be going over every single code in existence for that reason, but I do want to show off what a full (simple) fancypost code could look like.

One example of a full fancypost code might look like this:
[fancypost=60%; margin:auto; text-align:justify; font-family:indie flower; color:pink; border-bottom:3px solid pink;]text here[/fancypost]

Which will produce:
text here


You can also put fancyposts in fancyposts to expand the things you are able to do with them. Here's another example.

[fancypost=60%; margin: auto; border:2px solid mediumseagreen; padding:10px;][fancypost=100%; margin: auto; border:2px solid aqua;]text here[/fancypost][/fancypost]

Which will produce:
text here


One thing to be aware of in this example is our WIDTH%. In a single box fancypost, as discussed before, this width% is the same thing as saying, "Take up this % of the available screen." However, once you start adding more fancyposts into eachother, that line of thinking changes. That second box, and any box sequentially after that, will work under the logic, "Take up this percentage of the available BOX." So if your first box is 100%, your second box set at a 50% width would take up HALF that space.

Hopefully that wasn't too much information all at once. Honestly, once you understand the foundations of a fancypost, putting codes into place and trying things out just comes down to a matter of practice! With the crash course out of the way, let's go look at some of the codes that you can use to make your fancyposts, fancy.
 

FANCYPOST CODES
INPUT
OUTPUT
background:COLOR
text
text
text
text

background-image:url(URL);
also use
background-size:CONTAIN / COVER / XXpx YYpx / AMOUNT%
background-repeat:NO-REPEAT/REPEAT
background-position:TOP/BOTTOM/LEFT/RIGHT
text
text
text
text

background:linear-gradient:(POSITION, COLOR1, COLOR2, ETC, OPT.OPACITY%);
positions include: to left, to right, to top, to bottom, AMOUNTdeg
text
text
text
text

border:SIZEpx TYPE COLOR;
types include: solid, dotted, dashed, inset, outset, double, groove, ridge

variations
border-POSITION: SIZEpx TYPE COLOR;
positions include: top, bottom, left, right

rounded corners
border-radius:AMOUNTpx
variations
border-POSITION-radius: AMOUNTpx;
positions include: top-left, bottom-left, top-right, bottom-right
PREVIEW

margin: AMOUNTpx
margin-POSITION:AMOUNTpx
positions include top, bottom, left, right

Margin pertains to the amount of space around a box. Most commonly, we use a variation of this code to alter the position of boxes. AMOUNT can be positive or negative. a -negative number will pull a box in a direction, while a positive number will push.

padding: AMOUNTpx
padding-POSITION:AMOUNTpx
positions include top, bottom, left, right

Padding pertains to the amount of space inside a box. This is usually used to 'pad' space around next and the outside border of an element. With no position set, it will set padding to all sides of the container. With a position set, it will pad the specified side. Typically, this AMOUNT will be a positive number.

 

TEXT CODES
INPUT
OUTPUT
font-family:FONT;

font-size:SIZEpx;

color: COLOR;

text-align:POSITION;
positions include: justify, center, left, right, top, bottom

text-transform:UPPERCASE/LOWERCASE

text-decoration: TYPE COLOR SIZE;
types can be stacked. Types include:
underline, overline, dotted, wavy, line-through

word-spacing:AMOUNTpx

letter-spacing:AMOUNTpx

text-shadow: H-VALUE V-VALUE BLURAMOUNT COLOR;
H-value stands for horizontal amount. V-value stands for vertical amount.


FONT: indie flower


FONT-SIZE:20px;

COLOR:aqua

text-align:right

text-transform:uppercase;

text-decoration: underline wavy pink 3px;

word spacing: 8px

letter-spacing:8px;

text-shadow: 2px 1px 5px pink


With most of the above examples, you can do the same using BBCODES. Others have been pre-coded to bbcode snippets to make it easier. You can find these, and more, BBcodes here.

[font=FONT]text[/font]
[color=COLOR]text[/color]
[JUSTIFY]text[/JUSTIFY]
[CENTER]text[/CENTER]
[LEFT]text[/LEFT]
[RIGHT]text[/RIGHT]
[glow=COLOR]text[/glow
[outline=COLOR]text[/outline]
[shadow=COLOR]text[/shadow]
[highlight=HIGHLIGHT]text[/highlight]


font=indie flower
color=pink
right align​
glow=pink

outline=pink

shadow=pink

highlight=pink
 

ADVANCED CODES
the following codes do not enjoy being in a table like the previous ones, so please enjoy a Long Post


SLIDERS

[SLIDER] [SLIDE]slide 1 content[/SLIDE] [SLIDE]slide 2 content[/SLIDE] [SLIDE]slide 3 content[/SLIDE] [/SLIDER]

You can adjust the width of a slider by putting it into a fancypost. You can adjust the height of the slider with the following as the opening tag:
[SLIDER height=AMOUNTpx]

Sliders will output into the following. You can use fancyposts inside the slide containers, as well as outside. But be warned, these sliders are easy to break and often finnicky.

slide 1 content
slide 2 content
slide 3 content


TABS

[TABS] [TAB=TITLE]tab 1content[/TAB] [TAB=TITLE]tab 2 content[/TAB] [TAB=TITLE]tab 3content[/TAB] [/TABS]

You can adjust the width of the Tabs container by inserting it within a fancypost. You can also use fancyposts inside the tab containers to decorate it. Titles are, unfortunately, required for TABS, but you can decorate them with text symbols to make them suit your needs.

TABS will output into the following (no fancypost used to adjust width). Be warned that they are very picky about open and closed tags and can easily break.

  • tab 1content
  • tab 2 content
  • tab 3content


SCROLLING

NOTE: Scrollbars must be used on templates with a minimum of 50% width for legibility for mobile users. Please be mindful that your scrollbars are not unrecognizable as a scroll.

overflow:auto;

The code above can be added into a fancypost with a set height to set it to scroll. Please be mindful of users on mobile not to make scrollers on a post that is set to a small width percentage. Here is an example:
[fancypost=50%; height: 100px;margin:auto; overflow:auto;]text[/fancypost]

Tiramisu tootsie roll apple pie jelly-o croissant I love I love. Halvah biscuit ice cream liquorice sweet roll jujubes I love. Topping pastry tart tiramisu cheesecake jelly-o I love. Lemon drops soufflé pudding pie jelly bonbon candy soufflé. Ice cream candy wafer sesame snaps ice cream. Bear claw I love topping I love candy canes liquorice halvah dragée gummies. Halvah pastry caramels shortbread I love chocolate soufflé. Marzipan I love carrot cake wafer I love. Sweet roll wafer danish apple pie apple pie sweet. Sweet roll croissant cookie icing cotton candy.



If you would like the capacity to scroll, but for the scrollbar to be invisible, please use the following:
overflow:auto; scrollbar-width: none; ms-overflow-style: none;


[fancypost=50%; height: 100px;margin:auto; overflow:auto; scrollbar-width: none; ms-overflow-style: none;]text[/fancypost]
Here is an example of what this looks like.
Tiramisu tootsie roll apple pie jelly-o croissant I love I love. Halvah biscuit ice cream liquorice sweet roll jujubes I love. Topping pastry tart tiramisu cheesecake jelly-o I love. Lemon drops soufflé pudding pie jelly bonbon candy soufflé. Ice cream candy wafer sesame snaps ice cream. Bear claw I love topping I love candy canes liquorice halvah dragée gummies. Halvah pastry caramels shortbread I love chocolate soufflé. Marzipan I love carrot cake wafer I love. Sweet roll wafer danish apple pie apple pie sweet. Sweet roll croissant cookie icing cotton candy.


BIMG

Basically, please pretend that the [IMG][/IMG] tag you have all come to know and love does not exist. More frequently, [BIMG] LINK[/BIMG] is going to be a much more flexible option.

BIMG stands for BLOCK IMAGE. It is the only image that can be used with a float code, and is much less picky when it comes to resizing or altering the image in any way. You can use all the normal types of codes within it as you can with a normal IMG code. For instance:

[bimg width="100px" height="50px"]LINK[/bimg]
[bimg=150px|TITLE TEXT|inside]LINK[/bimg]
[url=LINK][bimg]LINK[/bimg][/url]


FLOATS

There is a bbcode that we have access to that allows you to float containers and blocks of text. This is a useful tool to be able to wrap text around images, or to even 'falsify' a table.

There are two options:
[fleft] [/fleft]
[fright] [/fright]

Or, 'float left' and 'float right'.

For an example of what this could look like:

Tiramisu tootsie roll apple pie jelly-o croissant I love I love. Halvah biscuit ice cream liquorice sweet roll jujubes I love. Topping pastry tart tiramisu cheesecake jelly-o I love. Lemon drops soufflé pudding pie jelly bonbon candy soufflé. Ice cream candy wafer sesame snaps ice cream. Bear claw I love topping I love candy canes liquorice halvah dragée gummies. Halvah pastry caramels shortbread I love chocolate soufflé. Marzipan I love carrot cake wafer I love. Sweet roll wafer danish apple pie apple pie sweet. Sweet roll croissant cookie icing cotton candy.


[fancypost=50%; margin:auto;][fleft][bimg]https://placehold.co/50x50.png[/bimg][/fleft]text here[/fancypost]

These floats can often be very picky, and depending on how you use them may not always be the most mobile friendly. Best of luck!
 
Status
Not open for further replies.