docs.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 pa-6"
  39. style="
  40. flex-grow: 2;
  41. height: max-content;
  42. max-width: 90vw !important;
  43. background-color: #222;
  44. border-radius: 0.75rem;
  45. "
  46. >
  47. <NuxtChild />
  48. </v-card>
  49. </div>
  50. </template>
  51. <script>
  52. export default {
  53. transition(to, from) {
  54. if (!from) return "swoop-in";
  55. let routes = ["index", "install", "docs", "help", "faq", "donate", "links"];
  56. if (routes.indexOf(to.name) < 0) return "swoop-out";
  57. if (routes.indexOf(from.name) < 0) return "swoop-in";
  58. return routes.indexOf(to.name) > routes.indexOf(from.name)
  59. ? "swoop-left"
  60. : "swoop-right";
  61. },
  62. data() {
  63. return {
  64. //--- Links To Generate Above ---//
  65. links: [
  66. {
  67. name: "rights",
  68. icon: "mdi-book-open-variant",
  69. to: "/docs/usage-rights",
  70. },
  71. {
  72. name: "url",
  73. icon: "mdi-web",
  74. to: "/docs/url",
  75. },
  76. {
  77. name: "endpoints",
  78. icon: "mdi-transit-connection-variant",
  79. to: "/docs/endpoints",
  80. },
  81. {
  82. name: "fetching",
  83. icon: "mdi-school",
  84. to: "/docs/fetching",
  85. },
  86. ],
  87. };
  88. },
  89. };
  90. </script>