index.jade 7.2 KB

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