增加页面根据分辨率缩放的功能, 增加登陆和退出的功能
This commit is contained in:
parent
2245d016db
commit
435bc391ec
@ -11,9 +11,12 @@
|
||||
<li @click="comingSoon">Roadmap</li>
|
||||
</ul>
|
||||
<div class="right-part">
|
||||
<div class="login-btn">
|
||||
<div class="login-btn" v-if="!accountId" @click="collectToWallet">
|
||||
<img src="@/assets/202202/loginbutton@2x.png" alt="login"/>
|
||||
</div>
|
||||
<div class="login-btn" v-if="accountId" @click="disconnectWallet">
|
||||
Logout
|
||||
</div>
|
||||
<div class="market-btn" @click="comingSoon">
|
||||
<img src="@/assets/202202/btn-market@2x.png" alt="marketplace"/>
|
||||
</div>
|
||||
@ -131,6 +134,7 @@ export default class extends Vue {
|
||||
gap: 44px;
|
||||
.login-btn{
|
||||
cursor: pointer;
|
||||
color: #5B5B5B;
|
||||
}
|
||||
.market-btn{
|
||||
cursor: pointer;
|
||||
|
@ -30,10 +30,33 @@ import HeroSection from '@/components/index/HeroSection.vue'
|
||||
}
|
||||
})
|
||||
export default class extends Vue {
|
||||
private scale = 1
|
||||
private scale = 1.0
|
||||
private initWidth = 1920
|
||||
get cstyle() {
|
||||
return {
|
||||
transform: `scale(${this.scale})`
|
||||
// transform: `scale(${this.scale})`
|
||||
zoom: this.scale
|
||||
}
|
||||
}
|
||||
|
||||
beforeMount() {
|
||||
window.addEventListener('resize', this.resizeHandler)
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.resizeHandler()
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.resizeHandler)
|
||||
}
|
||||
|
||||
resizeHandler() {
|
||||
const documentWidth = document.body.clientWidth
|
||||
if (documentWidth < this.initWidth) {
|
||||
this.scale = documentWidth / this.initWidth
|
||||
} else {
|
||||
this.scale = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user