default.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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 v-bind="attrs" color="primary" text icon @click="alert.show = false">
  40. <v-icon>mdi-close-circle-outline</v-icon>
  41. </v-btn>
  42. </template>
  43. </v-snackbar>
  44. </v-app>
  45. </template>
  46. <script>
  47. export default {
  48. data: () => ({
  49. links: [
  50. { name: "Home", path: "/" },
  51. { name: "Install", path: "/install" },
  52. { name: "API", path: "/docs" },
  53. { name: "Help", path: "/help" },
  54. { name: "FAQ", path: "/faq" },
  55. { name: "Donate", path: "/donate" },
  56. { name: "Links", path: "/links" },
  57. ],
  58. alert: {
  59. show: false,
  60. html: "",
  61. },
  62. }),
  63. mounted() {
  64. setTimeout(() => {
  65. // Chrome < 70
  66. if (
  67. window.navigator.userAgent.indexOf("Chrome") > -1 &&
  68. window.navigator.userAgent.indexOf("Edge") === -1
  69. ) {
  70. let chrome = window.navigator.userAgent.match(/Chrome\/(\d+)/);
  71. let chromeVersion = chrome ? chrome[1] : 0;
  72. if (chromeVersion < 70) {
  73. 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.`;
  74. this.alert.show = true;
  75. }
  76. }
  77. // FF < 60
  78. if (window.navigator.userAgent.indexOf("Firefox") > -1) {
  79. let firefox = window.navigator.userAgent.match(/Firefox\/(\d+)/);
  80. let firefoxVersion = firefox ? firefox[1] : 0;
  81. if (firefoxVersion < 60) {
  82. 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.`;
  83. this.alert.show = true;
  84. }
  85. }
  86. // IE
  87. if (window.navigator.userAgent.indexOf("MSIE") > -1) {
  88. 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.`;
  89. this.alert.show = true;
  90. }
  91. // Win7
  92. if (window.navigator.userAgent.indexOf("Windows NT 6.1") > -1) {
  93. this.alert.html = `<b style="background: #222; border-radius: .5rem; padding: .25rem .5rem;">Windows 7</b> is not supported. Update Windows, or install Linux :)`;
  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. }
  108. ::selection {
  109. background: #f44;
  110. color: #111;
  111. }
  112. ::-webkit-scrollbar {
  113. width: 1rem;
  114. }
  115. ::-webkit-scrollbar-track {
  116. background: #111; /* color of the tracking area */
  117. }
  118. ::-webkit-scrollbar-thumb {
  119. background-color: #333; /* 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. ::-webkit-scrollbar-thumb:hover {
  124. background-color: #f22; /* color of the scroll thumb */
  125. border-radius: 20px; /* roundness of the scroll thumb */
  126. border: 4px solid #111; /* creates padding around scroll thumb */
  127. }
  128. .debug {
  129. /* usage: add class="debug" to the element */
  130. outline: 2px solid red;
  131. }
  132. .v-sheet.v-snack__wrapper {
  133. border-radius: 0.75rem !important;
  134. }
  135. .mainAltButton {
  136. margin: 0.25em;
  137. }
  138. .topBar {
  139. padding: 0 3rem;
  140. width: fit-content !important;
  141. background-color: #222 !important;
  142. border-radius: 1rem !important;
  143. border-radius: 0.75rem;
  144. overflow: hidden;
  145. }
  146. .title-text {
  147. font-size: 3rem;
  148. }
  149. @media (max-width: 768px) {
  150. /* mobile */
  151. .title-text {
  152. font-size: 2rem;
  153. }
  154. .topBar {
  155. width: calc(100vw - 2rem) !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>