index.jade 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. | <img src="#{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. | &lt;img src="#{domain}/skins/
  58. mark.green id
  59. | "&gt;
  60. a(id="http-headers", class="anchor")
  61. a(href="#http-headers")
  62. h3 HTTP headers
  63. p Responses come with these HTTP headers, useful for debugging.
  64. a(id="response-time", class="anchor")
  65. a(href="#response-time")
  66. h4 Response-Time
  67. p The time, in milliseconds, it took Crafatar to process the request.
  68. a(id="x-storage-type", class="anchor")
  69. a(href="#x-storage-type")
  70. h4 X-Storage-Type
  71. ul
  72. li <b>none</b>: No external requests. Cached: User has no skin.
  73. li <b>cached</b>: No external requests. Skin cached and stored locally.
  74. li
  75. | <b>checked</b>: 1 external request. Skin cached, checked for updates, no skin downloaded.<br>
  76. | This happens either when the user removed their skin or when it didn't change.
  77. li <b>downloaded</b>: 2 external requests. Skin changed or unknown, downloaded.
  78. li
  79. | <b>error</b>: This can happen, for example, when Mojang's servers are down.<br>
  80. | If possible, an outdated image is be served instead.
  81. a(id="about-usernames", class="anchor")
  82. a(href="#about-usernames")
  83. h3 About usernames
  84. p
  85. | We strongly advise you to use UUIDs instead of usernames in production.
  86. | Usernames are deprecated by Mojang and you should only use usernames for testing.<br>
  87. | Invalid usernames are rejected and a 422 is returned.
  88. a(id="about-uuids", class="anchor")
  89. a(href="#about-uuids")
  90. h3 About UUIDs
  91. p
  92. | UUIDs may use the raw or dashed format.<br>
  93. | Invalid UUIDs are rejected and a 422 is returned.
  94. a(id="about-caching", class="anchor")
  95. a(href="#about-caching")
  96. h3 About caching
  97. p
  98. | Crafatar caches keeps skins for #{config.local_cache_time} seconds until they are checked for changes.<br>
  99. | Images should be cached in browsers for #{config.browser_cache_time} seconds until a new request to Crafatar is made.
  100. a(id="examples", class="anchor")
  101. a(href="#examples")
  102. h3 Examples
  103. p Get jeb_'s avatar, 160 × 160 pixels
  104. .code &lt;img src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6"&gt;
  105. p Get jeb_'s avatar, 64 × 64 pixels
  106. .code &lt;img src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64"&gt;
  107. p Get jeb_'s helmet avatar, 64 × 64 pixels
  108. .code &lt;img src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?size=64&amp;helm"&gt;
  109. p Get jeb_'s avatar or fall back to steve
  110. .code &lt;img src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=steve"&gt;
  111. p Get jeb_'s avatar or fall back to a custom image
  112. .code &lt;img src="#{domain}/avatars/853c80ef3c3749fdaa49938b674adae6?default=https%3A%2F%2Fi.imgur.com%2FozszMZV.png"&gt;
  113. p Get jeb_'s avatar by username, 160 x 160 pixels
  114. .code &lt;img src="#{domain}/avatars/jeb_"&gt;
  115. p Get jeb_'s skin
  116. .code &lt;img src="#{domain}/skins/853c80ef3c3749fdaa49938b674adae6"&gt;
  117. p Get jeb_'s skin by username
  118. .code &lt;img src="#{domain}/skins/jeb_"&gt;
  119. .col-md-2.center
  120. .sideface.redstone_sheep(title="redstone_sheep")
  121. .sideface.Jake0oo0(title="Jake0oo0")
  122. .sideface.Notch(title="Notch")
  123. .sideface.sk89q(title="sk89q")
  124. .sideface.md_5(title="md_5")