update nft page

This commit is contained in:
cebgcontract 2022-02-21 11:37:03 +08:00
parent 7cac69496b
commit 5f91176096
8 changed files with 154 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -1,7 +1,10 @@
<template> <template>
<section id="weapon-section" data-anchor="weapon"> <section id="chip-section" data-anchor="weapon">
<div class="section-container"> <div class="section-container">
<title-bar :title-img="require('@/assets/202202/nft/chip.png')"></title-bar> <title-bar
:title-img="require('@/assets/202202/nft/chip.png')"
@dialog-show="showInfo"
></title-bar>
<div class="nft-list"> <div class="nft-list">
<img v-for="c in datas" :key="c.name" :src="c.img" class="weapon" :alt="c.name"/> <img v-for="c in datas" :key="c.name" :src="c.img" class="weapon" :alt="c.name"/>
</div> </div>
@ -45,6 +48,11 @@ export default class extends Vue {
} }
} }
showInfo() {
console.log('show info')
this.$emit('dialog-show', true)
}
comingSoon() { comingSoon() {
Message({ Message({
message: 'coming soon', message: 'coming soon',
@ -56,7 +64,7 @@ export default class extends Vue {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
#weapon-section{ #chip-section{
box-sizing: border-box; box-sizing: border-box;
width: 1920px; width: 1920px;
position: relative; position: relative;

View File

@ -0,0 +1,103 @@
<template>
<div v-show="dialogTableVisible" class="el-dialog__wrapper" style="z-index: 2001;">
<div role="dialog" aria-modal="true" aria-label="dialog" class="nft-info" style="margin-top: 15vh;">
<div class="header">
<img class="close-btn" src="@/assets/202202/nft/close_btn.png" @click="closeMe" alt="close"/>
</div>
<div class="el-dialog__body">
<div class="title">Usage</div>
<div class="desc">
<p>Token rewards can only be obtained by</p>
<p>playing the game with hero NFT.</p>
</div>
<div class="title">Types</div>
<div class="desc">
<p>There are 10 heroes in total, and different roles</p>
<p>correspond to different original skills and attributes.</p>
</div>
<div class="title">Rarity</div>
<div class="desc">
<p>Each hero has 15 levels of rarity, you can increase rarity</p>
<p>by combining heroes of the same type.</p>
<p>Raise the rarity to obtain additional attributes and skills.</p>
</div>
<div class="title">Levels</div>
<div class="desc">
<p>Each hero can be upgraded up to level 20.</p>
<p>Heroes of the same type at different levels have</p>
<p>the same attribute types, and the higher the level,</p>
<p>the greater the value.</p>
</div>
<div class="title">Destroy</div>
<div class="desc">
<p>When merging heroes to increase their rarity, the</p>
<p>lower level heroes among them will be destroyed.</p>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
declare module 'vue/types/vue' {
interface Vue {
dialogShow: boolean
}
}
@Component({
name: 'NftInfo',
components: {},
props: ['dialogShow']
})
export default class extends Vue {
get dialogTableVisible() {
return this.dialogShow
}
set dialogTableVisible(val: boolean) {
this.dialogShow = val
}
closeMe() {
console.log('info close')
this.$emit('dialog-show', false)
}
}
</script>
<style lang="scss" scoped>
.nft-info {
background-image: url('../../assets/202202/nft/info_bg.png');
background-repeat: no-repeat;
background-position: top;
position: relative;
margin: 0 auto 50px;
margin-top: 15vh;
border-radius: 2px;
box-sizing: border-box;
width: 760px;
.header{
display: flex;
justify-content: flex-end;
padding-top: 24px;
padding-right: 24px;
.close-btn{
cursor: pointer;
}
}
.title {
color: white;
font-size: 24px;
margin-left: 84px;
}
.desc{
color: #C7C5C5;
font-size: 16px;
margin-top: 27px;
margin-left: 84px;
}
}
</style>

View File

@ -1,7 +1,10 @@
<template> <template>
<section id="nft-section" data-anchor="nft"> <section id="nft-section" data-anchor="nft">
<div class="section-container"> <div class="section-container">
<title-bar :title-img="require('@/assets/202202/nft/hero.png')"></title-bar> <title-bar
:title-img="require('@/assets/202202/nft/hero.png')"
@dialog-show="showInfo"
></title-bar>
<div class="nft-list"> <div class="nft-list">
<img v-for="c in datas" :key="c.name" :src="c.img" class="card" :alt="c.name"/> <img v-for="c in datas" :key="c.name" :src="c.img" class="card" :alt="c.name"/>
</div> </div>
@ -46,6 +49,11 @@ export default class extends Vue {
} }
} }
showInfo() {
console.log('show info')
this.$emit('dialog-show', true)
}
comingSoon() { comingSoon() {
Message({ Message({
message: 'coming soon', message: 'coming soon',

View File

@ -2,7 +2,7 @@
<div class="title"> <div class="title">
<div class="left-part"> <div class="left-part">
<img :src="titleImg" alt="hero"/> <img :src="titleImg" alt="hero"/>
<div class="desc">DESC. >></div> <div class="desc" @click="showInfo">DESC. >></div>
</div> </div>
<div class="right-part"> <div class="right-part">
<img src="@/assets/202202/nft/button-get.png" alt="got it"/> <img src="@/assets/202202/nft/button-get.png" alt="got it"/>
@ -26,7 +26,9 @@ declare module 'vue/types/vue' {
props: ['titleImg'] props: ['titleImg']
}) })
export default class extends Vue { export default class extends Vue {
showInfo() {
this.$emit('dialog-show', true)
}
} }
</script> </script>
@ -44,6 +46,7 @@ export default class extends Vue {
.desc{ .desc{
margin-bottom: -6px; margin-bottom: -6px;
margin-left: 20px; margin-left: 20px;
cursor: pointer;
} }
} }
} }

View File

@ -1,7 +1,10 @@
<template> <template>
<section id="weapon-section" data-anchor="weapon"> <section id="weapon-section" data-anchor="weapon">
<div class="section-container"> <div class="section-container">
<title-bar :title-img="require('@/assets/202202/nft/weapon.png')"></title-bar> <title-bar
:title-img="require('@/assets/202202/nft/weapon.png')"
@dialog-show="showInfo"
></title-bar>
<div class="nft-list"> <div class="nft-list">
<img v-for="c in datas" :key="c.name" :src="c.img" class="weapon" :alt="c.name"/> <img v-for="c in datas" :key="c.name" :src="c.img" class="weapon" :alt="c.name"/>
</div> </div>
@ -39,6 +42,11 @@ export default class extends Vue {
} }
} }
showInfo() {
console.log('show info')
this.$emit('dialog-show', true)
}
comingSoon() { comingSoon() {
Message({ Message({
message: 'coming soon', message: 'coming soon',

View File

@ -2,10 +2,11 @@
<div class="container" :style="cstyle"> <div class="container" :style="cstyle">
<desktop-header current-section="nft"></desktop-header> <desktop-header current-section="nft"></desktop-header>
<top-section></top-section> <top-section></top-section>
<nft-section></nft-section> <nft-section @dialog-show="infoShowStatusChange" ></nft-section>
<weapon-section></weapon-section> <weapon-section @dialog-show="infoShowStatusChange"></weapon-section>
<chip-section></chip-section> <chip-section @dialog-show="infoShowStatusChange"></chip-section>
<desktop-footer></desktop-footer> <desktop-footer></desktop-footer>
<nft-info :dialog-show="infoShow" @dialog-show="infoShowStatusChange"></nft-info>
</div> </div>
</template> </template>
@ -17,10 +18,12 @@ import TopSection from '@/components/nft/TopSection.vue'
import NftSection from '@/components/nft/NftSection.vue' import NftSection from '@/components/nft/NftSection.vue'
import WeaponSection from '@/components/nft/WeaponSection.vue' import WeaponSection from '@/components/nft/WeaponSection.vue'
import ChipSection from '@/components/nft/ChipSection.vue' import ChipSection from '@/components/nft/ChipSection.vue'
import NftInfo from '@/components/nft/NftInfo.vue'
@Component({ @Component({
name: 'Nft', name: 'Nft',
components: { components: {
NftInfo,
ChipSection, ChipSection,
WeaponSection, WeaponSection,
NftSection, NftSection,
@ -32,6 +35,8 @@ import ChipSection from '@/components/nft/ChipSection.vue'
export default class extends Vue { export default class extends Vue {
private scale = 1.0 private scale = 1.0
private initWidth = 1920 private initWidth = 1920
private infoShow = false
get cstyle() { get cstyle() {
return { return {
// transform: `scale(${this.scale})` // transform: `scale(${this.scale})`
@ -51,6 +56,15 @@ export default class extends Vue {
window.removeEventListener('resize', this.resizeHandler) window.removeEventListener('resize', this.resizeHandler)
} }
showInfo() {
this.infoShow = true
}
infoShowStatusChange(val: boolean) {
console.log('infoShowStatusChange: ', val)
this.infoShow = val
}
resizeHandler() { resizeHandler() {
const documentWidth = document.body.clientWidth const documentWidth = document.body.clientWidth
if (documentWidth < this.initWidth) { if (documentWidth < this.initWidth) {