mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-28 16:57:43 +02:00
feat(subscription-ui): redesign with glass morphism and responsive layout
- Update all subscription components with glass morphism styling - Add backdrop blur, subtle borders, and proper dark mode support - Fix responsive layout issues with proper min-width and overflow handling - Position badges inside cards to prevent clipping - Add responsive font sizes for mobile displays - Simplify mana page wrapper in chat app 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f2c7950875
commit
a3247086eb
8 changed files with 848 additions and 134 deletions
|
|
@ -59,38 +59,34 @@
|
|||
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
class="relative rounded-xl p-4 transition-all duration-200 bg-content border hover:-translate-y-0.5 hover:shadow-lg"
|
||||
class:border-2={isCurrentPlan}
|
||||
class:border-mana={isCurrentPlan || plan.popular}
|
||||
class:border-theme={!isCurrentPlan && !plan.popular}
|
||||
class="subscription-card"
|
||||
class:subscription-card--current={isCurrentPlan}
|
||||
class:subscription-card--popular={plan.popular && !isCurrentPlan}
|
||||
onmouseenter={() => (isHovered = true)}
|
||||
onmouseleave={() => (isHovered = false)}
|
||||
>
|
||||
{#if isCurrentPlan}
|
||||
<div class="absolute -top-3 left-4 rounded-xl bg-mana px-3 py-1 text-xs font-bold text-white">
|
||||
<div class="subscription-card__badge subscription-card__badge--current">
|
||||
{isLegacy ? legacyPlanLabel : currentPlanLabel}
|
||||
</div>
|
||||
{/if}
|
||||
{#if plan.popular && !isCurrentPlan}
|
||||
<div class="absolute -top-3 right-4 rounded-xl bg-mana px-3 py-1 text-xs font-bold text-white">
|
||||
<div class="subscription-card__badge subscription-card__badge--popular">
|
||||
{popularLabel}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Tier Name -->
|
||||
<h3 class="mb-4 text-center text-lg font-bold text-theme">
|
||||
<h3 class="subscription-card__title">
|
||||
{plan.name}
|
||||
</h3>
|
||||
|
||||
<!-- Three column layout -->
|
||||
<div class="mb-5 flex justify-between gap-2">
|
||||
<div class="subscription-card__grid">
|
||||
<!-- Mana Icon with background -->
|
||||
<div
|
||||
class="flex aspect-square flex-1 items-center justify-center rounded-xl bg-menu"
|
||||
style="min-height: 80px;"
|
||||
>
|
||||
<div class="subscription-card__cell">
|
||||
<div
|
||||
class="flex items-center justify-center rounded-lg"
|
||||
class="subscription-card__icon-wrapper"
|
||||
style="width: {tierStyles.bgSize}; height: {tierStyles.bgSize}; background-color: {tierStyles.bg};"
|
||||
>
|
||||
<ManaIcon size={32} color={tierStyles.icon} />
|
||||
|
|
@ -98,29 +94,23 @@
|
|||
</div>
|
||||
|
||||
<!-- Mana Amount -->
|
||||
<div
|
||||
class="flex aspect-square flex-1 flex-col items-center justify-center rounded-xl bg-menu"
|
||||
style="min-height: 80px;"
|
||||
>
|
||||
<p class="mb-0.5 text-2xl font-bold text-theme">
|
||||
<div class="subscription-card__cell">
|
||||
<p class="subscription-card__value">
|
||||
{plan.monthlyMana}
|
||||
</p>
|
||||
<p class="text-center text-xs text-theme-secondary">{perMonthLabel}</p>
|
||||
<p class="subscription-card__label">{perMonthLabel}</p>
|
||||
</div>
|
||||
|
||||
<!-- Price -->
|
||||
<div
|
||||
class="flex aspect-square flex-1 flex-col items-center justify-center rounded-xl bg-menu"
|
||||
style="min-height: 80px;"
|
||||
>
|
||||
<p class="text-xl font-bold text-theme">
|
||||
<div class="subscription-card__cell">
|
||||
<p class="subscription-card__price">
|
||||
{formatPrice(plan)}
|
||||
</p>
|
||||
<p class="mt-0.5 text-xs text-theme-secondary">
|
||||
<p class="subscription-card__label">
|
||||
{plan.billingCycle === 'yearly' ? perYearLabel : perMonthLabel}
|
||||
</p>
|
||||
{#if plan.billingCycle === 'yearly' && plan.monthlyEquivalent}
|
||||
<p class="mt-0 text-[9px] text-theme-secondary">
|
||||
<p class="subscription-card__sublabel">
|
||||
({plan.monthlyEquivalent.toFixed(2).replace('.', ',')}€{monthlyEquivalentLabel})
|
||||
</p>
|
||||
{/if}
|
||||
|
|
@ -138,3 +128,147 @@
|
|||
/>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.subscription-card {
|
||||
position: relative;
|
||||
padding: 1.25rem;
|
||||
border-radius: 1rem;
|
||||
transition: all 0.2s ease;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
:global(.dark) .subscription-card {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.subscription-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
:global(.dark) .subscription-card:hover {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.subscription-card--current {
|
||||
border: 2px solid hsl(var(--primary, 221 83% 53%));
|
||||
}
|
||||
|
||||
.subscription-card--popular {
|
||||
border: 2px solid hsl(var(--primary, 221 83% 53%));
|
||||
}
|
||||
|
||||
.subscription-card__badge {
|
||||
position: absolute;
|
||||
top: 0.75rem;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 600;
|
||||
color: white;
|
||||
background: hsl(var(--primary, 221 83% 53%));
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.subscription-card__badge--current {
|
||||
left: 0.75rem;
|
||||
}
|
||||
|
||||
.subscription-card__badge--popular {
|
||||
right: 0.75rem;
|
||||
}
|
||||
|
||||
.subscription-card__title {
|
||||
margin: 1.5rem 0 1rem 0;
|
||||
text-align: center;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: hsl(var(--foreground));
|
||||
}
|
||||
|
||||
.subscription-card__grid {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 0.375rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.subscription-card__cell {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.5rem;
|
||||
min-height: 70px;
|
||||
min-width: 0;
|
||||
border-radius: 0.75rem;
|
||||
background: rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
:global(.dark) .subscription-card__cell {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.subscription-card__icon-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.subscription-card__value {
|
||||
margin: 0 0 0.25rem 0;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: hsl(var(--foreground));
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.subscription-card__price {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
color: hsl(var(--foreground));
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.subscription-card__label {
|
||||
margin: 0;
|
||||
font-size: 0.625rem;
|
||||
color: hsl(var(--muted-foreground));
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.subscription-card__sublabel {
|
||||
margin: 0.125rem 0 0 0;
|
||||
font-size: 0.5rem;
|
||||
color: hsl(var(--muted-foreground));
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.subscription-card__value {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.subscription-card__price {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.subscription-card__label {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.subscription-card__sublabel {
|
||||
font-size: 0.625rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue