index.jade 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 UUID or username 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 The size of the image in pixels, #{config.min_size} - #{config.max_size}. <br> Default is #{config.default_size}.
  33. a(id="default", class="anchor")
  34. a(href="#default")
  35. h4 default
  36. p
  37. | The image to be returned when the id has no skin (404). <br> Valid options are
  38. a(href="/avatars/00000000000000000000000000000000?default=steve") steve
  39. | or
  40. a(href="/avatars/00000000000000000000000000000000?default=alex") alex
  41. | .<br> A URL is also accepted. <br>
  42. | The standard value is calculated based on the id (even = alex, odd = steve)
  43. a(id="helm", class="anchor")
  44. a(href="#helm")
  45. h4 helm
  46. p Get an avatar with the second (helmet) layer applied. <br> The content of this parameter is ignored
  47. a(id="skins", class="anchor")
  48. a(href="#skins")
  49. h3 Skins
  50. p
  51. | You can also get the full skin file from name or id. <br>
  52. | Replace
  53. mark.green id
  54. | with a Mojang UUID or username to get the related skin.
  55. | You are redirected to the textures URL, or a 404 is returned.
  56. .code
  57. | #{domain}/skins/
  58. mark.green id
  59. a(id="http-headers", class="anchor")
  60. a(href="#http-headers")
  61. h3 HTTP headers
  62. p Responses come with these HTTP headers, useful for debugging.
  63. a(id="response-time", class="anchor")
  64. a(href="#response-time")
  65. h4 Response-Time
  66. p The time, in milliseconds, it took Crafatar to process the request.
  67. a(id="x-storage-type", class="anchor")
  68. a(href="#x-storage-type")
  69. h4 X-Storage-Type
  70. ul
  71. li <b>none</b>: No external requests. Cached: User has no skin.
  72. li <b>cached</b>: No external requests. Skin cached and stored locally.
  73. li
  74. | <b>checked</b>: 1 external request. Skin cached, checked for updates, no skin downloaded.<br>
  75. | This happens either when the user removed their skin or when it didn't change.
  76. li <b>downloaded</b>: 2 external requests. Skin changed or unknown, downloaded.
  77. li
  78. | <b>error</b>: This can happen, for example, when Mojang's servers are down.<br>
  79. | If possible, an outdated image is be served instead.
  80. a(id="about-usernames", class="anchor")
  81. a(href="#about-usernames")
  82. h3 About usernames
  83. p
  84. | We strongly advise you to use UUIDs instead of usernames in production.
  85. | Usernames are deprecated by Mojang and you should only use usernames for testing.<br>
  86. | Invalid usernames are rejected and a 422 is returned.
  87. a(id="about-uuids", class="anchor")
  88. a(href="#about-uuids")
  89. h3 About UUIDs
  90. p
  91. | UUIDs may use the raw or dashed format.<br>
  92. | Invalid UUIDs are rejected and a 422 is returned.
  93. a(id="about-caching", class="anchor")
  94. a(href="#about-caching")
  95. h3 About caching
  96. p
  97. | Crafatar caches keeps skins for #{config.local_cache_time} seconds until they are checked for changes.<br>
  98. | Images should be cached in browsers for #{config.browser_cache_time} seconds until a new request to Crafatar is made.
  99. a(id="examples", class="anchor")
  100. a(href="#examples")
  101. h3 Examples
  102. p Get jeb_'s avatar
  103. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6
  104. p Get jeb_'s avatar, 64 × 64 pixels
  105. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64
  106. p Get jeb_'s helmet avatar, 64 × 64 pixels
  107. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64&amp;helm
  108. p Get jeb_'s avatar or fall back to steve
  109. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=steve
  110. p
  111. | Get jeb_'s avatar or fall back to
  112. a(href="https://i.imgur.com/ozszMZV.png") a custom image
  113. .code #{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=https%3A%2F%2Fi.imgur.com%2FozszMZV.png
  114. p Get jeb_'s avatar by username
  115. .code #{domain}/avatars/jeb_
  116. p Get jeb_'s skin
  117. .code #{domain}/skins/853c80ef3c3749fdaa49938b674adae6
  118. p Get jeb_'s skin by username
  119. .code #{domain}/skins/jeb_
  120. .col-md-2.center
  121. .sideface.redstone_sheep(title="redstone_sheep")
  122. .sideface.Jake0oo0(title="Jake0oo0")
  123. .sideface.Notch(title="Notch")
  124. .sideface.sk89q(title="sk89q")
  125. .sideface.md_5(title="md_5")