default.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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. }, 1000);
  84. },
  85. };
  86. </script>
  87. <style>
  88. html,
  89. body {
  90. height: 100%;
  91. background: #111;
  92. height: -webkit-fill-available; /* for MacOS/iOS overscroll */
  93. scrollbar-color: #424242 #111;
  94. }
  95. ::selection {
  96. background: #f44;
  97. color: #111;
  98. }
  99. ::-webkit-scrollbar {
  100. width: 1rem;
  101. }
  102. ::-webkit-scrollbar-track {
  103. background: #111; /* color of the tracking area */
  104. }
  105. ::-webkit-scrollbar-thumb {
  106. background-color: #333; /* color of the scroll thumb */
  107. border-radius: 1rem 0 0 1rem; /* roundness of the scroll thumb */
  108. border-bottom: 0.25rem solid #111; /* creates padding around scroll thumb */
  109. border-left: 0.25rem solid #111; /* creates padding around scroll thumb */
  110. border-top: 0.25rem solid #111; /* creates padding around scroll thumb */
  111. }
  112. ::-webkit-scrollbar-thumb:hover {
  113. background-color: #f22; /* color of the scroll thumb */
  114. border-radius: 1rem 0 0 1rem; /* roundness of the scroll thumb */
  115. border-bottom: 0.25rem solid #111; /* creates padding around scroll thumb */
  116. border-left: 0.25rem solid #111; /* creates padding around scroll thumb */
  117. border-top: 0.25rem solid #111; /* creates padding around scroll thumb */
  118. }
  119. .debug {
  120. /* usage: add class="debug" to the element */
  121. outline: 2px solid red;
  122. }
  123. .v-sheet.v-snack__wrapper {
  124. border-radius: 0.75rem !important;
  125. }
  126. .mainAltButton {
  127. margin: 0.25em;
  128. }
  129. .title-text {
  130. font-size: 3rem;
  131. }
  132. .topBar {
  133. padding: 0 3rem;
  134. width: fit-content !important;
  135. backdrop-filter: blur(16px) saturate(180%);
  136. -webkit-backdrop-filter: blur(16px) saturate(180%);
  137. background: rgba(42, 42, 42, 0.75) !important;
  138. border-radius: 1rem !important;
  139. /* border: 1px solid #222; */
  140. overflow: hidden;
  141. }
  142. /* used in docs.vue */
  143. .flex-wrapper {
  144. display: flex;
  145. flex-wrap: nowrap;
  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. .flex-wrapper {
  159. display: flex;
  160. flex-wrap: wrap;
  161. }
  162. }
  163. /* used in docs.vue, help.vue and faq.vue */
  164. .width-constraint {
  165. max-width: auto;
  166. margin: 0 auto;
  167. }
  168. @media (min-width: 960px) {
  169. /* tablet */
  170. .width-constraint {
  171. width: 75vw;
  172. }
  173. }
  174. @media (min-width: 1264px) {
  175. /* desktop */
  176. .width-constraint {
  177. width: 60vw;
  178. }
  179. }
  180. @media (min-width: 1904) {
  181. /* 4k/ultrawide */
  182. .width-constraint {
  183. width: 42vw;
  184. }
  185. }
  186. /* animations and all that */
  187. .swoop-in-enter-active,
  188. .swoop-in-leave-active,
  189. .swoop-out-enter-active,
  190. .swoop-out-leave-active,
  191. .swoop-left-enter-active,
  192. .swoop-left-leave-active,
  193. .swoop-right-enter-active,
  194. .swoop-right-leave-active {
  195. transition-duration: 0.1s;
  196. transition-property: opacity, transform;
  197. }
  198. .swoop-left-enter,
  199. .swoop-right-leave-active {
  200. opacity: 0;
  201. transform: translate(1rem, 0);
  202. }
  203. .swoop-left-leave-active,
  204. .swoop-right-enter {
  205. opacity: 0;
  206. transform: translate(-1rem, 0);
  207. }
  208. .swoop-in-enter,
  209. .swoop-out-leave-active {
  210. opacity: 0;
  211. transform: scale(0.9);
  212. }
  213. .swoop-in-leave-active,
  214. .swoop-out-enter {
  215. opacity: 0;
  216. transform: scale(1.1);
  217. }
  218. .fly-in-from-top {
  219. opacity: 0;
  220. transform: scale(0.8) translateY(-12rem);
  221. animation: fly-in-from-top 0.5s 0.3s ease forwards;
  222. }
  223. @keyframes fly-in-from-top {
  224. 0% {
  225. opacity: 0;
  226. transform: scale(0.8) translateY(-12rem);
  227. }
  228. 100% {
  229. opacity: 1;
  230. transform: scale(1) translateY(0);
  231. }
  232. }
  233. /* reduced-motion animations */
  234. @media (prefers-reduced-motion) {
  235. .fly-in-from-top {
  236. opacity: 1;
  237. transform: none;
  238. animation: none;
  239. }
  240. .swoop-in-enter-active,
  241. .swoop-in-leave-active,
  242. .swoop-out-enter-active,
  243. .swoop-out-leave-active,
  244. .swoop-left-enter-active,
  245. .swoop-left-leave-active,
  246. .swoop-right-enter-active,
  247. .swoop-right-leave-active {
  248. transition-duration: 0.05s;
  249. transition-property: opacity;
  250. }
  251. .swoop-left-enter,
  252. .swoop-right-leave-active {
  253. opacity: 0;
  254. transform: none;
  255. }
  256. .swoop-left-leave-active,
  257. .swoop-right-enter {
  258. opacity: 0;
  259. transform: none;
  260. }
  261. .swoop-in-enter,
  262. .swoop-out-leave-active {
  263. opacity: 0;
  264. transform: none;
  265. }
  266. .swoop-in-leave-active,
  267. .swoop-out-enter {
  268. opacity: 0;
  269. transform: none;
  270. }
  271. }
  272. </style>