open-box.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="open-box">
  3. <div class="background"></div>
  4. <!-- 开奖页 -->
  5. <div class="content">
  6. <img :src="state.open_box.icon" alt="" class="popIn" />
  7. <div class="mark">
  8. <p>You Win</p>
  9. <div class="money">${{ state.open_box.data.usdAmountValue }}</div>
  10. <div class="mark2">
  11. <img :src="state.open_box.data.currencyIcon" alt="" />
  12. <div>{{ state.open_box.data.amountValue }} {{ state.open_box.data.currencySymbol }} stored in your
  13. DeNet
  14. account
  15. </div>
  16. </div>
  17. </div>
  18. <v-btn :txt="'OK'" :font-size="'16px'" class="btn" :icon="false" @onClick="clickBtn"></v-btn>
  19. </div>
  20. </div>
  21. </template>
  22. <script setup>
  23. import { inject } from 'vue'
  24. import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
  25. let state = inject('state')
  26. const clickBtn = () => {
  27. state.open_box.show = false
  28. state.open_box.clicked = true
  29. state.init()
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .open-box {
  34. position: fixed;
  35. left: 0;
  36. top: 0;
  37. z-index: 999;
  38. .background {
  39. background: #000000;
  40. opacity: .9;
  41. position: fixed;
  42. width: 100%;
  43. height: 100%;
  44. }
  45. .content {
  46. z-index: 2;
  47. width: 375px;
  48. height: 500px;
  49. text-align: center;
  50. position: relative;
  51. .popIn {
  52. -webkit-animation: fadeleftIn .4s;
  53. animation: fadeleftIn .4s;
  54. -webkit-animation-name: popIn;
  55. animation-name: popIn;
  56. }
  57. img {
  58. margin-top: 15px;
  59. width: 250px;
  60. height: 250px;
  61. animation: show 0.5s;
  62. }
  63. .mark {
  64. position: absolute;
  65. top: 246px;
  66. width: 375px;
  67. p {
  68. margin: 0;
  69. padding: 0;
  70. text-align: center;
  71. }
  72. p:nth-child(1) {
  73. margin-bottom: 10px;
  74. color: #FFFFFF;
  75. font-weight: 800;
  76. font-size: 18px;
  77. }
  78. .txt {
  79. color: #FFC83A;
  80. font-weight: 800;
  81. font-size: 24px;
  82. }
  83. .money {
  84. color: #FFC83A;
  85. font-weight: 800;
  86. font-size: 34px;
  87. }
  88. .mark2 {
  89. margin-top: 10px;
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. img {
  94. width: 17px;
  95. height: 17px;
  96. margin: 0;
  97. margin-right: 5px;
  98. }
  99. div {
  100. color: #A9A49F;
  101. font-weight: 400;
  102. font-size: 12px;
  103. }
  104. }
  105. }
  106. .btn {
  107. position: absolute;
  108. bottom: 25px;
  109. left: 15px;
  110. }
  111. }
  112. }
  113. @keyframes popIn {
  114. 0% {
  115. -webkit-transform: scale3d(0, 0, 0);
  116. transform: scale3d(0.5, 0.5, 0.5);
  117. opacity: 0;
  118. }
  119. 50% {
  120. -webkit-animation-timing-function: cubic-bezier(0.47, 0, 0.745, 0.715);
  121. animation-timing-function: cubic-bezier(0.47, 0, 0.745, 0.715);
  122. }
  123. 100% {
  124. -webkit-transform: scale3d(1, 1, 1);
  125. transform: scale3d(1, 1, 1);
  126. -webkit-animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  127. animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  128. opacity: 1;
  129. }
  130. }
  131. </style>