index.jade 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. | You are redirected to the textures URL, 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="http-headers", class="anchor")
  67. a(href="#http-headers")
  68. h3 HTTP headers
  69. p
  70. | Responses come with these HTTP headers, useful for debugging.<br>
  71. | Please note that these headers are cached by CloudFlare <small>(CF-Cache-Status: HIT)</small>.
  72. a(id="response-time", class="anchor")
  73. a(href="#response-time")
  74. h4 Response-Time
  75. p The time, in milliseconds, it took Crafatar to process the request.
  76. a(id="x-storage-type", class="anchor")
  77. a(href="#x-storage-type")
  78. h4 X-Storage-Type
  79. ul
  80. li <b>none</b>: No external requests. Cached: User has no skin.
  81. li <b>cached</b>: No external requests. Skin cached and stored locally.
  82. li
  83. | <b>checked</b>: 1 external request. Skin cached, checked for updates, no skin downloaded.<br>
  84. | This happens either when the user removed their skin or when it didn't change.
  85. li <b>downloaded</b>: 2 external requests. Skin changed or unknown, downloaded.
  86. li
  87. | <b>error</b>: This can happen, for example, when Mojang's servers are down.<br>
  88. | If possible, an outdated image is served instead.
  89. a(id="about-usernames", class="anchor")
  90. a(href="#about-usernames")
  91. h3 About usernames
  92. p
  93. | We strongly advise you to use UUIDs instead of usernames in production.<br>
  94. | Usernames are deprecated by Mojang and you should only use usernames for testing.<br>
  95. | Malformed usernames are rejected.
  96. a(id="about-uuids", class="anchor")
  97. a(href="#about-uuids")
  98. h3 About UUIDs
  99. p
  100. | UUIDs may use the blank or dashed format.<br>
  101. | Malformed UUIDs are rejected.
  102. a(id="about-caching", class="anchor")
  103. a(href="#about-caching")
  104. h3 About caching
  105. p
  106. | Crafatar caches skins for #{config.local_cache_time/60} minutes before checking for skin changes.<br>
  107. | Images are cached in your browser for #{config.browser_cache_time/60} minutes until a new request to Crafatar is made.<br>
  108. | When you changed your skin you can try clearing your browser cache to see the change faster.
  109. a(id="examples", class="anchor")
  110. a(href="#examples")
  111. h3 Examples
  112. p Jeb's avatar by username, default size
  113. .code #{domain}/avatars/jeb_
  114. p Jeb's avatar by UUID, default size
  115. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6
  116. p Jeb's avatar, 64 × 64
  117. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64
  118. p Jeb's avatar, 64 × 64, with helm
  119. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64&amp;helm
  120. p Jeb's avatar, or fall back to steve
  121. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=steve
  122. p
  123. | Jeb's avatar, or fall back to
  124. a(href="https://i.imgur.com/ozszMZV.png") a custom image
  125. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=https%3A%2F%2Fi.imgur.com%2FozszMZV.png
  126. p Jeb's skin
  127. .code #{domain}/skins/853c80ef3c3749fdaa49938b674adae6
  128. p Jeb's skin by username
  129. .code #{domain}/skins/jeb_
  130. .col-md-2.center
  131. .sideface.redstone_sheep(title="redstone_sheep")
  132. .sideface.Jake0oo0(title="Jake0oo0")
  133. .sideface.Notch(title="Notch")
  134. .sideface.sk89q(title="sk89q")
  135. .sideface.md_5(title="md_5")