Tips.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <transition
  3. appear
  4. name="custom-classes-transition"
  5. enter-active-class="animated fadeIn faster"
  6. leave-active-class="animated fadeOut faster"
  7. >
  8. <popup v-if="show" :is-pass="true">
  9. <div class="ui-message-tips">
  10. <!-- <img class="ui-bg" :src="require(`@/assets/images/project/icon/tips.png`)" alt=""> -->
  11. <div class="brightness"></div>
  12. <span v-html="content"></span>
  13. </div>
  14. </popup>
  15. </transition>
  16. </template>
  17. <script>
  18. import Popup from "./popup";
  19. export default {
  20. name: "ui-tips",
  21. components: {
  22. Popup
  23. },
  24. data() {
  25. return {
  26. show: false,
  27. duration: 2000,
  28. content: ""
  29. };
  30. },
  31. mounted() {
  32. setTimeout(() => {
  33. this.show = false;
  34. this.$nextTick(function() {
  35. document.body.removeChild(this.$el);
  36. this.$destroy(true);
  37. });
  38. }, this.duration);
  39. }
  40. };
  41. </script>
  42. <style lang="less" scoped>
  43. .ui-message-tips {
  44. position: absolute;
  45. left: 50%;
  46. top: 50%;
  47. color: #fff;
  48. padding: 20px 50px;
  49. transform: translate(-50%, -50%);
  50. border-radius: 10px;
  51. overflow: hidden;
  52. text-align: center;
  53. pointer-events: none;
  54. width: 402px;
  55. height: 132px;
  56. background: linear-gradient(180deg, rgba(166,192,232,0.4) 0%, rgba(16,25,38,0.7) 3%, #171F2A 39%, rgba(19,28,40,0.85) 39%, rgba(54,58,64,0.91) 85%, rgba(80,81,83,0.47) 99%, rgba(230,236,245,0.14) 100%);
  57. box-shadow: inset 0px 2px 2px 1px rgba(255,255,255,0.4);
  58. opacity: 1;
  59. backdrop-filter: blur(10px);
  60. .ui-bg{
  61. width: 100%;
  62. position: absolute;
  63. top: 50%;
  64. left: 50%;
  65. transform: translate(-50%,-50%);
  66. width: 100%;
  67. }
  68. .brightness{
  69. width: 100%;
  70. height: 100%;
  71. &::before{
  72. content: '';
  73. backdrop-filter: blur(20px) brightness(90%);
  74. }
  75. }
  76. >span{
  77. font-size: 26px;
  78. letter-spacing: 2px;
  79. position: absolute;
  80. left: 50%;
  81. top: 50%;
  82. transform: translate(-50%,-50%);
  83. display: inline-block;
  84. width: 100%;
  85. }
  86. }
  87. @media screen and (max-width: 600px) {
  88. .ui-message-tips {
  89. max-width: 80%;
  90. .ui-bg{
  91. width: 100%;
  92. height: 100%;
  93. position: absolute;
  94. top: 50%;
  95. left: 50%;
  96. transform: translate(-50%,-50%);
  97. width: 100%;
  98. }
  99. }
  100. }
  101. </style>