Skip to content

Commit

Permalink
Merge pull request #232 from HarmlessKey/feature/legacy_tier
Browse files Browse the repository at this point in the history
Patreon Tiers Update
  • Loading branch information
Lakeyzer authored May 15, 2024
2 parents 782620e + 290ac85 commit c42623b
Show file tree
Hide file tree
Showing 31 changed files with 1,405 additions and 1,198 deletions.
418 changes: 223 additions & 195 deletions src/components/Admin/User.vue

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions src/components/ContentSideRight.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<div class="content-side">
<Tutorial v-if="show_tutorial" vertical />


<hk-card v-if="$route.path.startsWith('/content/players')">
<div class="card-header" slot="header">
<span>
Expand All @@ -14,7 +13,7 @@
<p>
Sync your player's character sheets from other resources in
<span class="whitespace-nowrap">Shieldmaiden</span
><span v-if="tier.name === 'Free'" class="neutral-3"> *</span>.
><span v-if="tier.price === 'Free'" class="neutral-3"> *</span>.
</p>

<button
Expand All @@ -30,7 +29,7 @@
</button>
</div>
<small
v-if="tier.name === 'Free'"
v-if="tier.price === 'Free'"
slot="footer"
class="card-footer justify-content-start neutral-3"
>* <router-link to="/patreon" class="mx-1">Subscription</router-link> for Shieldmaiden
Expand Down Expand Up @@ -92,7 +91,7 @@
</div>
<div slot="footer" v-if="tier.name !== 'Deity'">
<router-link to="/patreon" class="btn btn-block btn-square bg-patreon-red">
Upgrade
{{ tier.price === "Free" ? "Subscribe" : "Upgrade" }}
</router-link>
</div>
</hk-card>
Expand All @@ -117,7 +116,7 @@
target="_blank"
>
Checkout HBC <hk-icon icon="fas fa-external-link" class="ml-2" />
</a>
</a>
</div>
</hk-card>

Expand Down Expand Up @@ -194,7 +193,7 @@ export default {
name: "Facebook",
icon: "fab fa-facebook-f",
url: "https://www.facebook.com/shieldmaidenapp",
}
},
],
};
},
Expand Down
6 changes: 6 additions & 0 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
></q-item-section>
<q-item-section>Profile</q-item-section>
</q-item>
<q-item clickable v-close-popup to="/patreon">
<q-item-section avatar
><i aria-hidden="true" class="fas fa-coins"></i
></q-item-section>
<q-item-section>Subscription</q-item-section>
</q-item>
<q-item clickable v-close-popup to="/content">
<q-item-section avatar
><i aria-hidden="true" class="fas fa-treasure-chest"></i
Expand Down
21 changes: 19 additions & 2 deletions src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,24 @@
</q-list>
<hr />
</template>

