index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <script setup lang="ts">
  2. /* Import modules. */
  3. import { ref } from 'vue'
  4. /* Initialize tabs. */
  5. const tabStart = ref(true)
  6. const tabConfig = ref(false)
  7. const tabLabs = ref(false)
  8. const tabExtras = ref(false)
  9. /* Initialize blockchain handlers. */
  10. const blockHeight = ref(0)
  11. /**
  12. * Load Tab
  13. *
  14. * @param _tabid Specifies the "active" tab.
  15. */
  16. const loadTab = (_tabid: string) => {
  17. /* Disable ALL tabs. */
  18. tabStart.value = false
  19. tabConfig.value = false
  20. tabLabs.value = false
  21. tabExtras.value = false
  22. /* Enable selected tab. */
  23. switch(_tabid) {
  24. case 'start':
  25. tabStart.value = true
  26. break
  27. case 'config':
  28. tabConfig.value = true
  29. break
  30. case 'labs':
  31. tabLabs.value = true
  32. break
  33. case 'extras':
  34. tabExtras.value = true
  35. break
  36. }
  37. }
  38. /**
  39. * Get Block Height
  40. *
  41. * Will query a cluster of Rostrum servers for the current block height.
  42. */
  43. const getBlockHeight = () => {
  44. /* Set block height. */
  45. // FIXME FOR DEV PURPOSES ONLY
  46. blockHeight.value = 1337
  47. }
  48. /* Request (current) block height. */
  49. getBlockHeight()
  50. </script>
  51. <template>
  52. <main class="max-w-7xl mx-auto">
  53. <header class="flex flex-col items-center">
  54. <img src="~/assets/nexa.svg" class="w-24 h-24" />
  55. <h1 class="text-5xl font-bold">
  56. Welcome to LibreScript!
  57. </h1>
  58. </header>
  59. <section class="mt-10 py-5 max-w-5xl mx-auto border border-purple-500 rounded-lg bg-gradient-to-r from-yellow-100 via-gray-50 to-yellow-100">
  60. <div class="-mt-10 relative flex justify-center">
  61. <span class="isolate inline-flex -space-x-px rounded-md shadow-sm">
  62. <button
  63. @click="loadTab('start')"
  64. type="button"
  65. class="relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-400 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
  66. >
  67. <span class="sr-only">Get started</span>
  68. <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  69. <path d="M2.695 14.763l-1.262 3.154a.5.5 0 00.65.65l3.155-1.262a4 4 0 001.343-.885L17.5 5.5a2.121 2.121 0 00-3-3L3.58 13.42a4 4 0 00-.885 1.343z" />
  70. </svg>
  71. </button>
  72. <button
  73. @click="loadTab('config')"
  74. type="button"
  75. class="relative inline-flex items-center border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-400 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
  76. >
  77. <span class="sr-only">Configuration</span>
  78. <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  79. <path
  80. fill-rule="evenodd"
  81. d="M15.621 4.379a3 3 0 00-4.242 0l-7 7a3 3 0 004.241 4.243h.001l.497-.5a.75.75 0 011.064 1.057l-.498.501-.002.002a4.5 4.5 0 01-6.364-6.364l7-7a4.5 4.5 0 016.368 6.36l-3.455 3.553A2.625 2.625 0 119.52 9.52l3.45-3.451a.75.75 0 111.061 1.06l-3.45 3.451a1.125 1.125 0 001.587 1.595l3.454-3.553a3 3 0 000-4.242z"
  82. clip-rule="evenodd"
  83. />
  84. </svg>
  85. </button>
  86. <button
  87. @click="loadTab('labs')"
  88. type="button"
  89. class="relative inline-flex items-center border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-400 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
  90. >
  91. <span class="sr-only">Annotate</span>
  92. <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  93. <path
  94. fill-rule="evenodd"
  95. d="M10 2c-2.236 0-4.43.18-6.57.524C1.993 2.755 1 4.014 1 5.426v5.148c0 1.413.993 2.67 2.43 2.902 1.168.188 2.352.327 3.55.414.28.02.521.18.642.413l1.713 3.293a.75.75 0 001.33 0l1.713-3.293a.783.783 0 01.642-.413 41.102 41.102 0 003.55-.414c1.437-.231 2.43-1.49 2.43-2.902V5.426c0-1.413-.993-2.67-2.43-2.902A41.289 41.289 0 0010 2zM6.75 6a.75.75 0 000 1.5h6.5a.75.75 0 000-1.5h-6.5zm0 2.5a.75.75 0 000 1.5h3.5a.75.75 0 000-1.5h-3.5z"
  96. clip-rule="evenodd"
  97. />
  98. </svg>
  99. </button>
  100. <button
  101. @click="loadTab('extras')"
  102. type="button"
  103. class="relative inline-flex items-center rounded-r-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-400 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
  104. >
  105. <span class="sr-only">Delete</span>
  106. <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  107. <path
  108. fill-rule="evenodd"
  109. d="M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z"
  110. clip-rule="evenodd"
  111. />
  112. </svg>
  113. </button>
  114. </span>
  115. </div>
  116. <!-- BEGIN TABS -->
  117. <section v-if="tabStart" class="">
  118. <div class="mt-5 flex justify-center">
  119. <h2 class="text-2xl font-bold">
  120. Get started
  121. </h2>
  122. </div>
  123. <p class="px-10 py-3">
  124. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  125. </p>
  126. </section>
  127. <section v-if="tabConfig" class="">
  128. <div class="mt-5 flex justify-center">
  129. <h2 class="text-2xl font-bold">
  130. Configuration
  131. </h2>
  132. </div>
  133. <p class="px-10 py-3">
  134. Start by modifying `nuxt.config.ts` to best suite your needs.
  135. Customize your app name, description and favorite icon.
  136. Favicon is located in `/public` folder.
  137. </p>
  138. </section>
  139. <section v-if="tabLabs" class="">
  140. <div class="mt-5 flex justify-center">
  141. <h2 class="text-2xl font-bold">
  142. Lab Experiments
  143. </h2>
  144. </div>
  145. <p class="px-10 py-3">
  146. Latest block is <NuxtLink :to="'https://explorer.nexa.org/block-height/' + blockHeight" target="_blank" class="text-xl text-blue-500 font-medium hover:underline">{{blockHeight}}</NuxtLink>
  147. </p>
  148. <p class="px-10 py-3">
  149. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  150. </p>
  151. </section>
  152. <section v-if="tabExtras" class="">
  153. <div class="mt-5 flex justify-center">
  154. <h2 class="text-2xl font-bold">
  155. Extra Resources
  156. </h2>
  157. </div>
  158. <p class="px-10 py-3">
  159. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  160. </p>
  161. </section>
  162. <!-- END TABS -->
  163. </section>
  164. <section class="mt-5 max-w-5xl mx-auto grid grid-cols-5 gap-5">
  165. <div class="flex flex-col col-span-3 gap-5">
  166. <NuxtLink to="https://nexajs.org" target="_blank" class="flex items-center gap-4 bg-gradient-to-r from-rose-500 to-rose-700 rounded-lg">
  167. <svg class="mx-5 w-32 h-32 text-rose-900" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  168. <path stroke-linecap="round" stroke-linejoin="round" d="M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z"></path>
  169. </svg>
  170. <div>
  171. <h2 class="text-2xl text-rose-100 font-medium">
  172. Why Build on LibreScript?
  173. </h2>
  174. <p class="text-rose-100">
  175. LibreScript offers a premium Developer Experience (DX) that favors rapid iterations to get you deployed as quickly as possible.
  176. </p>
  177. </div>
  178. </NuxtLink>
  179. <NuxtLink to="https://nexajs.org" target="_blank" class="flex items-center gap-4 bg-gradient-to-r from-yellow-500 to-yellow-700 rounded-lg">
  180. <svg class="mx-5 w-32 h-32 text-yellow-900" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  181. <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 01-1.125-1.125v-3.75zM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-8.25zM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-2.25z"></path>
  182. </svg>
  183. <div>
  184. <h2 class="text-2xl text-yellow-100 font-medium">
  185. Check our more Examples
  186. </h2>
  187. <p class="text-yellow-100">
  188. The LibreScript community offers ample examples to help you get started quickly using the industry's best practices.
  189. </p>
  190. </div>
  191. </NuxtLink>
  192. </div>
  193. <NuxtLink to="https://nexajs.org" target="_blank" class="col-span-2 py-3 flex flex-col items-center gap-2 bg-gradient-to-b from-sky-700 to-sky-500 rounded-lg">
  194. <div class="p-3 flex flex-col">
  195. <h2 class="text-3xl text-sky-100 font-medium text-center">
  196. Documentation
  197. </h2>
  198. <p class="mt-3 text-sky-100">
  199. LibreScript offers excellent documentation that offers modern and up-to-date guides and tutorials for anything and everything you need.
  200. </p>
  201. </div>
  202. <svg class="mx-5 w-24 h-24 text-sky-900" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  203. <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25M9 16.5v.75m3-3v3M15 12v5.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
  204. </svg>
  205. </NuxtLink>
  206. </section>
  207. <Footer />
  208. </main>
  209. </template>