giornata di lavoro

This commit is contained in:
Gamebrary 2022-04-14 16:27:32 -07:00
parent 1fdfa987bc
commit 90a1d38271
14 changed files with 380 additions and 46 deletions

View file

@ -1,11 +1,10 @@
<!-- TODO: fix background hex not rendering --> <!-- TODO: fix background hex not rendering -->
<template lang="html"> <template lang="html">
<div <div
class="mini-board overflow-hidden p-1 rounded cursor-pointer bg-secondary" :class="['mini-board overflow-hidden p-1 rounded cursor-pointer', { 'bg-secondary': !board.backgroundColor }]"
:style="miniBoardStyles" :style="miniBoardStyles"
@click="$emit('view-board', board.id)" @click="$emit('view-board', board.id)"
> >
<pre>{{ backgroundImage }}</pre>
<header class="text-small d-flex align-items-center"> <header class="text-small d-flex align-items-center">
<span class="mr-1">{{ board.name }}</span> <span class="mr-1">{{ board.name }}</span>
@ -53,9 +52,7 @@ export default {
computed: { computed: {
miniBoardStyles() { miniBoardStyles() {
if (this.backgroundImage) { if (this.backgroundImage) return `background-image: url(${this.backgroundImage});`
return `background-image: url(${this.backgroundImage});`;
}
return this.board?.backgroundColor return this.board?.backgroundColor
? `background-color: ${this.board.backgroundColor};` ? `background-color: ${this.board.backgroundColor};`

View file

@ -1,5 +1,4 @@
<template lang="html"> <template lang="html">
<!-- TODO: break up wikipedia description into chunks -->
<div class="game-description"> <div class="game-description">
<div v-if="loading" class="mb-4"> <div v-if="loading" class="mb-4">
<b-skeleton <b-skeleton

View file

@ -30,8 +30,8 @@
> >
<b-button <b-button
size="sm" size="sm"
variant="secondary" variant="transparent"
@click.stop="editBoard(board)" @click.stop="editBoard(board.id)"
> >
<i class="fas fa-pencil-alt fa-fw" aria-hidden /> <i class="fas fa-pencil-alt fa-fw" aria-hidden />
</b-button> </b-button>
@ -110,9 +110,8 @@ export default {
} }
}, },
editBoard(board) { editBoard(id) {
this.$store.commit('SET_ACTIVE_BOARD', board); this.$router.push({ name: 'edit-board', params: { id } });
this.$bvModal.show('edit-board');
}, },
getWallpaperUrl(url) { getWallpaperUrl(url) {

View file

@ -21,6 +21,7 @@
<script> <script>
import { marked } from 'marked'; import { marked } from 'marked';
import { mapGetters } from 'vuex';
export default { export default {
props: { props: {
@ -28,6 +29,8 @@ export default {
}, },
computed: { computed: {
...mapGetters(['gameCoverUrl']),
formattedNote() { formattedNote() {
return marked(this.note?.note || this.note); return marked(this.note?.note || this.note);
}, },

View file

@ -12,11 +12,12 @@
<i class="fas fa-arrow-left fa-fw" aria-hidden /> <i class="fas fa-arrow-left fa-fw" aria-hidden />
</b-button> </b-button>
<portal-target name="pageTitle" />
<span v-if="$route.meta.title"> <span v-if="$route.meta.title">
{{ $route.meta.title }} {{ $route.meta.title }}
</span> </span>
<portal-target v-else name="pageTitle" />
<span v-if="showBoardName"> <span v-if="showBoardName">
{{ board.name }} {{ board.name }}

View file

@ -1,14 +1,18 @@
<template lang="html"> <template lang="html">
<header class="my-3 d-flex align-items-center justify-content-between"> <header class="mb-2 d-flex align-items-center justify-content-between">
<h5 class="m-0">{{ title }}</h5> <h5 class="m-0">{{ title }}</h5>
<b-button <div v-if="$slots.default || actionText">
v-if="actionText" <slot />
variant="primary"
@click="$emit('action')" <b-button
> v-if="actionText"
{{ actionText }} variant="primary"
</b-button> @click="$emit('action')"
>
{{ actionText }}
</b-button>
</div>
</header> </header>
</template> </template>

View file

@ -10,7 +10,7 @@
<portal v-if="isBoardPage" to="headerActions"> <portal v-if="isBoardPage" to="headerActions">
<b-button <b-button
v-if="user && user.uid && user.uid === board.owner" v-if="user && user.uid && user.uid === board.owner"
variant="light" variant="primary"
class="mr-2" class="mr-2"
:to="{ name: 'edit-board', params: { id: board.id } }" :to="{ name: 'edit-board', params: { id: board.id } }"
> >

View file

@ -8,12 +8,17 @@
/> />
</portal> </portal>
<portal to="headerActions">
<b-button
variant="primary"
class="mr-2"
@click="$router.push({ name: 'create-board' })"
>
Create board
</b-button>
</portal>
<div v-if="boards.length"> <div v-if="boards.length">
Boards
<b-button @click="$router.push({ name: 'create-board' })">Create board</b-button>
<game-boards class="mb-3" /> <game-boards class="mb-3" />
</div> </div>

View file

@ -1,6 +1,6 @@
<!-- TODO: pagination? --> <!-- TODO: pagination? -->
<template lang="html"> <template lang="html">
<b-container> <b-container fluid>
<page-title <page-title
title="Notes" title="Notes"
> >

View file

@ -1,12 +1,17 @@
<template lang="html"> <template lang="html">
<b-container> <b-container fluid>
<div v-if="loading"> <div v-if="loading">
Loading... Loading...
</div> </div>
<template v-else-if="profile"> <template v-else-if="profile">
<div> <div>
<img :src="profile.profileImage" :alt="userName" class="rounded" /> <img
v-if="avatar"
:src="avatar"
:alt="userName"
class="rounded"
/>
<h2>{{ profile.userName }}</h2> <h2>{{ profile.userName }}</h2>
@ -78,6 +83,10 @@ export default {
userName() { userName() {
return this.$route.params.userName; return this.$route.params.userName;
}, },
avatar() {
return this.profile?.profilePic || this.user?.photoURL || null;
},
}, },
watch: { watch: {

View file

@ -2,6 +2,10 @@
<div class="search-page bg-white p-2"> <div class="search-page bg-white p-2">
<search-box class="d-md-none mb-2" /> <search-box class="d-md-none mb-2" />
<b-alert show variant="success">
Custom search controls go here!
</b-alert>
<b-skeleton v-if="loading" /> <b-skeleton v-if="loading" />
<b-card-group columns v-else-if="searchResults.length > 0"> <b-card-group columns v-else-if="searchResults.length > 0">

View file

@ -1,5 +1,5 @@
<template lang="html"> <template lang="html">
<div> <b-container fluid>
<stripe-checkout <stripe-checkout
ref="checkoutRef" ref="checkoutRef"
mode="subscription" mode="subscription"
@ -10,13 +10,296 @@
@loading="load" @loading="load"
/> />
<pre>{{ lineItems }}</pre>
<pre>{{ loading }}</pre>
<!-- TODO: finish UI, set loading spinner --> <!-- TODO: finish UI, set loading spinner -->
<b-card class="text-center">
<h2>Level up your video game collection!</h2>
<p class="lead-text">
Organize your video game collection with Gamebrary.
</p>
<b-button @click="planSelected = 'monthly'">Monthly</b-button> <b-button-group>
<b-button @click="planSelected = 'yearly'">Yearly</b-button> <b-button
</div> :variant="planSelected === 'monthly' ? 'info' : 'light'"
@click="planSelected = 'monthly'"
>
Monthly billing
</b-button>
<b-button
:variant="planSelected === 'yearly' ? 'info' : 'light'"
v-b-tooltip.top="'2 Months free'"
@click="planSelected = 'yearly'"
>
Yearly billing
</b-button>
</b-button-group>
<table class="table table-hover">
<thead>
<tr>
<th scope="col"></th>
<th scope="col" class="text-muted">
Gamebrary Free
<br />
<h2 class="price">
$0{{ pricingLabel }}
</h2>
</th>
<th scope="col" class="text-success">
Gamebrary Pro
<br />
<h2 class="price">
${{ `${amountToPay}${pricingLabel}` }}
</h2>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Unlimited game boards
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Search
</td>
<td class="text-muted">
Basic
</td>
<td class="text-success">
Advanced
</td>
</tr>
<tr>
<td>
Board filters
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Customizations
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Speedruns
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Steam integration
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Tags
</td>
<td>
5
</td>
<td>
Unlimited
</td>
</tr>
<tr>
<td>
Notes
</td>
<td>
Plain text
</td>
<td>
Custom notes, rich text.
</td>
</tr>
<tr>
<td>
Custom URL
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Progress tracking
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Keyboard shortcuts
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Feature
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
List sorting
</td>
<td>
Basic
</td>
<td>
Advanced
</td>
</tr>
<tr>
<td>
Multiple list views
</td>
<td>
Basic
</td>
<td>
Multiple
</td>
</tr>
<tr>
<td>
Dock
(Quickly access all your boards, pin them, organize them, group them, etc...)
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Import/Export
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Public profile
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>Shared feature</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
<tr>
<td>
Customer support
</td>
<td>
<i class="fa-solid fa-times text-muted" />
</td>
<td>
<i class="fa-solid fa-check text-success" />
</td>
</tr>
</tbody>
</table>
<b-button size="lg" variant="success" @click="checkout">
Go Pro!
</b-button>
</b-card>
<b-alert show class="mt-3">
Students and Developers get Pro for free!
</b-alert>
<b-alert show class="mt-3">
F.A.Q.
NO REFUNDS
We use stripe for payments
</b-alert>
</b-container>
</template> </template>
<script> <script>
@ -30,7 +313,7 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
planSelected: null, planSelected: 'monthly',
monthlyPlan: { monthlyPlan: {
price: 'price_1KjFY4GpsgtQXdlaWZa44Gbj', price: 'price_1KjFY4GpsgtQXdlaWZa44Gbj',
quantity: 1, quantity: 1,
@ -44,16 +327,21 @@ export default {
computed: { computed: {
lineItems() { lineItems() {
if (this.planSelected === 'monthly') return [this.monthlyPlan]; return this.planSelected === 'yearly'
if (this.planSelected === 'yearly') return [this.yearlyPlan]; ? [this.yearlyPlan]
: [this.monthlyPlan];
return [{}];
}, },
},
watch: { pricingLabel() {
planSelected() { return this.planSelected === 'yearly'
this.$refs.checkoutRef.redirectToCheckout(); ? '/year'
: '/month';
},
amountToPay() {
return this.planSelected === 'yearly'
? '50'
: '5';
}, },
}, },
@ -61,10 +349,17 @@ export default {
load(value) { load(value) {
this.loading = value; this.loading = value;
}, },
checkout() {
this.$refs.checkoutRef.redirectToCheckout();
}
}, },
}; };
</script> </script>
<style lang="scss" rel="stylesheet/scss" scoped> <style lang="scss" rel="stylesheet/scss" scoped>
.price {
font-family: 'Gochi Hand', cursive;
}
</style> </style>

View file

@ -76,16 +76,25 @@ const routes = [
name: 'account-settings', name: 'account-settings',
path: 'account', path: 'account',
component: AccountSettingsPage, component: AccountSettingsPage,
meta: {
title: "Account",
},
}, },
{ {
name: 'steam-settings', name: 'steam-settings',
path: 'steam', path: 'steam',
component: SteamSettingsPage, component: SteamSettingsPage,
meta: {
title: "Steam",
},
}, },
{ {
name: 'general-settings', name: 'general-settings',
path: '', path: '',
component: GeneralSettingsPage, component: GeneralSettingsPage,
meta: {
title: 'Settings',
}
}, },
{ {
name: 'tags-settings', name: 'tags-settings',
@ -108,7 +117,7 @@ const routes = [
path: 'notes', path: 'notes',
component: NotesPage, component: NotesPage,
meta: { meta: {
title: 'Tags', title: 'Notes',
}, },
}, },
{ {
@ -181,7 +190,7 @@ const routes = [
path: '/upgrade', path: '/upgrade',
component: UpgradePage, component: UpgradePage,
meta: { meta: {
title: 'Upgrade to PRO!', title: 'Upgrade',
}, },
}, },
{ {
@ -212,6 +221,9 @@ const routes = [
path: '/board/create', path: '/board/create',
name: 'create-board', name: 'create-board',
component: CreateBoardPage, component: CreateBoardPage,
meta: {
title: 'Create board',
}
}, },
{ {
path: '/board/:id', path: '/board/:id',
@ -260,7 +272,7 @@ const routes = [
path: '/', path: '/',
component: HomePage, component: HomePage,
meta: { meta: {
title: 'Home', title: 'Dashboard',
public: true, public: true,
}, },
}, },

View file

@ -14,6 +14,12 @@ export default {
: '/no-image.jpg'; : '/no-image.jpg';
}, },
gameCoverUrl: ({ game }) => {
return game?.cover?.image_id
? `https://images.igdb.com/igdb/image/upload/t_cover_big_2x/${game.cover.image_id}.jpg`
: '/no-image.jpg';
},
isBoardOwner: ({ board, user }) => { isBoardOwner: ({ board, user }) => {
const boardOwner = board && board.owner; const boardOwner = board && board.owner;
const userId = user && user.uid; const userId = user && user.uid;