docs.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <!-- min-height overrides vertical centering from the parent default.vue layout -->
  3. <div
  4. class="width-constraint flex-wrapper"
  5. style="min-height: calc(100vh - 10rem); position: relative"
  6. >
  7. <!-- docs navigation -->
  8. <v-list
  9. class="py-0 mr-3"
  10. style="
  11. background: transparent;
  12. position: sticky;
  13. top: 6rem;
  14. align-self: flex-start;
  15. "
  16. >
  17. <v-list-item
  18. v-for="(link, i) in links"
  19. :key="i"
  20. :to="link.to"
  21. router
  22. class="mb-4"
  23. color="primary"
  24. style="overflow: hidden !important; border-radius: 0.75rem"
  25. >
  26. <v-list-item-title style="text-align: right">
  27. <v-list-item-title
  28. v-text="$vuetify.lang.t(`$vuetify.api.${link.name}.title`)"
  29. />
  30. </v-list-item-title>
  31. <v-list-item-icon>
  32. <v-icon v-text="link.icon" />
  33. </v-list-item-icon>
  34. </v-list-item>
  35. </v-list>
  36. <!-- docs content -->
  37. <v-card
  38. class="text-left glass pa-6"
  39. style="
  40. flex-grow: 2;
  41. height: max-content;
  42. max-width: 90vw !important;
  43. border-radius: 0.75rem;
  44. "
  45. >
  46. <NuxtChild />
  47. </v-card>
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. transition(to, from) {
  53. if (!from) return "swoop-in";
  54. let routes = ["index", "install", "docs", "help", "faq", "donate", "links"];
  55. if (routes.indexOf(to.name) < 0) return "swoop-out";
  56. if (routes.indexOf(from.name) < 0) return "swoop-in";
  57. return routes.indexOf(to.name) > routes.indexOf(from.name)
  58. ? "swoop-left"
  59. : "swoop-right";
  60. },
  61. data() {
  62. return {
  63. //--- Links To Generate Above ---//
  64. links: [
  65. {
  66. name: "rights",
  67. icon: "mdi-book-open-variant",
  68. to: "/docs/usage-rights",
  69. },
  70. {
  71. name: "url",
  72. icon: "mdi-web",
  73. to: "/docs/url",
  74. },
  75. {
  76. name: "endpoints",
  77. icon: "mdi-transit-connection-variant",
  78. to: "/docs/endpoints",
  79. },
  80. {
  81. name: "fetching",
  82. icon: "mdi-school",
  83. to: "/docs/fetching",
  84. },
  85. ],
  86. };
  87. },
  88. };
  89. </script>