Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

feat(app): refresh Plutonium page buttons, icons and hero art

Hampus0d0ef950fe78
diff --git a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageButton.module.css b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageButton.module.css
new file mode 100644
index 000000000..f8dc6282e
--- /dev/null
+++ b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageButton.module.css
@@ -0,0 +1,138 @@
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+
+.button {
+ --face: var(--pl-btn2-face);
+ --face-hover: var(--pl-btn2-hover);
+ --face-press: var(--pl-btn2-press);
+ --face-ledge: var(--pl-btn2-ledge);
+ --face-ink: var(--pl-btn2-ink);
+ --ledge: var(--pl-ledge-m);
+ position: relative;
+ display: flex;
+ width: 100%;
+ min-height: 3rem;
+ align-items: center;
+ justify-content: center;
+ gap: 0.5rem;
+ margin: 0 0 var(--ledge);
+ padding: 0.625rem 1.5rem;
+ border: 0;
+ border-radius: var(--pl-radius-m);
+ background-color: var(--face);
+ box-shadow: 0 var(--ledge) 0 var(--face-ledge);
+ color: var(--face-ink);
+ font-family: inherit;
+ font-size: 1rem;
+ font-weight: 800;
+ line-height: 1.3;
+ text-align: center;
+ text-wrap: balance;
+ cursor: pointer;
+ user-select: none;
+ transition-property: transform, box-shadow, background-color, color;
+ transition-duration: var(--pl-time);
+ transition-timing-function: var(--pl-ease);
+}
+
+.primary {
+ --face: var(--pl-btn-face);
+ --face-hover: var(--pl-btn-hover);
+ --face-press: var(--pl-btn-press);
+ --face-ledge: var(--pl-btn-ledge);
+ --face-ink: var(--pl-btn-ink);
+}
+
+.danger {
+ --face: var(--pl-danger-face);
+ --face-hover: var(--pl-danger-hover);
+ --face-press: var(--pl-danger-press);
+ --face-ledge: var(--pl-danger-ledge);
+ --face-ink: var(--pl-danger-ink);
+}
+
+.small {
+ --ledge: var(--pl-ledge-s);
+ min-height: 2.5rem;
+ padding: 0.5rem 1rem;
+ border-radius: var(--pl-radius-s);
+ font-size: 0.9375rem;
+ font-weight: 700;
+}
+
+@container plutonium-page (min-width: 40rem) {
+ .button {
+ width: auto;
+ }
+}
+
+@media (hover: hover) {
+ .button:hover:not(:disabled, [aria-busy='true']) {
+ box-shadow: 0 calc(var(--ledge) + var(--pl-lift)) 0 var(--face-ledge);
+ transform: translateY(calc(-1 * var(--pl-lift)));
+ }
+}
+
+.button:active:not(:disabled, [aria-busy='true']) {
+ box-shadow: 0 calc(var(--ledge) - var(--pl-press)) 0 var(--face-ledge);
+ transform: translateY(var(--pl-press));
+ transition-duration: var(--pl-press-time);
+}
+
+.button:disabled,
+.button[aria-busy='true'] {
+ cursor: not-allowed;
+ opacity: 0.6;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .button:hover:not(:disabled, [aria-busy='true']),
+ .button:active:not(:disabled, [aria-busy='true']) {
+ box-shadow: 0 var(--ledge) 0 var(--face-ledge);
+ transform: none;
+ }
+
+ .button:hover:not(:disabled, [aria-busy='true']) {
+ background-color: var(--face-hover);
+ }
+
+ .button:active:not(:disabled, [aria-busy='true']) {
+ background-color: var(--face-press);
+ }
+}
+
+@media (forced-colors: active) {
+ .button {
+ border: 1px solid ButtonText;
+ box-shadow: none;
+ }
+}
+
+.label {
+ min-width: 0;
+}
+
+.icon {
+ width: 1rem;
+ height: 1rem;
+ flex-shrink: 0;
+}
+
+:global(html[dir='rtl']) .icon {
+ transform: scaleX(-1);
+}
+
+.spinner {
+ width: 1rem;
+ height: 1rem;
+ flex-shrink: 0;
+ border: 2px solid currentColor;
+ border-inline-end-color: transparent;
+ border-radius: 50%;
+ animation: plutonium-button-spin 0.7s linear infinite;
+}
+
+@keyframes plutonium-button-spin {
+ to {
+ transform: rotate(360deg);
+ }
+}
diff --git a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageButton.tsx b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageButton.tsx
new file mode 100644
index 000000000..161a7c763
--- /dev/null
+++ b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageButton.tsx
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import styles from '@app/features/premium/components/plutonium_page/PlutoniumPageButton.module.css';
+import {PlutoniumPageIcon} from '@app/features/premium/components/plutonium_page/PlutoniumPageIcons';
+import FocusRing from '@app/features/ui/focus_ring/FocusRing';
+import {clsx} from 'clsx';
+import type React from 'react';
+
+type PlutoniumPageButtonVariant = 'primary' | 'secondary' | 'danger';
+
+interface PlutoniumPageButtonProps {
+ variant: PlutoniumPageButtonVariant;
+ onClick: () => void;
+ disabled?: boolean;
+ loading?: boolean;
+ directional?: boolean;
+ small?: boolean;
+ className?: string;
+ children: React.ReactNode;
+ 'aria-label'?: string;
+ 'data-flx'?: string;
+}
+
+const VARIANT_CLASS: Record<PlutoniumPageButtonVariant, string | undefined> = {
+ primary: styles.primary,
+ secondary: undefined,
+ danger: styles.danger,
+};
+
+export function PlutoniumPageButton({
+ variant,
+ onClick,
+ disabled,
+ loading,
+ directional,
+ small,
+ className,
+ children,
+ 'aria-label': ariaLabel,
+ 'data-flx': flx,
+}: PlutoniumPageButtonProps) {
+ return (
+ <FocusRing offset={-4} data-flx="premium.plutonium-page.button.focus-ring">
+ <button
+ type="button"
+ className={clsx(styles.button, VARIANT_CLASS[variant], small && styles.small, className)}
+ onClick={() => {
+ if (!loading) onClick();
+ }}
+ disabled={disabled}
+ aria-busy={loading || undefined}
+ aria-disabled={loading || undefined}
+ aria-label={ariaLabel}
+ data-flx={flx}
+ >
+ <span className={styles.label} data-flx="premium.plutonium-page.button.label">
+ {children}
+ </span>
+ {loading ? (
+ <span className={styles.spinner} aria-hidden="true" data-flx="premium.plutonium-page.button.spinner" />
+ ) : (
+ directional && (
+ <PlutoniumPageIcon
+ name="arrowRight"
+ className={styles.icon}
+ data-flx="premium.plutonium-page.button.icon"
+ />
+ )
+ )}
+ </button>
+ </FocusRing>
+ );
+}
diff --git a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageComparison.tsx b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageComparison.tsx
index 1c9a84c4e..b8c3f0936 100644
--- a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageComparison.tsx
+++ b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageComparison.tsx
@@ -39,7 +39,7 @@ import {
isBooleanTierPerk,
isNumericTierPerk,
LIMIT_TIER_PERKS,
- type LimitTierPerk,
+ type NumericTierPerk,
} from '@fluxer/constants/src/LimitTierPerks';
import type {MessageDescriptor} from '@lingui/core';
import {useLingui} from '@lingui/react/macro';
@@ -66,7 +66,7 @@ interface PerkDefinition {
const PERK_DEFINITIONS: ReadonlyArray<PerkDefinition> = [
{perkId: 'custom_discriminator', icon: 'hash', label: PERK_CUSTOM_TAG_DESCRIPTOR},
{perkId: 'per_guild_profiles', icon: 'userCircle', label: PERK_PER_COMMUNITY_PROFILES_DESCRIPTOR},
- {perkId: 'profile_badge', icon: 'fluxerPremium', label: PERK_PROFILE_BADGE_DESCRIPTOR},
+ {perkId: 'profile_badge', icon: 'atom', label: PERK_PROFILE_BADGE_DESCRIPTOR},
{perkId: 'custom_video_backgrounds', icon: 'image', label: PERK_VIDEO_BACKGROUNDS_DESCRIPTOR},
{perkId: 'max_guilds', icon: 'usersThree', label: PERK_COMMUNITIES_DESCRIPTOR},
{perkId: 'max_message_length', icon: 'chatCenteredText', label: PERK_MESSAGE_CHARACTERS_DESCRIPTOR},
@@ -103,13 +103,12 @@ export function resolveUploadSizes(locale: string): {free: string; premium: stri
};
}
-function resolveNumericValue(perk: LimitTierPerk, value: number, premium: boolean, locale: string): string {
- if (!isNumericTierPerk(perk)) return String(value);
- const resolved = perk.limitKey
- ? premium
- ? Limits.getStockValue(perk.limitKey, value)
- : Limits.getRestrictedValue(perk.limitKey, value)
- : value;
+function resolveNumericValue(perk: NumericTierPerk, value: number, tier: 'free' | 'premium', locale: string): string {
+ let resolved = value;
+ if (perk.limitKey) {
+ resolved =
+ tier === 'premium' ? Limits.getStockValue(perk.limitKey, value) : Limits.getRestrictedValue(perk.limitKey, value);
+ }
if (perk.unit === 'bytes') {
return formatMegabytes(locale, resolved);
}
@@ -145,8 +144,8 @@ function buildRows(locale: string, translate: (descriptor: MessageDescriptor) =>
id: perk.id,
icon: definition.icon,
label: definition.label,
- free: {kind: 'text', value: resolveNumericValue(perk, perk.restrictedValue, false, locale)},
- premium: {kind: 'text', value: resolveNumericValue(perk, perk.stockValue, true, locale)},
+ free: {kind: 'text', value: resolveNumericValue(perk, perk.restrictedValue, 'free', locale)},
+ premium: {kind: 'text', value: resolveNumericValue(perk, perk.stockValue, 'premium', locale)},
});
continue;
}
@@ -175,6 +174,12 @@ function buildRows(locale: string, translate: (descriptor: MessageDescriptor) =>
function BooleanValue({available, highlighted}: {available: boolean; highlighted: boolean}) {
const {i18n} = useLingui();
+ let iconClass: 'booleanIconMissing' | 'booleanIconHighlighted' | 'booleanIconMuted';
+ if (!available) {
+ iconClass = 'booleanIconMissing';
+ } else {
+ iconClass = highlighted ? 'booleanIconHighlighted' : 'booleanIconMuted';
+ }
return (
<>
<span className={styles.srOnly} data-flx="premium.plutonium-page.plutonium-page-comparison.boolean-value.sr-only">
@@ -182,14 +187,7 @@ function BooleanValue({available, highlighted}: {available: boolean; highlighted
</span>
<PlutoniumPageIcon
name={available ? 'check' : 'cross'}
- className={clsx(
- styles.booleanIcon,
- !available
- ? styles.booleanIconMissing
- : highlighted
- ? styles.booleanIconHighlighted
- : styles.booleanIconMuted,
- )}
+ className={clsx(styles.booleanIcon, styles[iconClass])}
data-flx="premium.plutonium-page.plutonium-page-comparison.boolean-value.boolean-icon"
/>
</>
@@ -212,11 +210,12 @@ function PerkValueView({value, highlighted}: {value: PerkValue; highlighted: boo
interface PlutoniumPageComparisonProps {
footnoteId: string;
onFootnoteClick: (event: React.MouseEvent<HTMLAnchorElement>) => void;
+ footnote: React.ReactNode;
actions: React.ReactNode;
}
export const PlutoniumPageComparison = observer(
- ({footnoteId, onFootnoteClick, actions}: PlutoniumPageComparisonProps) => {
+ ({footnoteId, onFootnoteClick, footnote, actions}: PlutoniumPageComparisonProps) => {
const {i18n} = useLingui();
const rows = buildRows(i18n.locale, (descriptor) => i18n._(descriptor));
const premiumLabel = getPremiumProductName();
@@ -247,7 +246,7 @@ export const PlutoniumPageComparison = observer(
);
return (
<section
- className={clsx(styles.glassPanel, styles.comparison)}
+ className={clsx(styles.board, styles.comparison)}
aria-labelledby="plutonium-page-compare-heading"
data-flx="premium.plutonium-page.comparison"
>
@@ -402,6 +401,7 @@ export const PlutoniumPageComparison = observer(
</table>
</section>
</FocusRing>
+ {footnote}
{actions && (
<div
className={clsx(styles.actions, styles.comparisonActions)}
diff --git a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageHeroShapes.tsx b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageHeroShapes.tsx
new file mode 100644
index 000000000..8a02833d8
--- /dev/null
+++ b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageHeroShapes.tsx
@@ -0,0 +1,104 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import styles from '@app/features/premium/components/plutonium_page/PlutoniumPage.module.css';
+import {clsx} from 'clsx';
+import type React from 'react';
+
+type ShapeKind = 'spark' | 'ring' | 'dot' | 'plus';
+
+interface Shape {
+ kind: ShapeKind;
+ x?: number;
+ xe?: number;
+ y: number;
+ size: string;
+}
+
+const SHAPES: ReadonlyArray<Shape> = [
+ {kind: 'spark', x: 0.18, y: 6, size: 'max(2.5rem, 1.6vw)'},
+ {kind: 'ring', x: 0.55, y: 24, size: 'max(3rem, 1.9vw)'},
+ {kind: 'dot', x: 0.72, y: 8, size: 'max(1rem, 0.7vw)'},
+ {kind: 'plus', x: 0.3, y: 44, size: 'max(1.75rem, 1.1vw)'},
+ {kind: 'spark', x: 0.7, y: 58, size: 'max(1.5rem, 1vw)'},
+ {kind: 'dot', x: 0.12, y: 66, size: 'max(0.75rem, 0.5vw)'},
+ {kind: 'plus', x: 0.48, y: 80, size: 'max(1.5rem, 1vw)'},
+ {kind: 'ring', xe: 0.2, y: 4, size: 'max(2.25rem, 1.5vw)'},
+ {kind: 'plus', xe: 0.62, y: 16, size: 'max(1.5rem, 1vw)'},
+ {kind: 'dot', xe: 0.78, y: 34, size: 'max(1.25rem, 0.8vw)'},
+ {kind: 'spark', xe: 0.3, y: 40, size: 'max(3rem, 1.9vw)'},
+ {kind: 'dot', xe: 0.6, y: 60, size: 'max(0.875rem, 0.6vw)'},
+ {kind: 'ring', xe: 0.16, y: 70, size: 'max(1.75rem, 1.1vw)'},
+ {kind: 'plus', xe: 0.5, y: 84, size: 'max(2rem, 1.3vw)'},
+];
+
+function ShapeGlyph({kind}: {kind: ShapeKind}) {
+ switch (kind) {
+ case 'ring':
+ return (
+ <svg viewBox="0 0 40 40" data-flx="premium.plutonium-page.hero-shapes.ring">
+ <circle
+ cx="20"
+ cy="20"
+ r="15"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="6"
+ data-flx="premium.plutonium-page.hero-shapes.ring-circle"
+ />
+ </svg>
+ );
+ case 'spark':
+ return (
+ <svg viewBox="0 0 40 40" data-flx="premium.plutonium-page.hero-shapes.spark">
+ <path
+ d="M20 0C21.5 12 28 18.5 40 20C28 21.5 21.5 28 20 40C18.5 28 12 21.5 0 20C12 18.5 18.5 12 20 0Z"
+ fill="currentColor"
+ data-flx="premium.plutonium-page.hero-shapes.spark-path"
+ />
+ </svg>
+ );
+ case 'plus':
+ return (
+ <svg viewBox="0 0 40 40" data-flx="premium.plutonium-page.hero-shapes.plus">
+ <path
+ d="M15 2h10v13h13v10H25v13H15V25H2V15h13z"
+ fill="currentColor"
+ data-flx="premium.plutonium-page.hero-shapes.plus-path"
+ />
+ </svg>
+ );
+ default:
+ return (
+ <svg viewBox="0 0 40 40" data-flx="premium.plutonium-page.hero-shapes.dot">
+ <circle cx="20" cy="20" r="20" fill="currentColor" data-flx="premium.plutonium-page.hero-shapes.dot-circle" />
+ </svg>
+ );
+ }
+}
+
+function shapeStyle(shape: Shape): React.CSSProperties {
+ const offset = (factor: number) => `calc((var(--gutter) - var(--s)) * ${factor})`;
+ return {
+ '--x': shape.x != null ? offset(shape.x) : 'auto',
+ '--xe': shape.xe != null ? offset(shape.xe) : 'auto',
+ '--y': `${shape.y}%`,
+ '--s': shape.size,
+ } as React.CSSProperties;
+}
+
+export function PlutoniumPageHeroShapes() {
+ return (
+ <div className={styles.heroShapes} aria-hidden="true" data-flx="premium.plutonium-page.hero-shapes">
+ {SHAPES.map((shape, index) => (
+ <span
+ key={`${shape.kind}-${index}`}
+ className={clsx(styles.shape, shape.kind === 'spark' && styles.shapeSpark)}
+ style={shapeStyle(shape)}
+ data-flx="premium.plutonium-page.hero-shapes.shape"
+ >
+ <ShapeGlyph kind={shape.kind} data-flx="premium.plutonium-page.hero-shapes.glyph" />
+ </span>
+ ))}
+ </div>
+ );
+}
diff --git a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageIcons.tsx b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageIcons.tsx
index 5ace46f89..2fb008a73 100644
--- a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageIcons.tsx
+++ b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageIcons.tsx
@@ -2,11 +2,11 @@
export type PlutoniumPageIconName =
| 'arrowRight'
+ | 'atom'
| 'bookmark'
| 'chatCenteredText'
| 'check'
| 'cross'
- | 'fluxerPremium'
| 'gif'
| 'globe'
| 'hash'
@@ -21,7 +21,7 @@ export type PlutoniumPageIconName =
| 'usersThree'
| 'videoCamera';
-type IconBody = {kind: 'stroke'; inner: React.ReactNode} | {kind: 'fill'; path: string} | {kind: 'premium'};
+type IconBody = {kind: 'stroke'; inner: React.ReactNode} | {kind: 'fill'; path: string};
const ICONS: Record<PlutoniumPageIconName, IconBody> = {
arrowRight: {
@@ -33,6 +33,48 @@ const ICONS: Record<PlutoniumPageIconName, IconBody> = {
</>
),
},
+ atom: {
+ kind: 'stroke',
+ inner: (
+ <>
+ <ellipse
+ cx="128"
+ cy="128"
+ rx="96"
+ ry="40"
+ strokeWidth="18"
+ transform="rotate(90 128 128)"
+ data-flx="premium.plutonium-page.plutonium-page-icons.ellipse"
+ />
+ <ellipse
+ cx="128"
+ cy="128"
+ rx="96"
+ ry="40"
+ strokeWidth="18"
+ transform="rotate(30 128 128)"
+ data-flx="premium.plutonium-page.plutonium-page-icons.ellipse--2"
+ />
+ <ellipse
+ cx="128"
+ cy="128"
+ rx="96"
+ ry="40"
+ strokeWidth="18"
+ transform="rotate(150 128 128)"
+ data-flx="premium.plutonium-page.plutonium-page-icons.ellipse--3"
+ />
+ <circle
+ cx="128"
+ cy="128"
+ r="24"
+ fill="currentColor"
+ stroke="none"
+ data-flx="premium.plutonium-page.plutonium-page-icons.circle"
+ />
+ </>
+ ),
+ },
bookmark: {
kind: 'fill',
path: 'M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Z',
@@ -51,7 +93,6 @@ const ICONS: Record<PlutoniumPageIconName, IconBody> = {
kind: 'fill',
path: 'M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z',
},
- fluxerPremium: {kind: 'premium'},
gif: {
kind: 'fill',
path: 'M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM112,144a32,32,0,0,1-64,0V112a32,32,0,0,1,55.85-21.33,8,8,0,1,1-11.92,10.66A16,16,0,0,0,64,112v32a16,16,0,0,0,32,0v-8H88a8,8,0,0,1,0-16h16a8,8,0,0,1,8,8Zm32,24a8,8,0,0,1-16,0V88a8,8,0,0,1,16,0Zm60-72H176v24h20a8,8,0,0,1,0,16H176v32a8,8,0,0,1-16,0V88a8,8,0,0,1,8-8h36a8,8,0,0,1,0,16Z',
@@ -113,44 +154,6 @@ const ICONS: Record<PlutoniumPageIconName, IconBody> = {
},
};
-function FluxerPremiumBody() {
- return (
- <>
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M59.2774 198C59.2774 208.471 50.7886 216.96 40.3174 216.96C29.8461 216.96 21.3574 208.471 21.3574 198C21.3574 187.529 29.8461 179.04 40.3174 179.04C50.7886 179.04 59.2774 187.529 59.2774 198ZM314.398 198C314.398 208.471 305.909 216.96 295.438 216.96C284.966 216.96 276.478 208.471 276.478 198C276.478 187.529 284.966 179.04 295.438 179.04C305.909 179.04 314.398 187.529 314.398 198Z"
- fill="currentColor"
- data-flx="premium.plutonium-page.plutonium-page-icons.fluxer-premium-body.path"
- />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M98.9976 75.24L137.158 126.48L58.0781 135.6L83.5181 76.92C77.3981 74.52 73.0781 68.52 73.0781 61.56C73.0781 52.44 80.5181 45 89.6381 45C98.7576 45 106.198 52.44 106.198 61.56C106.198 67.32 103.318 72.24 98.9976 75.24ZM252.12 76.92L277.56 135.6L198.48 126.48L236.64 75.24C232.32 72.24 229.44 67.2 229.44 61.56C229.44 52.44 236.88 45 246 45C255.12 45 262.56 52.44 262.56 61.56C262.56 68.52 258.24 74.52 252.12 76.92Z"
- fill="currentColor"
- data-flx="premium.plutonium-page.plutonium-page-icons.fluxer-premium-body.path--2"
- />
- <path
- d="M335.76 73.08C335.76 63.96 328.32 56.52 319.2 56.52C310.08 56.52 302.64 63.96 302.64 73.08C302.64 76.44 303.72 79.68 305.4 82.2C302.76 82.2 300.12 82.8 297.6 84.48L250.44 114.96C244.2 118.92 236.04 117.48 231.6 111.48L179.16 40.32C178.8 39.72 178.32 39.24 177.84 38.76C184.2 35.2801 188.52 28.44 188.52 20.64C188.52 9.24 179.28 0 167.88 0C156.48 0 147.24 9.24 147.24 20.64C147.24 28.44 151.56 35.2801 157.92 38.76C157.44 39.24 156.96 39.72 156.6 40.32L104.16 111.48C99.84 117.48 91.56 118.92 85.32 114.96L38.16 84.48C35.64 82.8 33 82.2 30.36 82.2C32.16 79.56 33.12 76.44 33.12 73.08C33.12 63.96 25.68 56.52 16.56 56.52C7.44 56.52 0 63.96 0 73.08C0 82.2 7.44 89.64 16.56 89.64C17.16 89.64 17.76 89.64 18.24 89.52C16.68 92.28 16.08 95.52 16.8 99L48 254.64C50.28 265.8 60.12 273.84 71.52 273.84H264.24C275.64 273.84 285.48 265.8 287.76 254.64L318.96 99C319.68 95.52 318.96 92.16 317.52 89.52C318.12 89.52 318.72 89.64 319.2 89.64C328.32 89.64 335.76 82.2 335.76 73.08Z"
- fill="currentColor"
- data-flx="premium.plutonium-page.plutonium-page-icons.fluxer-premium-body.path--3"
- />
- <path
- d="M167.88 228C184.448 228 197.88 214.568 197.88 198C197.88 181.432 184.448 168 167.88 168C151.311 168 137.88 181.432 137.88 198C137.88 214.568 151.311 228 167.88 228Z"
- fill="var(--fluxer-premium-inner, white)"
- data-flx="premium.plutonium-page.plutonium-page-icons.fluxer-premium-body.path--4"
- />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M108 198C108 207.941 99.9408 216 90 216C80.0588 216 72 207.941 72 198C72 188.059 80.0588 180 90 180C99.9408 180 108 188.059 108 198ZM264 198C264 207.941 255.941 216 246 216C236.059 216 228 207.941 228 198C228 188.059 236.059 180 246 180C255.941 180 264 188.059 264 198Z"
- fill="var(--fluxer-premium-inner, white)"
- data-flx="premium.plutonium-page.plutonium-page-icons.fluxer-premium-body.path--5"
- />
- </>
- );
-}
-
export function PlutoniumPageIcon({name, className}: {name: PlutoniumPageIconName; className?: string}) {
const icon = ICONS[name];
if (icon.kind === 'stroke') {
@@ -172,20 +175,6 @@ export function PlutoniumPageIcon({name, className}: {name: PlutoniumPageIconNam
</svg>
);
}
- if (icon.kind === 'premium') {
- return (
- <svg
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 336 274"
- className={className}
- aria-hidden="true"
- focusable="false"
- data-flx="premium.plutonium-page.plutonium-page-icons.plutonium-page-icon.svg--2"
- >
- <FluxerPremiumBody data-flx="premium.plutonium-page.plutonium-page-icons.plutonium-page-icon.fluxer-premium-body" />
- </svg>
- );
- }
return (
<svg
xmlns="http://www.w3.org/2000/svg"
diff --git a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageLinkCard.tsx b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageLinkCard.tsx
index 45764de51..9901737ec 100644
--- a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageLinkCard.tsx
+++ b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageLinkCard.tsx
@@ -6,7 +6,7 @@ import {getPremiumProductFullName} from '@app/features/premium/utils/PremiumUtil
import {Button} from '@app/features/ui/button/Button';
import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
-import {CrownIcon} from '@phosphor-icons/react';
+import {AtomIcon} from '@phosphor-icons/react';
const LINK_CARD_BODY_DESCRIPTOR = msg({
message: 'Plans, perks, gifts and your subscription are all on one page.',
@@ -22,7 +22,7 @@ export function PlutoniumPageLinkCard() {
const {i18n} = useLingui();
return (
<div className={styles.card} data-flx="premium.plutonium-page-link-card.card">
- <CrownIcon
+ <AtomIcon
weight="fill"
className={styles.icon}
aria-hidden="true"
diff --git a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageMedia.ts b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageMedia.ts
index d5a484f00..aae1b7f12 100644
--- a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageMedia.ts
+++ b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageMedia.ts
@@ -1,9 +1,46 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {hostedImageUrl} from '@app/features/app/config/HostedMedia';
+import plutoniumAtomAvif from '@app/media/images/premium/plutonium-atom.avif';
+import plutoniumAtomWebp from '@app/media/images/premium/plutonium-atom.webp';
+import plutoniumAtomAvif2x from '@app/media/images/premium/plutonium-atom-960w.avif';
+import plutoniumAtomWebp2x from '@app/media/images/premium/plutonium-atom-960w.webp';
+import premiumCrownAvif from '@app/media/images/premium/premium-crown.avif';
+import premiumCrownWebp from '@app/media/images/premium/premium-crown.webp';
+import premiumCrownAvif2x from '@app/media/images/premium/premium-crown-960w.avif';
+import premiumCrownWebp2x from '@app/media/images/premium/premium-crown-960w.webp';
-export const CROWN_AVIF = hostedImageUrl('perks-plutonium-crown.4d0b72644330bf10.avif');
-export const CROWN_WEBP = hostedImageUrl('perks-plutonium-crown.3265aa6b4147b19b.webp');
+export interface HeroArt {
+ avifSrcSet: string;
+ webpSrcSet: string;
+ src: string;
+ width: number;
+ height: number;
+}
+
+function densitySrcSet(oneX: string, twoX: string): string {
+ return `${oneX} 1x, ${twoX} 2x`;
+}
+
+const PLUTONIUM_ATOM_ART: HeroArt = {
+ avifSrcSet: densitySrcSet(plutoniumAtomAvif, plutoniumAtomAvif2x),
+ webpSrcSet: densitySrcSet(plutoniumAtomWebp, plutoniumAtomWebp2x),
+ src: plutoniumAtomWebp,
+ width: 480,
+ height: 524,
+};
+
+const PREMIUM_CROWN_ART: HeroArt = {
+ avifSrcSet: densitySrcSet(premiumCrownAvif, premiumCrownAvif2x),
+ webpSrcSet: densitySrcSet(premiumCrownWebp, premiumCrownWebp2x),
+ src: premiumCrownWebp,
+ width: 480,
+ height: 415,
+};
+
+export function heroArtFor(selfHosted: boolean): HeroArt {
+ return selfHosted ? PREMIUM_CROWN_ART : PLUTONIUM_ATOM_ART;
+}
export const AVATAR_LSF = hostedImageUrl('perks-avatar-lsf.0800cc17b7d31b5e.webp');
export const BANNER_LSF = hostedImageUrl('perks-banner-lsf.05f2565afc72a167.webp');
@@ -41,14 +78,14 @@ export const EXPRESSIONS_SHOTS = shotFamily(
export const PROFILE_SHOTS = shotFamily(
[
- 'screenshots-feature-perk-profile-640w.0df90fc828ae1bb4.avif',
- 'screenshots-feature-perk-profile-1120w.ca5e8d03c4f7eac7.avif',
- 'screenshots-feature-perk-profile-1600w.c790612e9d3295f7.avif',
+ 'screenshots-feature-perk-profile-640w.2c3a1ece3b5c8f37.avif',
+ 'screenshots-feature-perk-profile-1120w.d4b166dad6f99aaa.avif',
+ 'screenshots-feature-perk-profile-1600w.c5097ad361bc1326.avif',
],
[
- 'screenshots-feature-perk-profile-640w.76efd2d804dc3c32.webp',
- 'screenshots-feature-perk-profile-1120w.799d04fb886684b2.webp',
- 'screenshots-feature-perk-profile-1600w.7459898617b3aa74.webp',
+ 'screenshots-feature-perk-profile-640w.46700ee4bed25529.webp',
+ 'screenshots-feature-perk-profile-1120w.7b4b789270977507.webp',
+ 'screenshots-feature-perk-profile-1600w.7b2d691cea124f1b.webp',
],
);
diff --git a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageShowcase.tsx b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageShowcase.tsx
index ad60fae62..24da7bfbe 100644
--- a/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageShowcase.tsx
+++ b/fluxer_app/src/features/premium/components/plutonium_page/PlutoniumPageShowcase.tsx
@@ -2,6 +2,10 @@
import RuntimeConfig from '@app/features/app/state/RuntimeConfig';
import styles from '@app/features/premium/components/plutonium_page/PlutoniumPage.module.css';
+import {
+ PlutoniumPageIcon,
+ type PlutoniumPageIconName,
+} from '@app/features/premium/components/plutonium_page/PlutoniumPageIcons';
import {
AVATAR_LSF,
BANNER_LSF,
@@ -31,8 +35,9 @@ import type {MessageDescriptor} from '@lingui/core';
import {useLingui} from '@lingui/react/macro';
import {clsx} from 'clsx';
import type React from 'react';
+import {useCallback, useState} from 'react';
-const PERK_SHOT_SIZES = '(min-width: 48rem) 50vw, calc(100vw - 5rem)';
+const PERK_SHOT_SIZES = '(min-width: 80rem) 35rem, (min-width: 48rem) calc(50vw - 3rem), calc(100vw - 2.5rem)';
const CHAT_SURFACE = 'rgb(30, 29, 35)';
interface PerkOverlay {
@@ -46,6 +51,7 @@ interface PerkOverlay {
interface PerkCard {
id: string;
+ icon: PlutoniumPageIconName;
title: MessageDescriptor;
body: MessageDescriptor;
shots: ShotFamily;
@@ -66,6 +72,7 @@ const EXPRESSIONS_OVERLAYS: ReadonlyArray<PerkOverlay> = [
const PERK_CARDS: ReadonlyArray<PerkCard> = [
{
id: 'expressions',
+ icon: 'smiley',
title: SHOWCASE_EXPRESSIONS_TITLE_DESCRIPTOR,
body: SHOWCASE_EXPRESSIONS_BODY_DESCRIPTOR,
shots: EXPRESSIONS_SHOTS,
@@ -75,6 +82,7 @@ const PERK_CARDS: ReadonlyArray<PerkCard> = [
},
{
id: 'profile',
+ icon: 'userCircle',
title: SHOWCASE_PROFILE_TITLE_DESCRIPTOR,
body: SHOWCASE_PROFILE_BODY_DESCRIPTOR,
shots: PROFILE_SHOTS,
@@ -85,6 +93,7 @@ const PERK_CARDS: ReadonlyArray<PerkCard> = [
},
{
id: 'stream',
+ icon: 'videoCamera',
title: SHOWCASE_STREAM_TITLE_DESCRIPTOR,
body: SHOWCASE_STREAM_BODY_DESCRIPTOR,
shots: STREAM_SHOTS,
@@ -94,6 +103,7 @@ const PERK_CARDS: ReadonlyArray<PerkCard> = [
},
{
id: 'upload',
+ icon: 'paperclip',
title: SHOWCASE_UPLOAD_TITLE_DESCRIPTOR,
body: SHOWCASE_UPLOAD_BODY_DESCRIPTOR,
shots: UPLOAD_SHOTS,
@@ -232,8 +242,28 @@ function ProfileOverlay() {
}
function PerkArt({card, eager}: {card: PerkCard; eager: boolean}) {
+ const [status, setStatus] = useState<'pending' | 'loaded' | 'failed'>('pending');
+ const imageRef = useCallback((image: HTMLImageElement | null) => {
+ if (image?.complete) setStatus(image.naturalWidth > 0 ? 'loaded' : 'failed');
+ }, []);
return (
- <div className={styles.perkArt} data-flx="premium.plutonium-page.perk-art">
+ <div
+ className={clsx(
+ styles.perkArt,
+ status === 'pending' && styles.perkArtPending,
+ status === 'failed' && styles.perkArtFailed,
+ )}
+ data-flx="premium.plutonium-page.perk-art"
+ >
+ {status !== 'loaded' && (
+ <div className={styles.perkArtPlaceholder} data-flx="premium.plutonium-page.perk-art.placeholder">
+ <PlutoniumPageIcon
+ name={card.icon}
+ className={styles.perkArtPlaceholderIcon}
+ data-flx="premium.plutonium-page.perk-art.placeholder-icon"
+ />
+ </div>
+ )}
<picture data-flx="premium.plutonium-page.plutonium-page-showcase.perk-art.picture">
<source
type="image/avif"
@@ -248,6 +278,7 @@ function PerkArt({card, eager}: {card: PerkCard; eager: boolean}) {
data-flx="premium.plutonium-page.plutonium-page-showcase.perk-art.source.image-webp"
/>
<img
+ ref={imageRef}
draggable={false}
className={styles.perkArtImage}
src={card.shots.webp[1]}
@@ -257,6 +288,8 @@ function PerkArt({card, eager}: {card: PerkCard; eager: boolean}) {
fetchPriority={eager ? 'high' : undefined}
decoding="async"
alt=""
+ onLoad={() => setStatus('loaded')}
+ onError={() => setStatus('failed')}
data-flx="premium.plutonium-page.perk-art.image"
/>
</picture>
@@ -305,20 +338,22 @@ export function PlutoniumPageShowcase({
const {i18n} = useLingui();
const showArt = !RuntimeConfig.isSelfHosted();
return (
- <>
+ <div className={styles.featureRows} data-flx="premium.plutonium-page.feature-rows">
{PERK_CARDS.map((card, index) => {
const flipped = index % 2 === 1;
- const body =
- card.id === 'profile' && RuntimeConfig.usesUniqueUsernames
- ? i18n._(SHOWCASE_PROFILE_BODY_WITHOUT_TAG_DESCRIPTOR)
- : card.id === 'profile'
- ? renderProfileBody(
- i18n._(card.body, {footnote: '\u0000'}),
- footnoteId,
- onFootnoteClick,
- i18n._(TAG_FOOTNOTE_MARKER_DESCRIPTOR),
- )
- : i18n._(card.body, {freeSize: freeUploadSize});
+ let body: React.ReactNode;
+ if (card.id === 'profile' && RuntimeConfig.usesUniqueUsernames) {
+ body = i18n._(SHOWCASE_PROFILE_BODY_WITHOUT_TAG_DESCRIPTOR);
+ } else if (card.id === 'profile') {
+ body = renderProfileBody(
+ i18n._(card.body, {footnote: '\u0000'}),
+ footnoteId,
+ onFootnoteClick,
+ i18n._(TAG_FOOTNOTE_MARKER_DESCRIPTOR),
+ );
+ } else {
+ body = i18n._(card.body, {freeSize: freeUploadSize});
+ }
return (
<article
key={card.id}
@@ -327,11 +362,16 @@ export function PlutoniumPageShowcase({
>
{showArt && (
<div className={styles.perkArtColumn} data-flx="premium.plutonium-page.perk-row.art-column">
- <PerkArt
- card={card}
- eager={index === 0}
- data-flx="premium.plutonium-page.plutonium-page-showcase.perk-art"
- />
+ <div
+ className={clsx(styles.tilt, flipped && styles.tiltReverse)}
+ data-flx="premium.plutonium-page.perk-row.tilt"
+ >
+ <PerkArt
+ card={card}
+ eager={index === 0}
+ data-flx="premium.plutonium-page.plutonium-page-showcase.perk-art"
+ />
+ </div>
</div>
)}
<div className={styles.perkTextColumn} data-flx="premium.plutonium-page.perk-row.text-column">
@@ -345,7 +385,7 @@ export function PlutoniumPageShowcase({
</article>
);
})}
- </>
+ </div>
);
}