default.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <v-app dark>
  3. <!-- height = 4rem, margin-y = 1rem -->
  4. <v-app-bar app text class="topBar fly-in-from-top my-4 mx-auto">
  5. <v-tabs centered center-active color="primary" router show-arrows>
  6. <v-tab v-for="link in links" :key="link.path" :to="link.path">
  7. {{ link.name }}
  8. </v-tab>
  9. </v-tabs>
  10. </v-app-bar>
  11. <!-- abstract background -->
  12. <v-img
  13. src="/ui/abstract.svg"
  14. style="position: absolute; left: 0; right: 0; width: 100vw; height: 100vh"
  15. />
  16. <v-main style="padding-top: 4rem !important">
  17. <!-- min-height helps keep content centered, use .debug to to see it -->
  18. <center
  19. class="py-8 mx-auto d-flex flex-column justify-center items-center"
  20. style="width: 90vw; min-height: calc(100vh - 8rem)"
  21. >
  22. <nuxt />
  23. </center>
  24. </v-main>
  25. <!-- Debugger Notification -->
  26. <v-snackbar
  27. v-model="alert.show"
  28. :timeout="-1"
  29. class="ma-4 desktop-only"
  30. transition="slide-y-reverse-transition"
  31. color="primary"
  32. bottom
  33. left
  34. text
  35. >
  36. <v-icon color="primary" class="mr-4">mdi-alert-circle-outline</v-icon>
  37. <span class="my-auto" v-html="alert.html"></span>
  38. <template #action="{ attrs }">
  39. <v-btn
  40. v-bind="attrs"
  41. color="primary"
  42. text
  43. icon
  44. @click="alert.show = false"
  45. >
  46. <v-icon>mdi-close-circle-outline</v-icon>
  47. </v-btn>
  48. </template>
  49. </v-snackbar>
  50. </v-app>
  51. </template>
  52. <script>
  53. export default {
  54. data: () => ({
  55. links: [
  56. { name: "Home", path: "/" },
  57. { name: "Install", path: "/install" },
  58. { name: "API", path: "/docs" },
  59. { name: "Help", path: "/help" },
  60. { name: "FAQ", path: "/faq" },
  61. { name: "Donate", path: "/donate" },
  62. { name: "Links", path: "/links" },
  63. ],
  64. alert: {
  65. show: false,
  66. html: "",
  67. },
  68. }),
  69. mounted() {
  70. setTimeout(() => {
  71. // Chrome < 70 or FF < 60
  72. if (
  73. (this.$ua._parsed.name == "Chrome" &&
  74. parseInt(this.$ua._parsed.version.split(".")[0]) < 70) ||
  75. (this.$ua._parsed.name == "Firefox" &&
  76. parseInt(this.$ua._parsed.version.split(".")[0]) < 60)
  77. ) {
  78. this.alert.html = `<b style="background: #222; border-radius: .5rem; padding: .25rem .25rem .25rem .5rem; margin: 0 .25rem;">
  79. ${this.$ua._parsed.name} ${this.$ua._parsed.version.split(".")[0]}
  80. </b> is not supported. Consider upgrading to the latest version.`;
  81. this.alert.show = true;
  82. }
  83. // Win7
  84. if (window.navigator.userAgent.indexOf("Windows NT 6.1") > -1) {
  85. this.alert.html = `<b style="background: #222; border-radius: .5rem; padding: .25rem .5rem; margin: 0 .25rem;">Windows 7</b> is not supported. Consider upgrading Windows, or installing Linux.`;
  86. this.alert.show = true;
  87. }
  88. }, 1000);
  89. },
  90. };
  91. </script>
  92. <style>
  93. html,
  94. body {
  95. height: 100%;
  96. background: #111;
  97. height: -webkit-fill-available; /* for MacOS/iOS overscroll */
  98. scrollbar-color: #424242 #111;
  99. }
  100. ::selection {
  101. background: #f44;
  102. color: #111;
  103. }
  104. ::-webkit-scrollbar {
  105. width: 1rem;
  106. }
  107. ::-webkit-scrollbar-track {
  108. background: #111; /* color of the tracking area */
  109. }
  110. ::-webkit-scrollbar-thumb {
  111. background-color: #333; /* color of the scroll thumb */
  112. border-radius: 1rem 0 0 1rem; /* roundness of the scroll thumb */
  113. border-bottom: 0.25rem solid #111; /* creates padding around scroll thumb */
  114. border-left: 0.25rem solid #111; /* creates padding around scroll thumb */
  115. border-top: 0.25rem solid #111; /* creates padding around scroll thumb */
  116. }
  117. ::-webkit-scrollbar-thumb:hover {
  118. background-color: #f22; /* color of the scroll thumb */
  119. border-radius: 1rem 0 0 1rem; /* roundness of the scroll thumb */
  120. border-bottom: 0.25rem solid #111; /* creates padding around scroll thumb */
  121. border-left: 0.25rem solid #111; /* creates padding around scroll thumb */
  122. border-top: 0.25rem solid #111; /* creates padding around scroll thumb */
  123. }
  124. .debug {
  125. /* usage: add class="debug" to the element */
  126. outline: 2px solid red;
  127. }
  128. .v-sheet.v-snack__wrapper {
  129. border-radius: 0.75rem !important;
  130. }
  131. .mainAltButton {
  132. margin: 0.25em;
  133. }
  134. .topBar {
  135. padding: 0 3rem;
  136. width: fit-content !important;
  137. backdrop-filter: blur(16px) saturate(180%);
  138. -webkit-backdrop-filter: blur(16px) saturate(180%);
  139. background: rgba(42, 42, 42, 0.75) !important;
  140. border-radius: 1rem !important;
  141. /* border: 1px solid #222; */
  142. overflow: hidden;
  143. }
  144. .title-text {
  145. font-size: 3rem;
  146. }
  147. @media (max-width: 768px) {
  148. /* mobile */
  149. .title-text {
  150. font-size: 2rem;
  151. }
  152. .topBar {
  153. width: calc(
  154. 100vw - 2rem
  155. ) !important; /* (2rem = mx-4) 1rem on left, 1rem on right */
  156. padding: 0;
  157. }
  158. }
  159. /* animations and all that */
  160. .swoop-in-enter-active,
  161. .swoop-in-leave-active,
  162. .swoop-out-enter-active,
  163. .swoop-out-leave-active,
  164. .swoop-left-enter-active,
  165. .swoop-left-leave-active,
  166. .swoop-right-enter-active,
  167. .swoop-right-leave-active {
  168. transition-duration: 0.1s;
  169. transition-property: opacity, transform;
  170. overflow: hidden;
  171. }
  172. .swoop-left-enter,
  173. .swoop-right-leave-active {
  174. opacity: 0;
  175. transform: translate(1rem, 0);
  176. }
  177. .swoop-left-leave-active,
  178. .swoop-right-enter {
  179. opacity: 0;
  180. transform: translate(-1rem, 0);
  181. }
  182. .swoop-in-enter,
  183. .swoop-out-leave-active {
  184. opacity: 0;
  185. transform: scale(0.9);
  186. }
  187. .swoop-in-leave-active,
  188. .swoop-out-enter {
  189. opacity: 0;
  190. transform: scale(1.1);
  191. }
  192. .fly-in-from-top {
  193. opacity: 0;
  194. transform: scale(0.8) translateY(-12rem);
  195. animation: fly-in-from-top 0.5s 0.3s ease forwards;
  196. }
  197. @keyframes fly-in-from-top {
  198. 0% {
  199. opacity: 0;
  200. transform: scale(0.8) translateY(-12rem);
  201. }
  202. 100% {
  203. opacity: 1;
  204. transform: scale(1) translateY(0);
  205. }
  206. }
  207. /* reduced-motion animations */
  208. @media (prefers-reduced-motion) {
  209. .fly-in-from-top {
  210. opacity: 1;
  211. transform: none;
  212. animation: none;
  213. }
  214. .swoop-in-enter-active,
  215. .swoop-in-leave-active,
  216. .swoop-out-enter-active,
  217. .swoop-out-leave-active,
  218. .swoop-left-enter-active,
  219. .swoop-left-leave-active,
  220. .swoop-right-enter-active,
  221. .swoop-right-leave-active {
  222. transition-duration: 0.05s;
  223. transition-property: opacity;
  224. }
  225. .swoop-left-enter,
  226. .swoop-right-leave-active {
  227. opacity: 0;
  228. transform: none;
  229. }
  230. .swoop-left-leave-active,
  231. .swoop-right-enter {
  232. opacity: 0;
  233. transform: none;
  234. }
  235. .swoop-in-enter,
  236. .swoop-out-leave-active {
  237. opacity: 0;
  238. transform: none;
  239. }
  240. .swoop-in-leave-active,
  241. .swoop-out-enter {
  242. opacity: 0;
  243. transform: none;
  244. }
  245. }
  246. </style>