浏览代码

style: --

chenlei 1 年之前
父节点
当前提交
be6206dd79
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      src/pages/home/index.scss

+ 6 - 5
src/pages/home/index.scss

@@ -5,17 +5,18 @@
   right: 0;
   bottom: 0;
   overflow: hidden;
-  background: url("./images/map-min.jpg") no-repeat top left / 1920px 1080px;
+  background: url("./images/map-min.jpg") no-repeat center / cover;
 
   &__hover {
     position: absolute;
-    top: 268px;
-    left: 374px;
-    width: 586px;
-    height: 466px;
+    top: 50%;
+    left: calc(50% - calc(250px / 1920px * 100vw));
+    width: calc(586px / 1080px * 100vh);
+    height: calc(466px / 1080px * 100vh);
     cursor: pointer;
     opacity: 0;
     transition: opacity linear 0.2s;
+    transform: translate(-50%, -50%);
 
     &:hover {
       opacity: 1;