Vue · FeatureModal.vue — complete component <script setup>
import { computed } from 'vue'
import PopModal from '@/components/pop/PopModal.vue'
import PrimaryButton from '@/buttons/PrimaryButton.vue'
import IconButton from '@/buttons/IconButton.vue'
import Text from '@/components/Text.vue'
const props = defineProps(['popped', 'type', 'width', 'privacyUrl'])
const emit = defineEmits(['unpop', 'update:popped', 'signup', 'email', 'subscribe'])
// JoyPixels emoji codepoints; use base codepoints without -fe0f.
const featureContent = {
// Guest → Free
'account-required': {
emoji: '1f3a8', // 🎨 Artist palette
title: 'Make EmojiCopy yours',
description: 'Save favorites, combos, and your setup.',
type: 'account-required',
},
'use-favorites': {
emoji: '2764', // ❤️ Red heart
title: 'Save your favorites',
description: 'Keep your go-to emoji close.',
type: 'account-required',
},
'hide-action-bar': {
emoji: '1fae5', // 🫥 Dotted line face
title: 'Hide the action bar',
description: 'Make more room for emoji.',
type: 'account-required',
},
'sort-collections': {
emoji: '1f5c2', // 🗂️ Card index dividers
title: 'Your collections, your order',
description: 'Keep your go-to collections at the top.',
type: 'account-required',
},
'unfollow-collection': {
emoji: '1f44b', // 👋 Waving hand
title: 'Unfollow this collection',
description: 'Keep only the collections you want.',
type: 'account-required',
},
'remove-items': {
emoji: '1f9f9', // 🧹 Broom
title: 'Clean up your recents',
description: 'Remove the emoji you no longer need.',
type: 'account-required',
},
'save-combo': {
emoji: '1f9e9', // 🧩 Puzzle piece
title: 'Save this combo',
description: 'Copy it again anytime.',
type: 'account-required',
},
// Free → Pro
'sort-smart': {
emoji: '2728', // ✨ Sparkles
title: 'Your go-to emoji, first',
description: 'Sort your recents by most used.',
type: 'pro-required',
},
'create-list': {
emoji: '1f4cb', // 📋 Clipboard
title: 'Create your own lists',
description: 'An emoji list for every mood.',
type: 'pro-required',
},
'sort-lists': {
emoji: '1f5c2', // 🗂️ Card index dividers
title: 'Your lists, your order',
description: 'Keep your go-to lists at the top.',
type: 'pro-required',
},
'edit-list': {
emoji: '270f', // ✏️ Pencil
title: 'Make this list yours',
description: 'Give it a new name and icon.',
type: 'pro-required',
},
'clone-collection': {
emoji: '1f5c3', // 🗃️ Card file box
title: 'Make this collection yours',
description: 'Start with a copy you can edit.',
type: 'pro-required',
},
'delete-list': {
emoji: '1f5d1', // 🗑️ Wastebasket
title: 'Remove this list',
description: 'Keep only the lists you need.',
type: 'pro-required',
},
}
const emojiImage = codepoint =>
`https://cdn.jsdelivr.net/joypixels/assets/11.0/png/unicode/64/${codepoint}.png`
const content = computed(() => featureContent[props.type] || featureContent['account-required'])
const isPro = computed(() => content.value.type === 'pro-required')
const close = () => {
emit('update:popped', false)
emit('unpop')
}
</script>
<template>
<PopModal :popped="props.popped" :width="props.width || '480px'"
background-class="upsell-doodle" @unpop="close">
<section class="feature-prompt" role="dialog" aria-modal="true"
aria-labelledby="feature-prompt-title" aria-describedby="feature-prompt-description">
<IconButton icon="x" size="md" variant="white" class="feature-prompt__close"
label="Close" @click="close" />
<div class="feature-prompt__inner">
<span class="feature-prompt__emoji jp-font" aria-hidden="true">
<img :src="emojiImage(content.emoji)" alt="" width="48" height="48" />
</span>
<div class="feature-prompt__copy">
<Text v-if="isPro" type="body/s-heavy" color="metal-300" text="EmojiCopy Pro" />
<Text id="feature-prompt-title" tag="h2" type="body/xxl" color="white" :text="content.title" />
<Text id="feature-prompt-description" type="body/l-reg" color="metal-300" :text="content.description" />
</div>
<div class="feature-prompt__actions">
<template v-if="!isPro">
<PrimaryButton label="Create a free account" size="lg"
class="feature-prompt__cta feature-prompt__google" @click="emit('signup')">
<svg viewBox="0 0 48 48" aria-hidden="true"><path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/><path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/><path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>
<Text type="body/l-heavy" color="metal-950" text="Create a free account" />
</PrimaryButton>
<button type="button" class="feature-prompt__link" @click="emit('email')">
<Text type="body/m-reg" color="white" text="Sign up or log in with email" />
</button>
</template>
<template v-else>
<Text type="body/m-reg" color="metal-300" text="$5/mo or $48/yr" />
<PrimaryButton label="Go Pro" variant="green" size="lg" class="feature-prompt__cta" @click="emit('subscribe')" />
</template>
</div>
<Text v-if="!isPro" type="body/s-reg" color="metal-400" class="feature-prompt__legal">
By signing in with Google you agree to our
<a :href="props.privacyUrl" target="_blank" rel="noopener noreferrer">Privacy Policy</a>.
</Text>
</div>
</section>
</PopModal>
</template>
<style scoped>
/* FeatureModal composition. Existing PopModal, PrimaryButton, IconButton, Text. */
/* Add --c-metal-950: var(--metal-950) to ui/css/colors.css c-mapped primitives. */
.feature-prompt { position: relative; width: 100%; padding: var(--sp-8) var(--sp-6) var(--sp-7); text-align: center; }
.feature-prompt__close { position: absolute; top: var(--sp-3); right: var(--sp-3); }
.feature-prompt__inner { display: flex; flex-direction: column; align-items: center; gap: var(--sp-6); }
.feature-prompt__copy { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); max-width: 400px; }
.feature-prompt__copy h2 { margin: 0; }
.feature-prompt__emoji { display: grid; place-items: center; width: 80px; height: 80px; border-radius: var(--r-lg); border: 1px solid var(--metal-800); background: linear-gradient(var(--metal-900), var(--metal-950)); }
.feature-prompt__emoji img { display: block; width: 48px; height: 48px; }
.feature-prompt__actions { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); width: 100%; }
.feature-prompt__cta { width: 100%; max-width: 340px; }
/* Existing PrimaryButton geometry with fixed Google brand colors on this dark surface. */
.feature-prompt__google { --bg: var(--white); --clr: var(--metal-950); }
.feature-prompt__google:hover { --bg: var(--metal-100); }
.feature-prompt__google svg { width: 20px; height: 20px; flex: none; }
.feature-prompt__link { border: 0; padding: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.feature-prompt__legal a { color: inherit; text-decoration: underline; }
.feature-prompt__legal { max-width: 360px; }
.feature-prompt__link:focus-visible { outline: 2px solid var(--green-400); outline-offset: 4px; border-radius: var(--r-xs); }
</style>
Behavior · implementation notes Trigger: Guest opens a feature that needs an account.
Artwork: JoyPixels 11.0 Artist palette (1f3a8), displayed at 48px inside an 80px tile. Decorative; empty alt. The heading always explains the action.
Gate: account-required. Guest→Free prompts must never appear for an authenticated Free or Pro account. Pro prompts never appear for a Pro account.
One feature at a time: no generic feature list, early-access pitch, urgency, or unrelated benefits.
Reuse the existing FeatureModal mount and PopModal overlay. Keep focus inside the dialog, restore focus to the trigger on dismissal, and support Close, Escape, and backdrop dismissal. Remove the legacy beta close lock. Render only one instance at a time.
Google CTA → existing Google signup/sign-in flow. The new email event → the shared email + PIN entry for both new and existing accounts. Do not route it to a registration-only screen; if separate flows remain, preserve both actions behind this entry. No passwords.
The signup and subscribe events preserve the current integration. Parent must add an email event handler and pass the configured privacy URL. The Google button is a composed PrimaryButton with the official G, not an unshipped GoogleButton import.
After authentication or subscription, recheck the account tier. Preserve the selected emoji/combo and return to the attempted action. Never auto-delete a list or auto-unfollow after authentication; show the existing confirmation.
Pricing and entitlements: PLANS-PRICING.md is canonical. Pro pricing is $5/mo or $48/yr. The Pro CTA opens the existing plan-selection/checkout flow; guests must see the Pro requirement before signup.
CSS: add --c-metal-950: var(--metal-950) alongside the already specified --c-metal-300 and --c-metal-400 mappings in ui/css/colors.css, so Text colors resolve. PopModal supplies the dark doodle background, radius, overlay, and scroll behavior. The tile and Google button are scoped fixed-color treatments from the supplied design.
Static handoff buttons only report their intended action; they do not authenticate or charge. Every drawer contains the full config, component, invocation, and CSS independently.