default.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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. // check if browser version out of date
  72. if (
  73. window.navigator.userAgent.indexOf("Chrome") > -1 &&
  74. window.navigator.userAgent.indexOf("Edge") === -1
  75. ) {
  76. let chrome = window.navigator.userAgent.match(/Chrome\/(\d+)/);
  77. let chromeVersion = chrome ? chrome[1] : 0;
  78. if (chromeVersion < 70) {
  79. 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.`;
  80. this.alert.show = true;
  81. }
  82. }
  83. if (window.navigator.userAgent.indexOf("Firefox") > -1) {
  84. let firefox = window.navigator.userAgent.match(/Firefox\/(\d+)/);
  85. let firefoxVersion = firefox ? firefox[1] : 0;
  86. if (firefoxVersion < 60) {
  87. 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.`;
  88. this.alert.show = true;
  89. }
  90. }
  91. // check for IE browser
  92. if (window.navigator.userAgent.indexOf("MSIE") > -1) {
  93. this.alert.html = `Looks like you're using <b style="background: #222; border-radius: .5rem; padding: .25rem .5rem;">Internet Explorer</b>. Stop it, get some help.`;
  94. this.alert.show = true;
  95. }
  96. }, 1000);
  97. },
  98. };
  99. </script>
  100. <style>
  101. html,
  102. body {
  103. height: 100%;
  104. background: #111; /* for MacOS/iOS overscroll */
  105. height: -webkit-fill-available;
  106. background: #111;
  107. overflow: auto;
  108. }
  109. ::selection {
  110. background: #f44;
  111. color: #111;
  112. }
  113. ::-webkit-scrollbar {
  114. width: 1rem;
  115. }
  116. ::-webkit-scrollbar-track {
  117. background: #111; /* color of the tracking area */
  118. }
  119. ::-webkit-scrollbar-thumb {
  120. background-color: #333; /* color of the scroll thumb */
  121. border-radius: 20px; /* roundness of the scroll thumb */
  122. border: 4px solid #111; /* creates padding around scroll thumb */
  123. }
  124. ::-webkit-scrollbar-thumb:hover {
  125. background-color: #f22; /* color of the scroll thumb */
  126. border-radius: 20px; /* roundness of the scroll thumb */
  127. border: 4px solid #111; /* creates padding around scroll thumb */
  128. }
  129. .debug {
  130. /* usage: add class="debug" to the element */
  131. outline: 2px solid red;
  132. }
  133. .v-sheet.v-snack__wrapper {
  134. border-radius: 0.75rem !important;
  135. }
  136. .mainAltButton {
  137. margin: 0.25em;
  138. }
  139. .topBar {
  140. padding: 0 3rem;
  141. width: fit-content !important;
  142. background-color: #222 !important;
  143. border-radius: 1rem !important;
  144. border-radius: 0.75rem;
  145. overflow: hidden;
  146. }
  147. .title-text {
  148. font-size: 3rem;
  149. }
  150. @media (max-width: 768px) {
  151. /* mobile */
  152. .title-text {
  153. font-size: 2rem;
  154. }
  155. .topBar {
  156. width: calc(
  157. 100vw - 2rem
  158. ) !important; /* (2rem = mx-4) 1rem on left, 1rem on right */
  159. padding: 0;
  160. }
  161. }
  162. /* animations and all that */
  163. .swoop-in-enter-active,
  164. .swoop-in-leave-active,
  165. .swoop-out-enter-active,
  166. .swoop-out-leave-active,
  167. .swoop-left-enter-active,
  168. .swoop-left-leave-active,
  169. .swoop-right-enter-active,
  170. .swoop-right-leave-active {
  171. transition-duration: 0.1s;
  172. transition-property: opacity, transform;
  173. /* overflow: hidden; */
  174. }
  175. .swoop-left-enter,
  176. .swoop-right-leave-active {
  177. opacity: 0;
  178. transform: translate(1rem, 0);
  179. }
  180. .swoop-left-leave-active,
  181. .swoop-right-enter {
  182. opacity: 0;
  183. transform: translate(-1rem, 0);
  184. }
  185. .swoop-in-enter,
  186. .swoop-out-leave-active {
  187. opacity: 0;
  188. transform: scale(0.9);
  189. }
  190. .swoop-in-leave-active,
  191. .swoop-out-enter {
  192. opacity: 0;
  193. transform: scale(1.1);
  194. }
  195. .fly-in-from-top {
  196. opacity: 0;
  197. transform: scale(0.8) translateY(-12rem);
  198. animation: fly-in-from-top 0.5s 0.3s ease forwards;
  199. }
  200. @keyframes fly-in-from-top {
  201. 0% {
  202. opacity: 0;
  203. transform: scale(0.8) translateY(-12rem);
  204. }
  205. 100% {
  206. opacity: 1;
  207. transform: scale(1) translateY(0);
  208. }
  209. }
  210. /* reduced-motion animations */
  211. @media (prefers-reduced-motion) {
  212. .fly-in-from-top {
  213. opacity: 1;
  214. transform: none;
  215. animation: none;
  216. }
  217. .swoop-in-enter-active,
  218. .swoop-in-leave-active,
  219. .swoop-out-enter-active,
  220. .swoop-out-leave-active,
  221. .swoop-left-enter-active,
  222. .swoop-left-leave-active,
  223. .swoop-right-enter-active,
  224. .swoop-right-leave-active {
  225. transition-duration: 0.05s;
  226. transition-property: opacity;
  227. }
  228. .swoop-left-enter,
  229. .swoop-right-leave-active {
  230. opacity: 0;
  231. transform: none;
  232. }
  233. .swoop-left-leave-active,
  234. .swoop-right-enter {
  235. opacity: 0;
  236. transform: none;
  237. }
  238. .swoop-in-enter,
  239. .swoop-out-leave-active {
  240. opacity: 0;
  241. transform: none;
  242. }
  243. .swoop-in-leave-active,
  244. .swoop-out-enter {
  245. opacity: 0;
  246. transform: none;
  247. }
  248. }
  249. </style>