docs.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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="(item, i) in links"
  19. :key="i"
  20. :to="item.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 v-text="item.text" />
  28. </v-list-item-title>
  29. <v-list-item-icon>
  30. <v-icon v-text="item.icon" />
  31. </v-list-item-icon>
  32. </v-list-item>
  33. </v-list>
  34. <!-- docs content -->
  35. <v-card
  36. class="text-left pa-8"
  37. style="
  38. flex-grow: 2;
  39. height: max-content;
  40. max-width: 90vw !important;
  41. background-color: #222;
  42. border-radius: 1rem;
  43. "
  44. >
  45. <NuxtChild />
  46. </v-card>
  47. </div>
  48. </template>
  49. <script>
  50. export default {
  51. transition(to, from) {
  52. if (!from) return "swoop-in";
  53. let routes = ["index", "install", "docs", "help", "faq", "donate", "links"];
  54. if (routes.indexOf(to.name) < 0) return "swoop-out";
  55. if (routes.indexOf(from.name) < 0) return "swoop-in";
  56. return routes.indexOf(to.name) > routes.indexOf(from.name)
  57. ? "swoop-left"
  58. : "swoop-right";
  59. },
  60. data() {
  61. return {
  62. //--- Links To Generate Above ---//
  63. links: [
  64. {
  65. text: "Usage Rights",
  66. icon: "mdi-book-open-variant",
  67. to: "/docs/usage-rights",
  68. },
  69. {
  70. text: "URL Information",
  71. icon: "mdi-web",
  72. to: "/docs/url",
  73. },
  74. {
  75. text: "Available Endpoints",
  76. icon: "mdi-transit-connection-variant",
  77. to: "/docs/endpoints",
  78. },
  79. {
  80. text: "Basic Fetching Tutorial",
  81. icon: "mdi-school",
  82. to: "/docs/fetching",
  83. },
  84. ],
  85. };
  86. },
  87. };
  88. </script>