rotate-tip.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="rotate-tip" >
  3. <view class="tip" >
  4. <view class="icon" >
  5. <img class="arrow arrow-ani" :src="staticImg.rotateArrow" alt="">
  6. <img class="phone phone-ani" :src="staticImg.phone" alt="">
  7. </view>
  8. <view class="desc" >
  9. 为了更好的体验,请使用竖屏浏览
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script setup lang="ts" >
  15. import { useStaticImg } from '@/hooks/index'
  16. const staticImg = useStaticImg()
  17. </script>
  18. <style lang="less">
  19. .rotate-tip {
  20. width: 100vw;
  21. height: 100vh;
  22. background-color: rgba(0, 0, 0, 0.6);
  23. position: fixed;
  24. top: 0;
  25. left: 0;
  26. z-index: 10000;
  27. display: flex;
  28. justify-content: center;
  29. align-items: center;
  30. .tip {
  31. display: flex;
  32. flex-direction: column;
  33. justify-content: center;
  34. align-items: center;
  35. .icon {
  36. width: 144px;
  37. height: 144px;
  38. position: relative;
  39. .arrow {
  40. width: 144px;
  41. height: 144px;
  42. position: absolute;
  43. top: 50%;
  44. left: 50%;
  45. transform: translate(-50%, -50%);
  46. transform-origin: 0% 0%;
  47. }
  48. .phone {
  49. width: 144px;
  50. height: 144px;
  51. position: absolute;
  52. top: 50%;
  53. left: 50%;
  54. transform: translate(-50%, -50%);
  55. rotate: 90deg;
  56. transform-origin: 0% 0%;
  57. }
  58. .arrow-ani {
  59. animation: arrow-ani-keyframes 3s ease-in 0s infinite;
  60. }
  61. .phone-ani {
  62. animation: phone-ani-keyframes 3s ease-in 0s infinite;
  63. }
  64. }
  65. .desc {
  66. font-size: 16px;
  67. font-family: PingFang SC-Regular, PingFang SC;
  68. font-weight: 400;
  69. color: #FFFFFF;
  70. line-height: 22px;
  71. }
  72. }
  73. }
  74. @keyframes arrow-ani-keyframes {
  75. 0% {
  76. rotate: 0deg;
  77. opacity: 1;
  78. }
  79. 25% {
  80. rotate: -90deg;
  81. opacity: 0;
  82. }
  83. 100% {
  84. rotate: -90deg;
  85. opacity: 0;
  86. }
  87. }
  88. @keyframes phone-ani-keyframes {
  89. 0% {
  90. rotate: 90deg;
  91. }
  92. 25% {
  93. rotate: 90deg;
  94. }
  95. 50% {
  96. rotate: 0deg;
  97. }
  98. 100% {
  99. rotate: 0deg;
  100. }
  101. }
  102. </style>