Skip to content

Commit

Permalink
Merge pull request #2412 from roiLeo/feature/landing/rework
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwao authored Feb 21, 2022
2 parents b434739 + d95c04a commit d02a4f3
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 56 deletions.
8 changes: 8 additions & 0 deletions components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,18 @@ export default class Footer extends Vue {
name: i18n.t('About'),
url: '/about',
},
{
name: i18n.t('Documentation'),
url: 'https://docs.kodadot.xyz/',
},
{
name: i18n.t('FAQ'),
url: '/rmrk/faq',
},
{
name: i18n.t('Grant'),
url: 'https://tally.so/r/mVP06w',
},
// {
// name: i18n.t('Contact'),
// url: '/contact'
Expand Down
64 changes: 10 additions & 54 deletions components/landing/Landing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,16 @@
alt="First NFT market explorer on Kusama and Polkadot"
class="mb-5"
height="60" />
<h2
<h3
class="title is-1 is-flex is-flex-direction-column uppercase homepage__heading">
<span> Carbon neutral </span>
<span class="text__stroked"> Kusama native </span>
<span> NFT plaftorm </span>
<span class="text__stroked my-5">
Discover, collect and sell Kusama NFTs
</span>
<span class="title is-6 homepage__subtitle uppercase text-semibold">
Built on
<span class="text-bold text-primary"> {{ buildOn }} </span>
</span>
</h2>
<div class="buttons">
<b-button
tag="nuxt-link"
:to="`/${prefix}/collections`"
type="is-primary">
Collections
</b-button>
<b-button
tag="nuxt-link"
:to="`/${prefix}/gallery`"
type="is-primary">
Gallery
</b-button>
<b-button tag="nuxt-link" to="/spotlight" type="is-primary">
Spotlight
</b-button>
<b-button tag="nuxt-link" to="/series-insight" type="is-primary">
Series
</b-button>
</div>
<div class="buttons">
<b-button tag="nuxt-link" to="/about" type="is-primary">
About
</b-button>
<b-button
tag="a"
href="https://docs.kodadot.xyz"
target="_blank"
rel="noopener noreferrer"
type="is-primary">
Documentation
</b-button>
<b-button tag="nuxt-link" to="/rmrk/faq" type="is-primary">
Faq
</b-button>
<b-button
tag="a"
href="https://tally.so/r/mVP06w"
target="_blank"
rel="noopener noreferrer"
type="is-primary">
Grants
</b-button>
</div>
</div>
<div
class="column has-text-right has-text-left-mobile discord-container">
</h3>
<a
href="https://discord.gg/35hzy2dXXh"
target="_blank"
Expand All @@ -74,9 +27,11 @@
alt="Discord" />
</a>
</div>
<div class="column">
<CuratedList />
</div>
</div>

<div v-if="prefix === 'rmrk'">
<div>
<LatestSales class="my-5" />
<NewestList class="my-5" />
</div>
Expand All @@ -90,6 +45,7 @@ import { Component, Prop, Vue } from 'nuxt-property-decorator'
const components = {
LatestSales: () => import('@/components/rmrk/Gallery/LatestSales.vue'),
NewestList: () => import('@/components/rmrk/Gallery/NewestList.vue'),
CuratedList: () => import('@/components/rmrk/Gallery/CuratedList.vue'),
}
@Component<Landing>({
components,
Expand Down
128 changes: 128 additions & 0 deletions components/rmrk/Gallery/CuratedList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<template>
<section class="curated-list">
<b-carousel
:autoplay="false"
:has-drag="true"
:indicator="true"
:indicator-background="false"
:indicator-inside="false"
indicator-mode="click"
indicator-position="is-bottom"
indicator-style="is-lines">
<b-carousel-item v-for="(collection, i) in collections" :key="i">
<b-image class="image" :src="collection.image"></b-image>
<div class="box">
<div class="content has-text-left">
<nuxt-link
:to="{
name: 'rmrk-collection-id',
params: { id: collection.id },
}">
<h2 class="title is-5">{{ collection.name }}</h2>
</nuxt-link>
<nuxt-link
:to="{ name: 'rmrk-u-id', params: { id: collection.issuer } }">
<div class="is-size-7 icon-text">
<b-icon icon="palette" />
<Identity
:address="collection.issuer"
inline
noOwerlow
class="force-clip is-ellipsis" />
</div>
</nuxt-link>
</div>
</div>
</b-carousel-item>
</b-carousel>
</section>
</template>

<script lang="ts">
import { Component, mixins } from 'nuxt-property-decorator'
import AuthMixin from '@/utils/mixins/authMixin'
import {
getCloudflareImageLinks,
getProperImageLink,
} from '~/utils/cachingStrategy'
import collectionCuratedList from '@/queries/rmrk/subsquid/collectionCuratedList.graphql'
const components = {
// Identicon: () => import('@polkadot/vue-identicon'),
Identity: () => import('@/components/shared/format/Identity.vue'),
}
const curatedCollection = [
'800f8a914281765a7d-KITTY', // Kitty
'2075be44ea4b9e422d-🐺', // WolfAngryClub
'160a6f4320f11acb25-LCKWV', // PixelBabe
'7472058104f9f93924-KSMRAI', // Kusamurais (substraknights)
'7cf9daa38281a57331-BSS', // Spaceships (ClownWorldHouse)
]
@Component<CuratedList>({
components,
})
export default class CuratedList extends mixins(AuthMixin) {
private collections: [] = []
async fetch() {
const result = await this.$apollo
.query<any>({
query: collectionCuratedList,
client: 'subsquid',
variables: {
list: curatedCollection,
},
})
.catch((e) => {
console.error(e)
return { data: null }
})
if (result.data) {
await this.handleResult(result)
}
}
protected async handleResult({ data }: any) {
const images = await getCloudflareImageLinks(
data.collectionEntities.map((e: any) => e.meta.id)
)
const imageOf = getProperImageLink(images)
this.collections = data.collectionEntities.map((e: any) => ({
...e,
image: imageOf(e.meta.id, e.meta.image),
}))
}
}
</script>

<style lang="scss">
.curated-list {
.carousel,
.carousel-item {
max-height: 500px;
border-radius: 4px;
}
.carousel-indicator {
justify-content: left;
.indicator-style.is-lines {
height: 18px !important;
width: 42px !important;
background-color: #c4c4c4;
border: inherit;
}
}
.box {
position: absolute;
border-radius: 4px;
background-color: rgba(9, 9, 9, 0.77);
width: 40%;
bottom: 2%;
right: 2%;
}
}
</style>
4 changes: 2 additions & 2 deletions components/rmrk/Gallery/LatestSales.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class LatestSales extends Vue {
return false
}
async mounted() {
async fetch() {
const result = await this.$apollo
.query<{
events: { meta; nft: { meta: { id; image } } }
Expand All @@ -67,7 +67,7 @@ export default class LatestSales extends Vue {
})
if (result.data) {
this.handleResult(result)
await this.handleResult(result)
}
}
Expand Down
12 changes: 12 additions & 0 deletions queries/rmrk/subsquid/collectionCuratedList.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
query collectionCuratedList($list: [ID!]) {
collectionEntities(where: { id_in: $list }) {
id
issuer
name
meta {
id
name
image
}
}
}

0 comments on commit d02a4f3

Please sign in to comment.