default.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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. color="primary"
  31. bottom
  32. left
  33. text
  34. >
  35. <v-icon color="primary" class="mr-4">mdi-alert-circle-outline</v-icon>
  36. <span v-html="alert.html" class="my-auto"></span>
  37. <template #action="{ attrs }">
  38. <v-btn
  39. v-bind="attrs"
  40. color="primary"
  41. flat
  42. icon
  43. @click="alert.show = false"
  44. >
  45. <v-icon>mdi-close-circle-outline</v-icon>
  46. </v-btn>
  47. </template>
  48. </v-snackbar>
  49. </v-app>
  50. </template>
  51. <script>
  52. export default {
  53. data: () => ({
  54. links: [
  55. { name: "Home", path: "/" },
  56. { name: "Install", path: "/install" },
  57. { name: "API", path: "/docs" },
  58. { name: "Help", path: "/help" },
  59. { name: "FAQ", path: "/faq" },
  60. { name: "Donate", path: "/donate" },
  61. { name: "Links", path: "/links" },
  62. ],
  63. alert: {
  64. show: false,
  65. html: "",
  66. },
  67. }),
  68. mounted() {
  69. setTimeout(() => {
  70. // check if browser version out of date
  71. if (
  72. window.navigator.userAgent.indexOf("Chrome") > -1 &&
  73. window.navigator.userAgent.indexOf("Edge") === -1
  74. ) {
  75. let chrome = window.navigator.userAgent.match(/Chrome\/(\d+)/);
  76. let chromeVersion = chrome ? chrome[1] : 0;
  77. if (chromeVersion < 70) {
  78. this.alert.html = `You are using <b style="background: #222; border-radius: .5rem; padding: .25rem .5rem;">${this.$ua._parsed.name} ${this.$ua._parsed.version}</b>. Please update to the latest version.`;
  79. this.alert.show = true;
  80. }
  81. }
  82. if (window.navigator.userAgent.indexOf("Firefox") > -1) {
  83. let firefox = window.navigator.userAgent.match(/Firefox\/(\d+)/);
  84. let firefoxVersion = firefox ? firefox[1] : 0;
  85. if (firefoxVersion < 60) {
  86. this.alert.html = `You are using <b style="background: #222; border-radius: .5rem; padding: .25rem .5rem;">${this.$ua._parsed.name} ${this.$ua._parsed.version}</b>. Please update to the latest version.`;
  87. this.alert.show = true;
  88. }
  89. }
  90. }, 1000);
  91. },
  92. };
  93. </script>
  94. <style>
  95. html,
  96. body {
  97. height: 100%;
  98. background: #111; /* for MacOS/iOS overscroll */
  99. height: -webkit-fill-available;
  100. background: #111;
  101. overflow: auto;
  102. }
  103. ::selection {
  104. background: #f44;
  105. color: #111;
  106. }
  107. ::-webkit-scrollbar {
  108. width: 1rem;
  109. }
  110. ::-webkit-scrollbar-track {
  111. background: #111; /* color of the tracking area */
  112. }
  113. ::-webkit-scrollbar-thumb {
  114. background-color: #333; /* color of the scroll thumb */
  115. border-radius: 20px; /* roundness of the scroll thumb */
  116. border: 4px solid #111; /* creates padding around scroll thumb */
  117. }
  118. ::-webkit-scrollbar-thumb:hover {
  119. background-color: #f22; /* color of the scroll thumb */
  120. border-radius: 20px; /* roundness of the scroll thumb */
  121. border: 4px solid #111; /* creates padding around scroll thumb */
  122. }
  123. .debug {
  124. /* usage: add class="debug" to the element */
  125. outline: 2px solid red;
  126. }
  127. .v-sheet.v-snack__wrapper{
  128. border-radius: 0.75rem !important;
  129. }
  130. .mainAltButton {
  131. margin: 0.25em;
  132. }
  133. .topBar {
  134. padding: 0 3rem;
  135. width: fit-content !important;
  136. background-color: #222 !important;
  137. border-radius: 1rem !important;
  138. border-radius: 0.75rem;
  139. overflow: hidden;
  140. }
  141. .title-text {
  142. font-size: 3rem;
  143. }
  144. @media (max-width: 768px) {
  145. /* mobile */
  146. .title-text {
  147. font-size: 2rem;
  148. }
  149. .topBar {
  150. width: calc(
  151. 100vw - 2rem
  152. ) !important; /* (2rem = mx-4) 1rem on left, 1rem on right */
  153. padding: 0;
  154. }
  155. }
  156. /* animations and all that */
  157. .swoop-in-enter-active,
  158. .swoop-in-leave-active,
  159. .swoop-out-enter-active,
  160. .swoop-out-leave-active,
  161. .swoop-left-enter-active,
  162. .swoop-left-leave-active,
  163. .swoop-right-enter-active,
  164. .swoop-right-leave-active {
  165. transition-duration: 0.1s;
  166. transition-property: opacity, transform;
  167. /* overflow: hidden; */
  168. }
  169. .swoop-left-enter,
  170. .swoop-right-leave-active {
  171. opacity: 0;
  172. transform: translate(1rem, 0);
  173. }
  174. .swoop-left-leave-active,
  175. .swoop-right-enter {
  176. opacity: 0;
  177. transform: translate(-1rem, 0);
  178. }
  179. .swoop-in-enter,
  180. .swoop-out-leave-active {
  181. opacity: 0;
  182. transform: scale(0.9);
  183. }
  184. .swoop-in-leave-active,
  185. .swoop-out-enter {
  186. opacity: 0;
  187. transform: scale(1.1);
  188. }
  189. .fly-in-from-top {
  190. opacity: 0;
  191. transform: scale(0.8) translateY(-12rem);
  192. animation: fly-in-from-top 0.5s 0.3s ease forwards;
  193. }
  194. @keyframes fly-in-from-top {
  195. 0% {
  196. opacity: 0;
  197. transform: scale(0.8) translateY(-12rem);
  198. }
  199. 100% {
  200. opacity: 1;
  201. transform: scale(1) translateY(0);
  202. }
  203. }
  204. /* reduced-motion animations */
  205. @media (prefers-reduced-motion) {
  206. .fly-in-from-top {
  207. opacity: 1;
  208. transform: none;
  209. animation: none;
  210. }
  211. .swoop-in-enter-active,
  212. .swoop-in-leave-active,
  213. .swoop-out-enter-active,
  214. .swoop-out-leave-active,
  215. .swoop-left-enter-active,
  216. .swoop-left-leave-active,
  217. .swoop-right-enter-active,
  218. .swoop-right-leave-active {
  219. transition-duration: 0.05s;
  220. transition-property: opacity;
  221. }
  222. .swoop-left-enter,
  223. .swoop-right-leave-active {
  224. opacity: 0;
  225. transform: none;
  226. }
  227. .swoop-left-leave-active,
  228. .swoop-right-enter {
  229. opacity: 0;
  230. transform: none;
  231. }
  232. .swoop-in-enter,
  233. .swoop-out-leave-active {
  234. opacity: 0;
  235. transform: none;
  236. }
  237. .swoop-in-leave-active,
  238. .swoop-out-enter {
  239. opacity: 0;
  240. transform: none;
  241. }
  242. }
  243. </style>