Snapshot.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div class="com-player-snapshot">
  3. <transition
  4. appear
  5. name="custom-classes-transition"
  6. enter-active-class="animated fadeIn faster"
  7. leave-active-class="animated fadeOut faster"
  8. >
  9. <div class="flash" v-if="showFlash"></div>
  10. </transition>
  11. <div class="frame show">
  12. <div class="corner left-top"></div>
  13. <div class="corner right-top"></div>
  14. <div class="corner left-bottom"></div>
  15. <div class="corner right-bottom"></div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. showFlash:false
  24. }
  25. },
  26. mounted(){
  27. this.$bus.on('toggleFlash',data=>{
  28. this.showFlash=data
  29. })
  30. }
  31. };
  32. </script>
  33. <style lang="less" scoped>
  34. .com-player-snapshot {
  35. position: absolute;
  36. left: 0;
  37. top: 0;
  38. width: 100%;
  39. height: calc(100% - 240px);
  40. pointer-events: none;
  41. .flash {
  42. position: absolute;
  43. left: 0;
  44. top: 0;
  45. width: 100%;
  46. height: calc(100% + 240px);
  47. background-color: rgba(255, 255, 255, 0.5);
  48. }
  49. .frame {
  50. position: absolute;
  51. z-index: 100;
  52. pointer-events: none;
  53. //opacity: 0;
  54. transition: opacity 0.3s, border 0.3s;
  55. &.show {
  56. width: calc(84% - 36px);
  57. height: calc(100% - 140px);
  58. border: 1px dotted rgba(255, 255, 255, 0.8);
  59. left: calc(8% + 18px);
  60. bottom: 86px;
  61. }
  62. }
  63. .corner {
  64. width: 40px;
  65. height: 40px;
  66. position: absolute;
  67. transition: opacity 0.3s;
  68. opacity: 0.8;
  69. &.left-top {
  70. border-top: 4px solid #fff;
  71. border-left: 4px solid #fff;
  72. left: -2px;
  73. top: -2px;
  74. }
  75. &.left-bottom {
  76. border-left: 4px solid #fff;
  77. border-bottom: 4px solid #fff;
  78. left: -2px;
  79. bottom: -2px;
  80. }
  81. &.right-top {
  82. border-top: 4px solid #fff;
  83. border-right: 4px solid #fff;
  84. right: -2px;
  85. top: -2px;
  86. }
  87. &.right-bottom {
  88. border-right: 4px solid #fff;
  89. border-bottom: 4px solid #fff;
  90. right: -2px;
  91. bottom: -2px;
  92. }
  93. }
  94. }
  95. [edit-mode="mobile"] {
  96. .com-player-snapshot {
  97. .frame {
  98. position: absolute;
  99. z-index: 100;
  100. pointer-events: none;
  101. transition: opacity 0.3s, border 0.3s;
  102. &.show {
  103. width: calc(84% - 36px);
  104. height: calc(100% - 240px);
  105. border: 1px dotted rgba(255, 255, 255, 0.8);
  106. left: calc(8% + 18px);
  107. top: 86px;
  108. }
  109. }
  110. }
  111. }
  112. </style>