lobby.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <script setup lang="ts">
  2. useHead({
  3. title: `Lobby — Hush Your Money`,
  4. meta: [
  5. { name: 'description', content: `Hush Your Money makes spending safu.` }
  6. ],
  7. })
  8. /* Initialize stores. */
  9. import { useSystemStore } from '@/stores/system'
  10. const System = useSystemStore()
  11. const lblPrevious = () => {
  12. if (this.tabIndex === 1) {
  13. return 'Identity'
  14. }
  15. if (this.tabIndex === 2) {
  16. return 'Analysis'
  17. }
  18. return null
  19. }
  20. const lblNext = () => {
  21. if (this.tabIndex === 0) {
  22. return 'Analysis'
  23. }
  24. if (this.tabIndex === 1) {
  25. return 'Shuffler'
  26. }
  27. return null
  28. }
  29. // onMounted(() => {
  30. // console.log('Mounted!')
  31. // // Now it's safe to perform setup operations.
  32. // })
  33. // onBeforeUnmount(() => {
  34. // console.log('Before Unmount!')
  35. // // Now is the time to perform all cleanup operations.
  36. // })
  37. const next = () => {
  38. switch(this.tabIndex) {
  39. case 0:
  40. return this.showAnalysis()
  41. case 1:
  42. return this.showShuffler()
  43. }
  44. }
  45. const previous = () => {
  46. switch(this.tabIndex) {
  47. case 1:
  48. return this.showIdentity()
  49. case 2:
  50. return this.showAnalysis()
  51. }
  52. }
  53. const finish = () => {
  54. this.toast(['Done!', 'You shuffle session is complete', 'success'])
  55. }
  56. const showOptions = () => {
  57. this.toast(['Oops!', 'This feature is not ready yet', 'error'])
  58. const coins = this.getCoins
  59. console.log('COINS', coins)
  60. this.updateCoins()
  61. }
  62. /**
  63. * Show Identity
  64. */
  65. const showIdentity = () => {
  66. /* Set tab index. */
  67. this.tabIndex = 0
  68. /* Update progress. */
  69. let move_distance = 100 / 3
  70. move_distance = move_distance * this.tabIndex + move_distance / 2
  71. /* Set progress bar width. */
  72. this.pbWidth = `${move_distance}%`
  73. }
  74. /**
  75. * Show Analysis
  76. */
  77. const showAnalysis = () => {
  78. // return this.previewNotice()
  79. /* Set tab index. */
  80. this.tabIndex = 1
  81. /* Update progress. */
  82. let move_distance = 100 / 3
  83. move_distance = move_distance * this.tabIndex + move_distance / 2
  84. /* Set progress bar width. */
  85. this.pbWidth = `${move_distance}%`
  86. }
  87. /**
  88. * Show Shuffler
  89. */
  90. const showShuffler = () => {
  91. // return this.previewNotice()
  92. /* Validate master seed. */
  93. if (!this.getMasterSeed) {
  94. return this.toast(['Oops!', 'Please choose an Identity to use with Shuffler', 'error'])
  95. }
  96. /* Set tab index. */
  97. this.tabIndex = 2
  98. /* Update progress. */
  99. let move_distance = 100 / 3
  100. move_distance = move_distance * this.tabIndex + move_distance / 2
  101. /* Set progress bar width. */
  102. this.pbWidth = `${move_distance}%`
  103. }
  104. </script>
  105. <template>
  106. <h1 class="text-6xl text-fuchsia-500 font-light italic">
  107. Club Flux Lobby
  108. </h1>
  109. <form action="" method="">
  110. <div class="wizard-header text-center">
  111. <h3 class="wizard-title">
  112. Hush Your Money
  113. </h3>
  114. <p class="category">
  115. Spend Privately. Fearlessly!
  116. </p>
  117. </div>
  118. <div class="wizard-navigation">
  119. <div class="progress-with-circle">
  120. <div class="progress-bar" role="progressbar" aria-valuenow="1" aria-valuemin="1" aria-valuemax="3" :style="{ width: pbWidth }"></div>
  121. </div>
  122. <ul>
  123. <li :class="{ active: tabIndex === 0 }">
  124. <a href="javascript://" @click="showIdentity">
  125. <div class="icon-circle" :class="{ checked: tabIndex === 0 }">
  126. <i class="ti-user"></i>
  127. </div>
  128. Identity
  129. </a>
  130. </li>
  131. <li :class="{ active: tabIndex === 1 }">
  132. <a href="javascript://" @click="showAnalysis">
  133. <div class="icon-circle" :class="{ checked: tabIndex === 2 }">
  134. <i class="ti-receipt"></i>
  135. </div>
  136. Analysis
  137. </a>
  138. </li>
  139. <li :class="{ active: tabIndex === 2 }">
  140. <a href="javascript://" @click="showShuffler">
  141. <div class="icon-circle" :class="{ checked: tabIndex === 1 }">
  142. <i class="ti-control-shuffle"></i>
  143. </div>
  144. Shuffler
  145. </a>
  146. </li>
  147. </ul>
  148. </div>
  149. <div class="win-content">
  150. <Identity v-if="tabIndex === 0" />
  151. <Analysis v-if="tabIndex === 1" />
  152. <Shuffler v-if="tabIndex === 2" />
  153. </div>
  154. <div class="wizard-footer flex">
  155. <div class="footer-item">
  156. <input
  157. v-if="tabIndex !== 0"
  158. type="button"
  159. class="btn btn-previous btn-default btn-wd"
  160. :value="lblPrevious"
  161. @click="previous"
  162. />
  163. </div>
  164. <div class="footer-item">
  165. <input
  166. v-if="tabIndex === 2"
  167. type="button"
  168. class="btn btn-warning btn-wd"
  169. value="Options"
  170. @click="showOptions"
  171. />
  172. </div>
  173. <div class="footer-item">
  174. <input
  175. v-if="tabIndex !== 2"
  176. type="button"
  177. class="btn btn-next btn-fill btn-primary btn-wd"
  178. :value="lblNext"
  179. @click="next"
  180. />
  181. </div>
  182. </div>
  183. </form>
  184. </template>