1、新增主页布局新增主页布局

This commit is contained in:
lankuixing 2024-02-19 18:42:20 +08:00
parent e863e405a2
commit 71c1f897d8
4 changed files with 65 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 KiB

View File

@ -3,14 +3,29 @@
<div class="header-content"> <div class="header-content">
</div> </div>
<div class="body-content">
</div>
<div class="footer-content">
</div>
<div class="left-icon">
</div>
<div class="right-icon">
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "PeakCoalView", name: "PeakCoalView",
data(){ data() {
return{ return {
autoStyle: {} autoStyle: {}
} }
}, },
@ -22,14 +37,14 @@ export default {
}, false) }, false)
}, },
methods: { methods: {
getAutoStyle () { getAutoStyle() {
const { scale, origin } = this.getScale() const {scale, origin} = this.getScale()
this.autoStyle = { this.autoStyle = {
transform: `scale(${scale})`, transform: `scale(${scale})`,
transformOrigin: origin transformOrigin: origin
} }
}, },
getScale () { getScale() {
let scale = 1 let scale = 1
let origin = 'top center' let origin = 'top center'
const baseWidth = 9450 const baseWidth = 9450
@ -38,7 +53,7 @@ export default {
const innerHeight = window.innerHeight const innerHeight = window.innerHeight
const widthScale = innerWidth / baseWidth const widthScale = innerWidth / baseWidth
const scaleHeight = baseHeight * widthScale const scaleHeight = baseHeight * widthScale
console.log('scaleHeight:',scaleHeight) console.log('scaleHeight:', scaleHeight)
if (scaleHeight <= innerHeight) { if (scaleHeight <= innerHeight) {
origin = 'left top' origin = 'left top'
scale = widthScale scale = widthScale
@ -48,7 +63,7 @@ export default {
} else { } else {
scale = innerHeight / baseHeight scale = innerHeight / baseHeight
} }
return { scale, origin } return {scale, origin}
}, },
} }
} }
@ -60,26 +75,64 @@ body, html, #__nuxt, #__layout {
background-color: #000; background-color: #000;
overflow: hidden; overflow: hidden;
} }
.list-enter-active, .list-leave-active { .list-enter-active, .list-leave-active {
transition: all 0.5s; transition: all 0.5s;
} }
.list-enter, .list-leave-to .list-enter, .list-leave-to
/* .list-leave-active for below version 2.1.8 */ { /* .list-leave-active for below version 2.1.8 */
{
opacity: 0; opacity: 0;
transform: translateY(30px); transform: translateY(30px);
} }
</style> </style>
<style scoped lang="less"> <style scoped lang="less">
.peak-coal-content{ .peak-coal-content {
height: 3000px; height: 3000px;
width: 9450px; width: 9450px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
user-select: none; user-select: none;
.header-content{
.header-content {
position: absolute;
top: 0px;
height: 507px; height: 507px;
background: url("assets/peakCoalImages/header/first-title-bg.png") no-repeat; width: 100%;
background: url("assets/peakCoalImages/header/first-title-bg.png") no-repeat center center;
}
.left-icon {
position: absolute;
left: 0px;
width: 531px;
height: 100%;
background: url("assets/peakCoalImages/left/left-icon.png") no-repeat center center;
background-size: 100% 100%; background-size: 100% 100%;
} }
.right-icon {
position: absolute;
right: 0px;
width: 531px;
height: 100%;
background: url("assets/peakCoalImages/right/right-icon.png") no-repeat center center;
background-size: 100% 100%;
}
.body-content {
position: absolute;
height: 100%;
width: 100%;
}
.footer-content {
position: absolute;
bottom: 0px;
width: 100%;
height: 220px;
background: url("assets/peakCoalImages/footer/footer-bg.png") no-repeat center center;
}
} }
</style> </style>