index.jade 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. extends layout
  2. block content
  3. .container(style= "margin-top: 70px;")
  4. .row
  5. .col-md-10
  6. a(id="crafatar", class="anchor")
  7. a(href="#crafatar")
  8. h1 Crafatar
  9. hr
  10. p Welcome to Crafatar, an API for Minecraft's faces!
  11. hr
  12. a(id="documentation", class="anchor")
  13. a(href="#documentation")
  14. h2 Documentation
  15. a(id="avatars", class="anchor")
  16. a(href="#avatars")
  17. h3 Avatars
  18. p
  19. | Replace
  20. mark.green id
  21. | with a Mojang <b>UUID</b> or <b>username</b> to get the related head. All images are PNGs.
  22. .code
  23. | #{domain}/avatars/
  24. mark.green id
  25. |
  26. a(id="parameters", class="anchor")
  27. a(href="#parameters")
  28. h3 Parameters
  29. a(id="size", class="anchor")
  30. a(href="#size")
  31. h4 size
  32. p
  33. | The size of the image in pixels, #{config.min_size} - #{config.max_size}.<br>
  34. | Default is #{config.default_size}.
  35. a(id="default", class="anchor")
  36. a(href="#default")
  37. h4 default
  38. p
  39. | The image to be served when the id has no skin (404).<br>
  40. | Valid options are
  41. a(href="/avatars/00000000000000000000000000000000?default=steve") steve
  42. | ,
  43. a(href="/avatars/00000000000000000000000000000000?default=alex") alex
  44. | , or a custom URL.<br>
  45. | The standard value is calculated based on the id (even = alex, odd = steve)
  46. a(id="helm", class="anchor")
  47. a(href="#helm")
  48. h4 helm
  49. p
  50. | Get an avatar with the "second" (hat) layer applied.<br>
  51. | The content of this parameter can be anything.<br>
  52. | If you want to get the face only, remove the parameter.
  53. a(id="skins", class="anchor")
  54. a(href="#skins")
  55. h3 Skins
  56. p
  57. | You can also get the full skin file from name or id.<br>
  58. | Replace
  59. mark.green id
  60. | with a Mojang <b>UUID</b> or <b>username</b> to get the related skin.
  61. | The user's skin will be returned, or the default image is served.<br>
  62. | You can use the default parameter here as well.
  63. .code
  64. | #{domain}/skins/
  65. mark.green id
  66. a(id="renders", class="anchor")
  67. a(href="renders")
  68. h3 3D Renders
  69. p
  70. | Crafatar also provides support for 3D renders of Minecraft skins.
  71. | Replace
  72. mark.green id
  73. | with a Mojang <b>UUID</b> or <b>username</b> to get an render for the skin.
  74. .code
  75. | #{domain}/renders/head/
  76. mark.green id
  77. .code
  78. | #{domain}/renders/body/
  79. mark.green id
  80. | The <b>default</b> parameter can also be used here. Using alex or steve will create a
  81. | render with the same parameters. A custom image will not be rendered. A UUID or username
  82. | without a skin, will produce a render based on the input id, or the <b>default</b> parameter.
  83. | Using the <b>helm</b> parameter is also allowed, which will be overlayed onto the head.
  84. | The <b>head</b> render type will return only a render of the skin's head, while the
  85. | <b>body</b> render will return a render of the entire skin.
  86. a(id="#render-parameters", class="#render-anchor")
  87. a(href="#render-parameters")
  88. h3 Render Parameters
  89. a(id="scale", class="anchor")
  90. a(href="#scale")
  91. h4 scale
  92. p
  93. | The scale factor of the image #{config.min_scale} - #{config.max_scale}.<br>
  94. | Default is #{config.default_scale}. The actual size differs between the type of render.
  95. a(id="http-headers", class="anchor")
  96. a(href="#http-headers")
  97. h3 HTTP headers
  98. p
  99. | Responses come with these HTTP headers, useful for debugging.<br>
  100. | Please note that these headers are cached by CloudFlare <small>(CF-Cache-Status: HIT)</small>.
  101. a(id="response-time", class="anchor")
  102. a(href="#response-time")
  103. h4 Response-Time
  104. p The time, in milliseconds, it took Crafatar to process the request.
  105. a(id="x-storage-type", class="anchor")
  106. a(href="#x-storage-type")
  107. h4 X-Storage-Type
  108. ul
  109. li <b>none</b>: No external requests. Cached: User has no skin.
  110. li <b>cached</b>: No external requests. Skin cached and stored locally.
  111. li
  112. | <b>checked</b>: 1 external request. Skin cached, checked for updates, no skin downloaded.<br>
  113. | This happens either when the user removed their skin or when it didn't change.
  114. li <b>downloaded</b>: 2 external requests. Skin changed or unknown, downloaded.
  115. li
  116. | <b>error</b>: This can happen, for example, when Mojang's servers are down.<br>
  117. | If possible, an outdated image is served instead.
  118. a(id="about-usernames", class="anchor")
  119. a(href="#about-usernames")
  120. h3 About usernames
  121. p
  122. | We strongly advise you to use UUIDs instead of usernames in production.<br>
  123. | Usernames are deprecated by Mojang and you should only use usernames for testing.<br>
  124. | Malformed usernames are rejected.
  125. a(id="about-uuids", class="anchor")
  126. a(href="#about-uuids")
  127. h3 About UUIDs
  128. p
  129. | UUIDs may use the blank or dashed format.<br>
  130. | Malformed UUIDs are rejected.
  131. a(id="about-caching", class="anchor")
  132. a(href="#about-caching")
  133. h3 About caching
  134. p
  135. | Crafatar caches skins for #{config.local_cache_time/60} minutes before checking for skin changes.<br>
  136. | Images are cached in your browser for #{config.browser_cache_time/60} minutes until a new request to Crafatar is made.<br>
  137. | When you changed your skin you can try clearing your browser cache to see the change faster.
  138. a(id="examples", class="anchor")
  139. a(href="#examples")
  140. h3 Examples
  141. p Jeb's avatar by username, default size
  142. .code #{domain}/avatars/jeb_
  143. p Jeb's avatar by UUID, default size
  144. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6
  145. p Jeb's avatar, 64 × 64
  146. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64
  147. p Jeb's avatar, 64 × 64, with helmet
  148. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64&amp;helm
  149. p Jeb's avatar, or fall back to steve
  150. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=steve
  151. p
  152. | Jeb's avatar, or fall back to
  153. a(href="https://i.imgur.com/ozszMZV.png") a custom image
  154. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=https%3A%2F%2Fi.imgur.com%2FozszMZV.png
  155. p Jeb's skin
  156. .code #{domain}/skins/853c80ef3c3749fdaa49938b674adae6
  157. p Jeb's skin by username
  158. .code #{domain}/skins/jeb_
  159. p Render of Jeb's Head
  160. .code #{domain}/renders/head/853c80ef3c3749fdaa49938b674adae6
  161. p Render of Jeb's Body, with helmet, by username
  162. .code #{domain}/renders/body/jeb_?helm
  163. .col-md-2.center
  164. .sideface.redstone_sheep(title="redstone_sheep")
  165. .sideface.Jake0oo0(title="Jake0oo0")
  166. .sideface.Notch(title="Notch")
  167. .sideface.sk89q(title="sk89q")
  168. .sideface.md_5(title="md_5")