default.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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;
  105. height: -webkit-fill-available; /* for MacOS/iOS overscroll */
  106. scrollbar-color: #424242 #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: 1rem 0 0 1rem; /* roundness of the scroll thumb */
  121. border-bottom: 0.25rem solid #111; /* creates padding around scroll thumb */
  122. border-left: 0.25rem solid #111; /* creates padding around scroll thumb */
  123. border-top: 0.25rem solid #111; /* creates padding around scroll thumb */
  124. }
  125. ::-webkit-scrollbar-thumb:hover {
  126. background-color: #f22; /* color of the scroll thumb */
  127. border-radius: 1rem 0 0 1rem; /* roundness of the scroll thumb */
  128. border-bottom: 0.25rem solid #111; /* creates padding around scroll thumb */
  129. border-left: 0.25rem solid #111; /* creates padding around scroll thumb */
  130. border-top: 0.25rem solid #111; /* creates padding around scroll thumb */
  131. }
  132. .debug {
  133. /* usage: add class="debug" to the element */
  134. outline: 2px solid red;
  135. }
  136. .v-sheet.v-snack__wrapper {
  137. border-radius: 0.75rem !important;
  138. }
  139. .mainAltButton {
  140. margin: 0.25em;
  141. }
  142. .topBar {
  143. padding: 0 3rem;
  144. width: fit-content !important;
  145. backdrop-filter: blur(16px) saturate(180%);
  146. -webkit-backdrop-filter: blur(16px) saturate(180%);
  147. background: rgba(42, 42, 42, 0.75) !important;
  148. border-radius: 1rem !important;
  149. /* border: 1px solid #222; */
  150. overflow: hidden;
  151. }
  152. .title-text {
  153. font-size: 3rem;
  154. }
  155. @media (max-width: 768px) {
  156. /* mobile */
  157. .title-text {
  158. font-size: 2rem;
  159. }
  160. .topBar {
  161. width: calc(100vw - 2rem) !important; /* (2rem = mx-4) 1rem on left, 1rem on right */
  162. padding: 0;
  163. }
  164. }
  165. /* animations and all that */
  166. .swoop-in-enter-active,
  167. .swoop-in-leave-active,
  168. .swoop-out-enter-active,
  169. .swoop-out-leave-active,
  170. .swoop-left-enter-active,
  171. .swoop-left-leave-active,
  172. .swoop-right-enter-active,
  173. .swoop-right-leave-active {
  174. transition-duration: 0.1s;
  175. transition-property: opacity, transform;
  176. overflow: hidden;
  177. }
  178. .swoop-left-enter,
  179. .swoop-right-leave-active {
  180. opacity: 0;
  181. transform: translate(1rem, 0);
  182. }
  183. .swoop-left-leave-active,
  184. .swoop-right-enter {
  185. opacity: 0;
  186. transform: translate(-1rem, 0);
  187. }
  188. .swoop-in-enter,
  189. .swoop-out-leave-active {
  190. opacity: 0;
  191. transform: scale(0.9);
  192. }
  193. .swoop-in-leave-active,
  194. .swoop-out-enter {
  195. opacity: 0;
  196. transform: scale(1.1);
  197. }
  198. .fly-in-from-top {
  199. opacity: 0;
  200. transform: scale(0.8) translateY(-12rem);
  201. animation: fly-in-from-top 0.5s 0.3s ease forwards;
  202. }
  203. @keyframes fly-in-from-top {
  204. 0% {
  205. opacity: 0;
  206. transform: scale(0.8) translateY(-12rem);
  207. }
  208. 100% {
  209. opacity: 1;
  210. transform: scale(1) translateY(0);
  211. }
  212. }
  213. /* reduced-motion animations */
  214. @media (prefers-reduced-motion) {
  215. .fly-in-from-top {
  216. opacity: 1;
  217. transform: none;
  218. animation: none;
  219. }
  220. .swoop-in-enter-active,
  221. .swoop-in-leave-active,
  222. .swoop-out-enter-active,
  223. .swoop-out-leave-active,
  224. .swoop-left-enter-active,
  225. .swoop-left-leave-active,
  226. .swoop-right-enter-active,
  227. .swoop-right-leave-active {
  228. transition-duration: 0.05s;
  229. transition-property: opacity;
  230. }
  231. .swoop-left-enter,
  232. .swoop-right-leave-active {
  233. opacity: 0;
  234. transform: none;
  235. }
  236. .swoop-left-leave-active,
  237. .swoop-right-enter {
  238. opacity: 0;
  239. transform: none;
  240. }
  241. .swoop-in-enter,
  242. .swoop-out-leave-active {
  243. opacity: 0;
  244. transform: none;
  245. }
  246. .swoop-in-leave-active,
  247. .swoop-out-enter {
  248. opacity: 0;
  249. transform: none;
  250. }
  251. }
  252. </style>