index.jade 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. extends layout
  2. block content
  3. .jumbotron
  4. .container
  5. h1 Crafatar
  6. p A blazing fast API for Minecraft faces!
  7. img(alt="Jake0oo0's Avatar", height="64", width="64", src="#{domain}/avatars/2d5aa9cdaeb049189930461fc9b91cc5?size=64&helm")
  8. img(alt="redstone_sheep's Avatar", height="64", width="64", src="#{domain}/avatars/ae795aa86327408e92ab25c8a59f3ba1?size=64&helm")
  9. img(alt="sk89q's Avatar", height="64", width="64", src="#{domain}/avatars/0ea8eca3dbf647cc9d1ac64551ca975c?size=64&helm")
  10. img(alt="md_5's Avatar", height="64", width="64", src="#{domain}/avatars/af74a02d19cb445bb07f6866a861f783?size=64&helm")
  11. img(alt="Jeb's Avatar", height="64", width="64", src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64&helm")
  12. img(alt="Notch's Avatar", height="64", width="64", src="#{domain}/avatars/069a79f444e94726a5befca90e38aaf5?size=64")
  13. .container
  14. section(id="documentation")
  15. h2 Documentation
  16. .row
  17. section(id="avatars", class="anchor")
  18. a(href="#avatars")
  19. h3 Avatars
  20. | Replace
  21. mark.green id
  22. | with a Mojang <b>UUID</b> or <b>username</b> to get the related head. All images are PNGs.
  23. .code
  24. | #{domain}/avatars/
  25. mark.green id
  26. section(id="avatars-parameters" class="anchor")
  27. a(href="#avatars-parameters")
  28. h4 Avatar Parameters
  29. table(class="table table-bordered table-striped")
  30. thead
  31. tr
  32. td parameter
  33. td type
  34. td default
  35. td description
  36. tbody
  37. tr
  38. td size
  39. td integer
  40. td #{config.default_size}
  41. td The size of the image in pixels, #{config.min_size} - #{config.max_size}.
  42. tr
  43. td default
  44. td string
  45. td The standard value is calculated based on the UUID (even = alex, odd = steve). Usernames always default to steve.
  46. td
  47. | The image to be served when the id has no skin (404).<br>
  48. | Valid options are
  49. a(href="/avatars/00000000000000000000000000000000?default=steve") steve
  50. | ,
  51. a(href="/avatars/00000000000000000000000000000000?default=alex") alex
  52. | , or a custom URL.
  53. tr
  54. td helm
  55. td mixed
  56. td null
  57. td Apply the "second" (hat) layer to the avatar.
  58. section(id="avatars-examples", class="anchor")
  59. a(href="#avatars-examples")
  60. h4 Avatars Examples
  61. p Jeb's avatar by username, default size
  62. .code #{domain}/avatars/jeb_
  63. p Jeb's avatar by UUID, default size
  64. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6
  65. p Jeb's avatar, 64 × 64
  66. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64
  67. p Jeb's avatar, 64 × 64, with helmet
  68. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64&amp;helm
  69. p Jeb's avatar, or fall back to steve
  70. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=steve
  71. p
  72. | Jeb's avatar, or fall back to
  73. a(href="https://i.imgur.com/ozszMZV.png") a custom image
  74. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=https%3A%2F%2Fi.imgur.com%2FozszMZV.png
  75. section(id="skins" class="anchor")
  76. a(href="#skins")
  77. h3 Skins
  78. p
  79. | You can also get the full skin file of a player.<br>
  80. | Replace
  81. mark.green id
  82. | with a Mojang <b>UUID</b> or <b>username</b> to get the related skin.<br>
  83. | The user's skin is returned, or the default image is served.<br>
  84. | You can use the default parameter here as well.
  85. .code
  86. | #{domain}/skins/
  87. mark.green id
  88. section(id="skins-parameters" class="anchor")
  89. a(href="#skins-parameters")
  90. h4 Skin Parameters
  91. table(class="table table-bordered table-striped")
  92. thead
  93. tr
  94. td parameter
  95. td type
  96. td default
  97. td description
  98. tbody
  99. tr
  100. td default
  101. td string
  102. td The standard value is calculated based on the UUID (even = alex, odd = steve). Usernames always default to steve.
  103. td
  104. | The image to be served when the id has no skin (404).<br>
  105. | Valid options are
  106. a(href="/skins/00000000000000000000000000000000?default=steve") steve
  107. | ,
  108. a(href="/skins/00000000000000000000000000000000?default=alex") alex
  109. | , or a custom URL.
  110. section(id="skins-examples", class="anchor")
  111. a(href="#skins-examples")
  112. h4 Skins Examples
  113. p Jeb's skin
  114. .code #{domain}/skins/853c80ef3c3749fdaa49938b674adae6
  115. p Jeb's skin by username
  116. .code #{domain}/skins/jeb_
  117. p Render of Jeb's Head
  118. section(id="renders" class="anchor")
  119. a(href="#renders")
  120. h3 3D Renders
  121. p
  122. | Crafatar also provides support for 3D renders of Minecraft skins.<br>
  123. | Please note that <b>this feature is currently beta</b>!<br>
  124. | Replace
  125. mark.green id
  126. | with a Mojang <b>UUID</b> or <b>username</b> to get a render of the skin.
  127. | The <b>head</b> render type returns a render of the skin's head.
  128. .code
  129. | #{domain}/renders/head/
  130. mark.green id
  131. | The <b>body</b> render returns a render of the entire skin.
  132. .code
  133. | #{domain}/renders/body/
  134. mark.green id
  135. section(id="renders-parameters" class="anchor")
  136. a(href="#renders-parameters")
  137. h4 Render Parameters
  138. table(class="table table-bordered table-striped")
  139. thead
  140. tr
  141. td parameter
  142. td type
  143. td default
  144. td description
  145. tbody
  146. tr
  147. td scale
  148. td integer
  149. td #{config.default_scale}. The actual size differs between the type of render.
  150. td The scale factor of the image #{config.min_scale} - #{config.max_scale}.
  151. tr
  152. td helm
  153. td mixed
  154. td null
  155. td Apply the "second" (hat) layer to the avatar.
  156. section(id="renders-examples", class="anchor")
  157. a(href="#renders-examples")
  158. h4 Render Examples
  159. .code #{domain}/renders/head/853c80ef3c3749fdaa49938b674adae6
  160. p Render of Jeb's Body, with helmet, by username
  161. .code #{domain}/renders/body/jeb_?helm
  162. section(id="meta" class="anchor")
  163. section(id="meta-http-headers" class="anchor")
  164. a(href="#meta-http-headers")
  165. h3 HTTP Headers
  166. p
  167. | Responses come with these HTTP headers, useful for debugging.<br>
  168. | Please note that these headers are cached by CloudFlare <small>(CF-Cache-Status: HIT)</small>.
  169. section(id="meta-response-time" class="anchor")
  170. a(href="#meta-response-time")
  171. h4 Response-Time
  172. p The time, in milliseconds, it took Crafatar to process the request.
  173. section(id="meta-x-storage-type" class="anchor")
  174. a(href="#meta-x-storage-type")
  175. h4 X-Storage-Type
  176. ul
  177. li <b>none</b>: No external requests. Cached: User has no skin.
  178. li <b>cached</b>: No external requests. Skin cached and stored locally.
  179. li
  180. | <b>checked</b>: 1 external request. Skin cached, checked for updates, no skin downloaded.<br>
  181. | This happens either when the user removed their skin or when it didn't change.
  182. li <b>downloaded</b>: 2 external requests. Skin changed or unknown, downloaded.
  183. li
  184. | <b>error</b>: This can happen, for example, when Mojang's servers are down.<br>
  185. | If possible, an outdated image is served instead.
  186. section(id="meta-about-usernames" class="anchor")
  187. a(href="#meta-about-usernames")
  188. h3 About Usernames
  189. p
  190. | We strongly advise you to use UUIDs instead of usernames in production.<br>
  191. | Usernames are deprecated by Mojang and you should only use usernames for testing.<br>
  192. | Malformed usernames are rejected.
  193. section(id="meta-about-uuids" class="anchor")
  194. a(href="#meta-about-uuids")
  195. h3 About UUIDs
  196. p
  197. | UUIDs may use the blank or dashed format.<br>
  198. | Malformed UUIDs are rejected.
  199. section(id="meta-about-caching" class="anchor")
  200. a(href="#meta-about-caching")
  201. h3 About Caching
  202. p
  203. | Crafatar caches skins for #{config.local_cache_time/60} minutes before checking for skin changes.<br>
  204. | Images are cached in your browser for #{config.browser_cache_time/60} minutes until a new request to Crafatar is made.<br>
  205. | When you changed your skin you can try clearing your browser cache to see the change faster.
  206. footer
  207. hr
  208. p(class="pull-right") Copyright Craftatar 2014