<q-list @click="setSideSmallScreen(false)">
<q-item clickable to="/patreon">
<q-item-section avatar>
<i aria-hidden="true" class="fas fa-coins" />
</q-item-section>
<q-item-section>
<q-btn no-caps color="primary" to="/patreon" class="full-width"> Subscription </q-btn>
</q-item-section>
<q-tooltip
v-if="$store.getters.side_collapsed"
anchor="center right"
self="center left"
>
Subscription
</q-tooltip>
</q-item>
</q-list>
<hr />
<q-list @click="setSideSmallScreen(false)">
<q-item clickable v-ripple to="/tools">
<q-item-section avatar>
Expand Down Expand Up @@ -358,7 +375,7 @@ export default {
name: "Facebook",
icon: "fab fa-facebook",
url: "https://www.facebook.com/shieldmaidenapp",
}
},
],
};
},
Expand Down
174 changes: 75 additions & 99 deletions src/components/Tiers.vue
Original file line number Diff line number Diff line change
@@ -1,115 +1,75 @@
<template>
<div>
<div v-if="tier && !loading">
<div v-if="!loading">
<hk-card-deck>
<hk-card
:header="t.name"
v-for="(t, key) in tiers"
:key="key"
:class="{ current: t.name == tier.name }"
>
<div class="card-body">
<div class="top">
<h2>{{ t.price }}</h2>
<em v-if="t.price == 'Free'" class="neutral-3 sub">forever</em>
<em v-else class="neutral-3 sub">per month</em>
<template v-for="(t, key) in tiers">
<hk-card
v-if="!legacy_tiers.includes(t['.key'])"
:key="key"
:class="{ current: t.name === tier?.name }"
>
<div slot="header" class="card-header flex-col items-start">
<strong>{{ t.name }}</strong>
<span class="neutral-2">{{ t.description }}</span>
</div>
<ul>
<li v-for="(benefit, key) in benefits" :key="key">
<i
v-if="typeof t.benefits[key] === 'boolean'"
aria-hidden="true"
class="fas"
:class="t.benefits[key] ? 'fa-check green' : 'fa-times neutral-3'"
/>
<template v-else>
<i
aria-hidden="true"
v-if="t.benefits[key] === 'infinite'"
class="green far fa-infinity"
/>
<strong v-else :class="t.benefits[key] === '-' ? 'neutral-3' : 'green'">{{
t.benefits[key]
}}</strong>
</template>
<span>
{{ benefit.title }}
<span v-if="key === 'character_sync'" class="neutral-3">*</span>
</span>
</li>
</ul>
<ul class="storage">
<li v-for="storage_type in storage" :key="storage_type">
<template v-if="storage_type == 'campaigns'">
<div class="card-body">
<div class="top">
<h2>{{ t.price }}</h2>
<em v-if="t.price === 'Free'" class="neutral-2 sub">forever</em>
<em v-else class="neutral-2 sub">per month</em>
</div>
<ul>
<li v-for="(benefit, key) in benefits" :key="key">
<i
v-if="typeof t.benefits[key] === 'boolean'"
aria-hidden="true"
v-if="t.benefits[storage_type] == 'infinite'"
class="green far fa-infinity"
class="fas"
:class="t.benefits[key] ? 'fa-check green' : 'fa-times neutral-3'"
/>
<span v-else class="green">{{ t.benefits[storage_type] }}</span> Campaign slots
</template>
<template v-if="storage_type == 'encounters'">
<template v-else>
<i
aria-hidden="true"
v-if="t.benefits[key] === 'infinite'"
class="green far fa-infinity"
/>
<strong v-else :class="t.benefits[key] === '-' ? 'neutral-3' : 'green'">{{
t.benefits[key]
}}</strong>
</template>
<span>
{{ benefit.title }}
<span v-if="key === 'character_sync'" class="neutral-3">*</span>
</span>
</li>
</ul>
<ul class="storage">
<li v-for="storage_type in storage" :key="storage_type">
<i
aria-hidden="true"
v-if="t.benefits[storage_type] == 'infinite'"
class="green far fa-infinity"
/>
<span v-else class="green">{{ t.benefits[storage_type] }}</span>
<span>Encounter slots <span class="neutral-3">(per campaign)</span></span>
</template>
<template v-if="storage_type == 'players'">
<i
aria-hidden="true"
v-if="t.benefits[storage_type] == 'infinite'"
class="green far fa-infinity"
/>
<span v-else class="green">{{ t.benefits[storage_type] }}</span> Player slots
</template>
<template v-if="storage_type == 'npcs'">
<i
aria-hidden="true"
v-if="t.benefits[storage_type] == 'infinite'"
class="green far fa-infinity"
/>
<span v-else class="green">{{ t.benefits[storage_type] }}</span> NPC slots
</template>
<template v-if="storage_type == 'spells'">
<i
aria-hidden="true"
v-if="t.benefits[storage_type] == 'infinite'"
class="green far fa-infinity"
/>
<span v-else class="green">{{ t.benefits[storage_type] }}</span> Spell slots
</template>
<template v-if="storage_type == 'items'">
<i
aria-hidden="true"
v-if="t.benefits[storage_type] == 'infinite'"
class="green far fa-infinity"
/>
<span v-else class="green">{{ t.benefits[storage_type] }}</span> Item slots
</template>
<template v-if="storage_type == 'reminders'">
<i
aria-hidden="true"
v-if="t.benefits[storage_type] == 'infinite'"
class="green far fa-infinity"
/>
<span v-else class="green">{{ t.benefits[storage_type] }}</span> Reminder slots
</template>
</li>
</ul>
</div>
<div slot="footer" v-if="t.price != 'Free'">
<a
:href="'https://www.patreon.com/join/shieldmaidenapp/checkout?rid=' + t['.key']"
target="_blank"
rel="noopener"
class="btn btn-block btn-square bg-patreon-red"
>Join {{ t.price }} tier</a
>
</div>
</hk-card>
<span>
{{ storageType(storage_type, t.benefits[storage_type]) }}
<span v-if="storage_type === 'encounters'" class="neutral-3">
(per campaign)
</span>
</span>
</li>
</ul>
</div>
<div slot="footer" v-if="t.price != 'Free'">
<a
:href="'https://www.patreon.com/join/shieldmaidenapp/checkout?rid=' + t['.key']"
target="_blank"
rel="noopener"
class="btn btn-block btn-square bg-patreon-red"
>Join {{ t.price }} tier</a
>
</div>
</hk-card>
</template>
</hk-card-deck>
<small class="d-block text-center">
<span class="neutral-3">*</span> Character Sync requires <strong>Chrome</strong> as your
Expand All @@ -130,6 +90,7 @@
<script>
import { mapGetters } from "vuex";
import { db } from "src/firebase";
import { legacy_tiers } from "src/utils/generalConstants";
export default {
name: "Tiers",
Expand All @@ -147,10 +108,14 @@ export default {
background: {
title: "Background effects",
},
import: {
title: "Import content",
},
storage: {
title: "Storage",
},
},
legacy_tiers,
storage: ["campaigns", "encounters", "players", "npcs", "spells", "reminders", "items"],
};
},
Expand All @@ -165,6 +130,12 @@ export default {
computed: {
...mapGetters(["tier"]),
},
methods: {
storageType(type, count) {
type === "npcs" ? type.slice(0, -1).toUpperCase() : type.slice(0, -1).capitalize();
return count === "infinite" || count > 1 ? `${type}s` : type;
},
},
};
</script>
Expand All @@ -173,6 +144,11 @@ export default {
&.current {
border-color: $patreon-red !important;
}
.card-header {
strong {
font-size: 18px;
}
}
.card-body {
padding: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/components/campaign/Players.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</button>
<button
v-if="
tier.name !== 'Free' &&
tier.price !== 'Free' &&
sync_characters &&
players &&
Object.keys(sync_characters).length &&
Expand Down Expand Up @@ -341,7 +341,7 @@
</template>
</div>
<div class="col actions" :key="'actions-' + key" v-if="viewerIsUser">
<template v-if="tier.name !== 'Free' && extensionInstalled">
<template v-if="tier.price !== 'Free' && extensionInstalled">
<button
v-if="
players[key].sync_character && players[key].sync_character in sync_characters
Expand Down
17 changes: 11 additions & 6 deletions src/components/campaign/share/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
<div v-if="!campaign.sharing" class="full-height">
<div v-if="!broadcast.live" class="not-live">
<p>Go live to share with your players</p>
<div
<div
class="live pointer"
@click="
setDrawer({
show: true,
type: 'drawers/Broadcast',
data: { campaign_id: campaignId, private: campaign.private },
})
">
"
>
Go live
</div>
</div>
Expand Down Expand Up @@ -172,15 +173,19 @@
</q-tab-panel>

<q-tab-panel name="weather">
<Weather v-model="weather" class="pb-4" :disabled="tier.name === 'Free'" />
<Weather v-model="weather" class="pb-4" :disabled="tier.price === 'Free'" />
<div class="actions">
<template v-if="tier.name !== 'Free'">
<template v-if="tier.price !== 'Free'">
<button class="btn bg-neutral-5" @click="clearWeather">Clear</button>
<button class="btn" :disabled="isEmpty(weather)" @click="setWeather">Set</button>
</template>
<template v-else>
<button v-if="!isEmpty(weather)" class="btn bg-neutral-5" @click="clearWeather">Clear</button>
<router-link v-else to="/patreon" class="btn bg-patreon-red">Get a subscription</router-link>
<button v-if="!isEmpty(weather)" class="btn bg-neutral-5" @click="clearWeather">
Clear
</button>
<router-link v-else to="/patreon" class="btn bg-patreon-red"
>Get a subscription</router-link
>
</template>
</div>
</q-tab-panel>
Expand Down
2 changes: 1 addition & 1 deletion src/components/campaign/soundBoard/Board.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</transition-group>

<div class="soundboard__actions">
<router-link v-if="tier.name === 'Free'" class="btn btn-block bg-patreon-red" to="/patreon">
<router-link v-if="tier.price === 'Free'" class="btn btn-block bg-patreon-red" to="/patreon">
Add custom links
</router-link>
<template v-else>
Expand Down
Loading

0 comments on commit c42623b

Please sign in to comment.