Your Name 2 gadus atpakaļ
vecāks
revīzija
3285bb1e07
2 mainītis faili ar 33 papildinājumiem un 8 dzēšanām
  1. 14
    2
      index.html
  2. 19
    6
      src/pages/pg1/video.vue

+ 14
- 2
index.html Parādīt failu

@@ -4,6 +4,7 @@
4 4
     <meta charset="UTF-8" />
5 5
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6 6
     <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover" />
7
+    <meta name="screen-orientation" content="portrait">
7 8
     <!-- <script src="./wx/jweixin-1.6.0.js"></script> -->
8 9
     <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
9 10
     <script src="./jquery.1.9.1.js"></script>
@@ -33,12 +34,23 @@
33 34
 
34 35
       #vid-cover .goback {
35 36
         position: fixed;
36
-        right: 10px;
37 37
         top: 10px;
38 38
         width: 50px;
39 39
         height: 50px;
40
+      }
40 41
 
41
-        transform: rotate(90deg);
42
+      /* 横屏 */
43
+      @media all and (orientation : landscape) {
44
+        #vid-cover .goback {
45
+          left: 10px;
46
+        }
47
+      }
48
+      /* 竖屏 */
49
+      @media all and (orientation : portrait) {
50
+        #vid-cover .goback {
51
+          right: 10px;
52
+          transform: rotate(90deg);
53
+        }
42 54
       }
43 55
     </style>
44 56
   </head>

+ 19
- 6
src/pages/pg1/video.vue Parādīt failu

@@ -77,19 +77,33 @@ onMounted(() => {
77 77
 </script>
78 78
 
79 79
 <style lang="less" scoped>
80
+
81
+/* 横屏 */
82
+@media all and (orientation : landscape) {
83
+  .video-pg {
84
+    width: 100vw;
85
+    height: 100vh;
86
+  }
87
+}
88
+
89
+/* 竖屏 */
90
+@media all and (orientation : portrait) {
91
+  .video-pg {
92
+    width: 100vh;
93
+    height: 100vw;
94
+    transform-origin: center left;
95
+    transform: rotate(90deg) translate3d(-50vw, -50vw, 0);
96
+  }
97
+}
98
+
80 99
 .video-pg {
81 100
   position: relative;
82 101
   background-color: #000;
83 102
   overflow: hidden;
84
-  width: 100vh;
85
-  height: 100vw;
86 103
   display: flex;
87 104
   align-items: center;
88 105
   justify-content: center;
89 106
 
90
-  transform-origin: center left;
91
-  transform: rotate(90deg) translate3d(-50vw, -50vw, 0);
92
-
93 107
   .goback {
94 108
     position: fixed;
95 109
     z-index: 20001;
@@ -100,7 +114,6 @@ onMounted(() => {
100 114
   video {
101 115
     flex: none;
102 116
     width: 90%;
103
-    z-index: 90%;
104 117
   }
105 118
 }
106 119
 </style>