Browse Source

完善首页

dev-烟台0301
dai 3 years ago
parent
commit
8b8ff4f45d
  1. 27
      src/assets/scss/pages/yantai-index.scss
  2. 59
      src/views/components/fixed1920.vue
  3. 40
      src/views/pages/yantai-index.vue

27
src/assets/scss/pages/yantai-index.scss

@ -1,28 +1,19 @@
@import "~@/assets/scss/c/config.scss";
@import "~@/assets/scss/c/function.scss";
.g-bd {
&::before,
&::after {
.g-cnt {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
content: "";
}
&::before {
background-image: url(~@/assets/img/yantai/index/bg.png);
background-size: cover;
}
&::after {
// background-color: rgba(38, 50, 56, 0.1);
}
background-position: center;
}
.m-top {
position: fixed;
position: absolute;
top: 0;
width: 1920px;
left: -1000px;
@ -46,7 +37,7 @@
}
.m-list {
position: fixed;
position: absolute;
top: 50%;
left: 0;
right: 0;
@ -59,6 +50,7 @@
align-items: center;
width: 100%;
margin: 0 auto;
.menu {
position: relative;
@ -126,15 +118,16 @@
}
.arrow {
width: 60px;
margin: 0 20px;
}
.item {
.item-wrap {
position: relative;
margin: 0 50px;
width: 420px;
margin: 0 20px;
max-width: 612px;
.item-wrap {
text-align: center;
cursor: pointer;
transition: all 0.2s ease;

59
src/views/components/fixed1920.vue

@ -0,0 +1,59 @@
<template>
<div class="g-app">
<div class="g-bd" :style="bdStyle">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
data() {
return {
clientHeight: document.documentElement.clientHeight,
clientWidth: document.documentElement.clientWidth,
};
},
components: {},
computed: {
bdStyle() {
const { clientHeight, clientWidth } = this;
console.log("clientHeight", clientHeight);
const scale = clientWidth / 1920;
const height = clientHeight / scale;
const top = (clientHeight - height) / 2;
const left = (clientWidth - 1920) / 2;
return {
transform: `scale(${scale})`,
height: `${height}px`,
left: `${left}px`,
top: `${top}px`,
};
},
},
created() {},
mounted() {
window.onresize = () => {
this.clientHeight = document.documentElement.clientHeight;
this.clientWidth = document.documentElement.clientWidth;
};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.g-app {
position: absolute;
// width: 1920px;
width: 100%;
height: 100vh;
overflow: hidden;
}
.g-bd {
position: absolute;
width: 1920px;
}
</style>

40
src/views/pages/yantai-index.vue

@ -1,6 +1,6 @@
<template>
<div class="g-app">
<div class="g-bd" v-if="true">
<fixed1920>
<div class="g-cnt">
<div class="m-top animate__animated menu animate__fadeInDown">
<img class="logo" src="@/assets/img/yantai/index/db.png" />
<div class="name">烟台市智慧社区平台</div>
@ -46,9 +46,7 @@
</div>
</div>
<div class="arrow">
<img src="@/assets/img/yantai/index/zuo.png" />
</div>
<img class="arrow" src="@/assets/img/yantai/index/zuo.png" />
<div
class="item animate__animated animate__pulse"
@ -70,9 +68,7 @@
</div>
</div>
<div class="arrow">
<img src="@/assets/img/yantai/index/you.png" />
</div>
<img class="arrow" src="@/assets/img/yantai/index/you.png" />
<div class="menu animate__animated menu animate__fadeInRight">
<img
@ -137,17 +133,12 @@
</div>
</div>
</div>
</div>
</fixed1920>
</template>
<script>
import Cookies from "js-cookie";
import debounce from "lodash/debounce";
import { messages } from "@/i18n";
import { getUUID } from "@/utils";
import { Loading } from "element-ui"; // Loading
import JSEncrypt from "jsencrypt"; //
import fixed1920 from "@/views/components/fixed1920.vue";
let loading; //
export default {
data() {
return {
@ -156,8 +147,23 @@ export default {
i18nMessages: messages,
};
},
components: {},
computed: {},
components: { fixed1920 },
computed: {
bdStyle() {
console.log("clientHeight", document.documentElement.clientHeight);
const scale = document.documentElement.clientWidth / 1920;
const height = document.documentElement.clientHeight / scale;
const top = (document.documentElement.clientHeight - height) / 2;
const left = (document.documentElement.clientWidth - 1920) / 2;
return {
transform: `scale(${scale})`,
height: `${height}px`,
left: `${left}px`,
top: `${top}px`,
};
},
},
created() {},
mounted() {},

Loading…
Cancel
Save