crafatar/views/index.jade

181 lines
7.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

extends layout
block content
.container(style= "margin-top: 70px;")
.row
.col-md-10
a(id="crafatar", class="anchor")
a(href="#crafatar")
h1 Crafatar
hr
p Welcome to Crafatar, an API for Minecraft's faces!
hr
a(id="documentation", class="anchor")
a(href="#documentation")
h2 Documentation
a(id="avatars", class="anchor")
a(href="#avatars")
h3 Avatars
p
| Replace
mark.green id
| with a Mojang <b>UUID</b> or <b>username</b> to get the related head. All images are PNGs.
.code
| #{domain}/avatars/
mark.green id
|
a(id="parameters", class="anchor")
a(href="#parameters")
h3 Parameters
a(id="size", class="anchor")
a(href="#size")
h4 size
p
| The size of the image in pixels, #{config.min_size} - #{config.max_size}.<br>
| Default is #{config.default_size}.
a(id="default", class="anchor")
a(href="#default")
h4 default
p
| The image to be served when the id has no skin (404).<br>
| Valid options are
a(href="/avatars/00000000000000000000000000000000?default=steve") steve
| ,
a(href="/avatars/00000000000000000000000000000000?default=alex") alex
| , or a custom URL.<br>
| The standard value is calculated based on the id (even = alex, odd = steve)
a(id="helm", class="anchor")
a(href="#helm")
h4 helm
p
| Get an avatar with the "second" (hat) layer applied.<br>
| The content of this parameter can be anything.<br>
| If you want to get the face only, remove the parameter.
a(id="skins", class="anchor")
a(href="#skins")
h3 Skins
p
| You can also get the full skin file from name or id.<br>
| Replace
mark.green id
| with a Mojang <b>UUID</b> or <b>username</b> to get the related skin.
| The user's skin will be returned, or the default image is served.<br>
| You can use the default parameter here as well.
.code
| #{domain}/skins/
mark.green id
a(id="renders", class="anchor")
a(href="renders")
h3 3D Renders
p
| Crafatar also provides support for 3D renders of Minecraft skins.
| Replace
mark.green id
| with a Mojang <b>UUID</b> or <b>username</b> to get an render for the skin.
.code
| #{domain}/renders/head/
mark.green id
.code
| #{domain}/renders/body/
mark.green id
| The <b>default</b> parameter can also be used here. Using alex or steve will create a
| render with the same parameters. A custom image will not be rendered.
| Using the <b>helm</b> parameter is also allowed, which will be overlayed onto the head.
| The <b>head</b> render type will return only a render of the skin's head, while the
| <b>body</b> render will return a render of the entire skin.
a(id="#render-parameters", class="#render-anchor")
a(href="#render-parameters")
h3 Render Parameters
a(id="scale", class="anchor")
a(href="#scale")
h4 scale
p
| The scale factor of the image #{config.min_scale} - #{config.max_scale}.<br>
| Default is #{config.default_scale}. The actual size differs between the type of render.
a(id="http-headers", class="anchor")
a(href="#http-headers")
h3 HTTP headers
p
| Responses come with these HTTP headers, useful for debugging.<br>
| Please note that these headers are cached by CloudFlare <small>(CF-Cache-Status: HIT)</small>.
a(id="response-time", class="anchor")
a(href="#response-time")
h4 Response-Time
p The time, in milliseconds, it took Crafatar to process the request.
a(id="x-storage-type", class="anchor")
a(href="#x-storage-type")
h4 X-Storage-Type
ul
li <b>none</b>: No external requests. Cached: User has no skin.
li <b>cached</b>: No external requests. Skin cached and stored locally.
li
| <b>checked</b>: 1 external request. Skin cached, checked for updates, no skin downloaded.<br>
| This happens either when the user removed their skin or when it didn't change.
li <b>downloaded</b>: 2 external requests. Skin changed or unknown, downloaded.
li
| <b>error</b>: This can happen, for example, when Mojang's servers are down.<br>
| If possible, an outdated image is served instead.
a(id="about-usernames", class="anchor")
a(href="#about-usernames")
h3 About usernames
p
| We strongly advise you to use UUIDs instead of usernames in production.<br>
| Usernames are deprecated by Mojang and you should only use usernames for testing.<br>
| Malformed usernames are rejected.
a(id="about-uuids", class="anchor")
a(href="#about-uuids")
h3 About UUIDs
p
| UUIDs may use the blank or dashed format.<br>
| Malformed UUIDs are rejected.
a(id="about-caching", class="anchor")
a(href="#about-caching")
h3 About caching
p
| Crafatar caches skins for #{config.local_cache_time/60} minutes before checking for skin changes.<br>
| Images are cached in your browser for #{config.browser_cache_time/60} minutes until a new request to Crafatar is made.<br>
| When you changed your skin you can try clearing your browser cache to see the change faster.
a(id="examples", class="anchor")
a(href="#examples")
h3 Examples
p Jeb's avatar by username, default size
.code #{domain}/avatars/jeb_
p Jeb's avatar by UUID, default size
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6
p Jeb's avatar, 64 × 64
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64
p Jeb's avatar, 64 × 64, with helmet
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64&amp;helm
p Jeb's avatar, or fall back to steve
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=steve
p
| Jeb's avatar, or fall back to
a(href="https://i.imgur.com/ozszMZV.png") a custom image
.code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=https%3A%2F%2Fi.imgur.com%2FozszMZV.png
p Jeb's skin
.code #{domain}/skins/853c80ef3c3749fdaa49938b674adae6
p Jeb's skin by username
.code #{domain}/skins/jeb_
p Render of Jeb's Head
.code #{domain}/renders/head/853c80ef3c3749fdaa49938b674adae6
p Render of Jeb's Body, with helmet, by username
.code #{domain}/renders/body/jeb_?helm
.col-md-2.center
.sideface.redstone_sheep(title="redstone_sheep")
.sideface.Jake0oo0(title="Jake0oo0")
.sideface.Notch(title="Notch")
.sideface.sk89q(title="sk89q")
.sideface.md_5(title="md_5")