shaogen1995 2 ay önce
ebeveyn
işleme
bc92f5213a

+ 2 - 2
public/index.html

@@ -45,7 +45,7 @@
 
   <script src="./krpano.js"></script>
 
-  <script>
+  <!-- <script>
     window.onload = function () {
       var script = document.createElement('script')
       script.src = 'https://cdn.bootcss.com/eruda/1.5.4/eruda.min.js'
@@ -54,5 +54,5 @@
         eruda.init()
       }
     }
-  </script>
+  </script> -->
 </html>

+ 19 - 18
src/App.tsx

@@ -110,27 +110,28 @@ export default function App() {
     } else {
       if (tempMax - height > 100) return
 
+      
+
       // 竖屏
       isHHTemp = false
       const temp = width
-      const wjwjScene = document.getElementById('wjwjScene') as HTMLIFrameElement
-      const panoramic = document.getElementById('panoramic') as HTMLIFrameElement
-      const A7Poem = document.getElementById('A7Poem') as HTMLIFrameElement
-
-      wjwjScene.style.width = height + 'px'
-      wjwjScene.style.height = temp + 'px'
-      wjwjScene.style.transform = 'rotate(90deg) translate(-50%, -50%)'
-      wjwjScene.style.transformOrigin = 'left top'
-
-      panoramic.style.width = height + 'px'
-      panoramic.style.height = temp + 'px'
-      panoramic.style.transform = 'rotate(90deg) translate(-50%, -50%)'
-      panoramic.style.transformOrigin = 'left top'
-
-      A7Poem.style.width = height + 'px'
-      A7Poem.style.height = temp + 'px'
-      A7Poem.style.transform = 'rotate(90deg) translate(-50%, -50%)'
-      A7Poem.style.transformOrigin = 'left top'
+  
+     // 用来大场景调整样式
+      const styleStr = `
+    #pageIframe #wjwjScene,
+    #pageIframe #panoramic,
+    #pageIframe #A7Poem {
+      width: ${height}px;
+      height: ${temp}px;
+      transform: rotate(90deg) translate(-50%, -50%);
+      transform-origin: left top;
+            }
+      `
+      const styletDom = document.createElement('style')
+      styletDom.type = 'text/css'
+      styletDom.id = 'myStyle'
+      styletDom.innerHTML = styleStr
+      document.querySelector('html')?.appendChild(styletDom)
 
       width = height
       height = temp

+ 12 - 9
src/pages/A7wjwj/conponents/Content/index.tsx

@@ -31,25 +31,28 @@ function Content() {
       setIsShowScene(false)
       setIsShowPano(false)
       panoramicRoot.style.display = 'none'
-      // window.location.replace('#/wjwj')
+      window.location.replace('#/wjwj')
     }
   }
   const onClickSkip = () => {
     setIsShowPoem(false)
     setIsShowScene(true)
   }
+
   return (
-    <div className={styles.content}>
+    <div className={styles.content} id='pageIframe'>
       <div id='A7Back' onClick={() => onClickBack()}>
         <img src='./myData/img/btn_back.png' alt='' />
       </div>
 
-      <iframe
-        style={{ display: isShowPano ? 'block' : 'none' }}
-        title='panoramic'
-        id='panoramic'
-        src={'Pano/index.html'}
-      />
+      {isShowPano ? (
+        <iframe
+          style={{ display: isShowPano ? 'block' : 'none' }}
+          title='panoramic'
+          id='panoramic'
+          src='Pano/index.html'
+        />
+      ) : null}
 
       <div className='poem' id='A7Poem' style={{ display: isShowPoem ? 'flex' : 'none' }}>
         <div className='skip' onClick={() => onClickSkip()}>
@@ -73,7 +76,7 @@ function Content() {
           style={{ display: isShowScene ? 'block' : 'none' }}
           id='wjwjScene'
           title='wjwjScene'
-          src={'BigScene/index.html#/?m=SG-Oy6fyzoMQ0D'}
+          src='BigScene/index.html#/?m=SG-Oy6fyzoMQ0D'
         />
       ) : null}
     </div>

+ 3 - 2
src/pages/A7wjwj/conponents/Discover/index.module.scss

@@ -387,8 +387,9 @@
         .btn {
           font-size: 14px;
         }
-        .btnContainer{
-          .icon{
+
+        .btnContainer {
+          .icon {
             width: 20px;
             height: 20px;
             position: relative;