From 7cf1d9d128e8efe978d601f108a7bd3ca51d6867 Mon Sep 17 00:00:00 2001 From: EthanHealy01 Date: Wed, 12 Nov 2025 12:51:51 +0000 Subject: [PATCH] onboarding slides --- .../InitialOnboardingModal.module.css | 84 +++++++++++++++++++ .../onboarding/InitialOnboardingModal.tsx | 81 +++++++++--------- .../slides/AnimatedSlideBackground.module.css | 43 ++++++++++ .../slides/AnimatedSlideBackground.tsx | 76 +++++++++++++++++ .../onboarding/slides/DesktopInstallSlide.tsx | 49 +++++++++++ .../onboarding/slides/PlanOverviewSlide.tsx | 49 +++++++++++ .../onboarding/slides/WelcomeSlide.tsx | 57 +++++++++++++ .../components/onboarding/slides/types.ts | 27 ++++++ 8 files changed, 424 insertions(+), 42 deletions(-) create mode 100644 frontend/src/core/components/onboarding/InitialOnboardingModal.module.css create mode 100644 frontend/src/core/components/onboarding/slides/AnimatedSlideBackground.module.css create mode 100644 frontend/src/core/components/onboarding/slides/AnimatedSlideBackground.tsx create mode 100644 frontend/src/core/components/onboarding/slides/DesktopInstallSlide.tsx create mode 100644 frontend/src/core/components/onboarding/slides/PlanOverviewSlide.tsx create mode 100644 frontend/src/core/components/onboarding/slides/WelcomeSlide.tsx create mode 100644 frontend/src/core/components/onboarding/slides/types.ts diff --git a/frontend/src/core/components/onboarding/InitialOnboardingModal.module.css b/frontend/src/core/components/onboarding/InitialOnboardingModal.module.css new file mode 100644 index 000000000..6a2967a20 --- /dev/null +++ b/frontend/src/core/components/onboarding/InitialOnboardingModal.module.css @@ -0,0 +1,84 @@ +.heroWrapper { + position: relative; + width: 100%; + height: 220px; + overflow: hidden; +} + +.heroLogo { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + animation: heroLogoEnter 0.25s ease forwards; +} + +.heroLogoCircle { + width: 96px; + height: 96px; + border-radius: 50%; + background: #ffffff; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18); + animation: heroLogoScale 0.25s ease forwards; +} + +.heroLogoCircle img { + width: 52px; + height: 52px; + animation: heroLogoRotate 0.25s ease forwards; + transform-origin: center; +} + +.title { + text-align: center; + opacity: 0; + transform: translateX(24px); + animation: bodySlideIn 0.25s ease forwards; +} + +.bodyCopy { + opacity: 0; + transform: translateX(24px); + animation: bodySlideIn 0.25s ease forwards; +} + +@keyframes heroLogoEnter { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes heroLogoScale { + from { + transform: scale(0.6); + } + to { + transform: scale(1); + } +} + +@keyframes heroLogoRotate { + from { + transform: rotate(-90deg) scale(0.9); + } + to { + transform: rotate(0deg) scale(1); + } +} + +@keyframes bodySlideIn { + from { + opacity: 0; + transform: translateX(24px); + } + to { + opacity: 1; + transform: translateX(0); + } +} diff --git a/frontend/src/core/components/onboarding/InitialOnboardingModal.tsx b/frontend/src/core/components/onboarding/InitialOnboardingModal.tsx index 1ef7272c8..9f9a32bae 100644 --- a/frontend/src/core/components/onboarding/InitialOnboardingModal.tsx +++ b/frontend/src/core/components/onboarding/InitialOnboardingModal.tsx @@ -7,6 +7,12 @@ import { Z_INDEX_OVER_FULLSCREEN_SURFACE } from '@app/styles/zIndex'; import OnboardingStepper from '@app/components/onboarding/OnboardingStepper'; import { useOs } from '@app/hooks/useOs'; import { useAppConfig } from '@app/contexts/AppConfigContext'; +import WelcomeSlide from '@app/components/onboarding/slides/WelcomeSlide'; +import DesktopInstallSlide from '@app/components/onboarding/slides/DesktopInstallSlide'; +import PlanOverviewSlide from '@app/components/onboarding/slides/PlanOverviewSlide'; +import AnimatedSlideBackground from '@app/components/onboarding/slides/AnimatedSlideBackground'; +import { SlideConfig } from '@app/components/onboarding/slides/types'; +import styles from './InitialOnboardingModal.module.css'; interface InitialOnboardingModalProps { opened: boolean; @@ -54,39 +60,17 @@ export default function InitialOnboardingModal({ opened, onClose }: InitialOnboa const goNext = () => setStep((s) => Math.min(totalSteps - 1, s + 1)); const goPrev = () => setStep((s) => Math.max(0, s - 1)); - const titleByStep = [ - 'Welcome to Stirling', - os.label ? `Download for ${os.label}` : 'Download', - isAdmin ? 'Admin Overview' : 'Plan Overview', - ]; + // Get slide content from the slide components + const slides = React.useMemo( + () => [ + WelcomeSlide(), + DesktopInstallSlide({ osLabel: os.label, osUrl: os.url }), + PlanOverviewSlide({ isAdmin }), + ], + [isAdmin, os.label, os.url], + ); - const bodyByStep: React.ReactNode[] = [ - ( - - Stirling helps you read and edit PDFs privately. The app includes a simple Reader with basic editing tools and an advanced Editor with professional editing tools. - - ), - ( - - Stirling works best as a desktop app. You can use it offline, access documents faster, and make edits locally on your computer. - - ), - isAdmin ? ( - - As an admin, you can manage users, configure settings, and monitor server health. The first 5 people on your server get to use Stirling free of charge. - - ) : ( - - For the next 30 days, you’ll enjoy unlimited Pro access to the Reader and the Editor. Afterwards, you can continue with the Reader for free or upgrade to keep the Editor too. - - ), - ]; - - const imageByStep = [ - '/branding/onboarding1.svg', - '/branding/onboarding2.svg', - '/branding/onboarding3.svg', - ]; + const currentSlide = slides[step]; // Buttons per step const renderButtons = () => { @@ -143,8 +127,9 @@ export default function InitialOnboardingModal({ opened, onClose }: InitialOnboa