New Landing and Dashboard

This commit is contained in:
Bytetrex 2021-04-07 16:54:38 +08:00
parent 039987aacd
commit 85c098ee78

View file

@ -1,143 +1,170 @@
<template> <template>
<main> <div id="home">
<div class="columns is-centered section" v-if="$store.state.user.username"> <section class="section" v-if="$store.state.user.username">
<div class="column is-4 has-text-centered"> <div class="columns is-centered">
<h1 class="title has-text-centered">{{$store.state.user.username}}</h1> <div class="column is-3">
<div class="box"> <div class="title">
<img :src="'https://cdn.kaverti.com/user/avatars/full/' + $store.state.user.avatar + '.png'" :alt="$store.state.user.username + '\'s avatar'" width="50%"> {{ $store.state.user.username }}
</div> </div>
<h1 class="title">{{$t('home.news')}}</h1> <div class="box">
<div v-if="blogs.length"> <img :src="'https://cdn.kaverti.com/user/avatars/full/' + $store.state.user.avatar + '.png'" alt="Avatar" width="50%">
<div class="box" v-for='(blog) in blogs' :key='"blog-" + blog.id'> </div>
<h2 class="subtitle">{{blog.name}}</h2> <div class="title">
<p>{{blog.plainText}}</p> {{ $t('home.news') }}
</div>
<div v-if="blogs.length">
<div class="box" v-for='(blog) in blogs' :key='"blog-" + blog.id'>
<div class="subtitle">
{{ blog.name }}
</div>
<p>{{ blog.plainText }}</p>
</div>
</div>
<div v-else>
<div class="box">
<NoItems type="blog posts"></NoItems>
</div>
</div> </div>
</div> </div>
<div v-if="!blogs.length" class="box"> <div class="column is-7" v-if="!loading">
<NoItems type="blog posts"></NoItems> <div class="box">
</div> <div class="title">
</div> {{ $t('home.globalWall') }}
<div class="column has-text-centered is-vcentered" v-if="!loading"> </div>
<h1 class="title">{{$t('home.globalWall')}}</h1> <b-input type="textarea" maxlength="256" placeholder="How's it going?" v-model="wallText"></b-input>
<div class=""> <b-tag type="is-info" class="is-pulled-right">
<b-input placeholder="What's up?" v-model="wallText" maxlength="256" type="textarea"></b-input> Markdown is no longer available on wall posts.
<b-tag> </b-tag>
Markdown is no longer available on wall posts. <b-button type="is-info" ckass="is-pulled-left" :loading="loadingWallButton" @click="postWall">Post</b-button>
</b-tag> </div>
<b-button :loading="loadingWallButton" @click="postWall()" class="is-info" style="float: left">Post</b-button> <hr>
<br><hr>
<div class="box" v-for='(post) in wallPosts' :key='"wallPosts-" + post.id'> <div class="box" v-for='(post) in wallPosts' :key='"wallPosts-" + post.id'>
<article class="media"> <article class="media">
<figure class="media-left"> <figure class="media-left">
<p class="image is-64x64"> <figure class="image is-64x64 is-rounded">
<img :src="'https://cdn.kaverti.com/user/avatars/headshot/' + post.fromUser.picture + '.png'"> <img :src="'https://cdn.kaverti.com/user/avatars/headshot/' + post.fromUser.picture + '.png'" alt="Avatar">
</p> </figure>
</figure> </figure>
<div class="media-content"> <div class="media-content">
<div class="content"> <div class="content">
<p> <p>
<strong>{{post.fromUser.username}}</strong> <small>{{ post.createdAt | formatDate() }}</small> <strong>{{ post.fromUser.username }}</strong>
<small>{{ post.createdAt | formatDate() }}</small>
<br> <br>
{{post.plainText}} {{ post.plainText }}
</p> </p>
</div> </div>
</div> </div>
<div class="media-right"> <div class="media-right">
<b-tooltip label="Delete"> <b-tooltip label="Delete" v-if="$store.state.user.admin">
<button class="delete"></button> <b-button class="delete"></b-button>
</b-tooltip> </b-tooltip>
</div> </div>
</article> </article>
</div> </div>
</div> </div>
</div> </div>
</div> </section>
<div v-if="!$store.state.user.username"> <section class="section hero is-info is-large is-fullheight-with-navbar" v-if="!store.state.user.username">
<section class="hero is-info is-large is-fullheight-with-navbar" style="overflow: auto"> <div class="hero-body">
<div class="hero-body"> <div class="container has-text-centered">
<div class="container has-text-centered"> <div class="title">
<h1 class="title"> Kaverti
Kaverti </div>
</h1> <div class="subtitle">
<h2 class="subtitle"> Kaverti is a new 3D sandbox gaming platform, and avatar social website.
Kaverti is a new 3D sandbox gaming platform, and avatar social website. <br>
<br /> Kaverti is home to hundreds of users who enjoy using it
Kaverti is home to hundreds of users who enjoy using it <br>
<br /> So why not sign up today!
So why not sign up today!
</h2>
</div> </div>
</div> </div>
</section> </div>
<section class="hero is-medium" style="overflow: auto"> </section>
<div class="hero-body"> <section class="section hero is-white is-medium" v-if="!store.state.user.username">
<div class="container has-text-centered"> <div class="hero-body">
<h1 class="title"> <div class="container has-text-centered">
The stats: <div class="title">
</h1> Statistics
<h2 class="subtitle"> </div>
<div class="columns is-centered"> <div class="columns is-centered">
<div class="column is-vcentered has-text-centered"> <div class="column has-text-centered">
<h1 class="title">{{$t('stats.users')}}</h1> <div class="title">{{ $t('stats.users') }}</div>
<div class="box"> <div class="box">
<h1 class="title" v-if="!loading"> <div class="title" v-if="!loading">
{{users}} {{ users }}
</h1>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column is-vcentered has-text-centered">
<h1 class="title">{{$t('stats.posts')}}</h1>
<div class="box">
<h1 class="title" v-if="!loading">
{{posts}}
</h1>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column is-vcentered has-text-centered">
<h1 class="title">{{$t('stats.purchased')}}</h1>
<div class="box">
<h1 class="title" v-if="!loading">
{{inventory}}
</h1>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column is-vcentered has-text-centered">
<h1 class="title">{{$t('stats.teams')}}</h1>
<div class="box">
<h1 class="title" v-if="!loading">
{{teams}}
</h1>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column is-vcentered has-text-centered">
<h1 class="title">{{$t('stats.items')}}</h1>
<div class="box">
<h1 class="title" v-if="!loading">
{{items}}
</h1>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column is-vcentered has-text-centered">
<h1 class="title">{{$t('stats.threads')}}</h1>
<div class="box">
<h1 class="title" v-if="!loading">
{{threads}}
</h1>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div> </div>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div> </div>
</h2> </div>
<div class="column has-text-centered">
<div class="title">{{ $t('stats.users') }}</div>
<div class="box">
<div class="title" v-if="!loading">
{{ users }}
</div>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column has-text-centered">
<div class="title">{{ $t('stats.posts') }}</div>
<div class="box">
<div class="title" v-if="!loading">
{{ posts }}
</div>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column has-text-centered">
<div class="title">{{ $t('stats.users') }}</div>
<div class="box">
<div class="title" v-if="!loading">
{{ users }}
</div>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column has-text-centered">
<div class="title">{{ $t('stats.purchased') }}</div>
<div class="box">
<div class="title" v-if="!loading">
{{ inventory }}
</div>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column has-text-centered">
<div class="title">{{ $t('stats.items') }}</div>
<div class="box">
<div class="title" v-if="!loading">
{{ items }}
</div>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column has-text-centered">
<div class="title">{{ $t('stats.teams') }}</div>
<div class="box">
<div class="title" v-if="!loading">
{{ teams }}
</div>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
<div class="column has-text-centered">
<div class="title">{{ $t('stats.threads') }}</div>
<div class="box">
<div class="title" v-if="!loading">
{{ threads }}
</div>
<b-skeleton size="is-large" :active="loading" :count="2"></b-skeleton>
</div>
</div>
</div> </div>
</div> </div>
</section> </div>
</div> </section>
</main> </div>
</template> </template>
<script> <script>