diff --git a/src/OnboardingSPA/components/Animate/index.js b/src/OnboardingSPA/components/Animate/index.js index fb9b58d18..d78559fb0 100644 --- a/src/OnboardingSPA/components/Animate/index.js +++ b/src/OnboardingSPA/components/Animate/index.js @@ -1,3 +1,5 @@ +import classNames from 'classnames'; + /** * A Animator to show animation * @@ -5,7 +7,14 @@ * @param { object | boolean } after The variable to look after for before showing the animation, by default true to show the children right away. * */ -const Animate = ( { type, after = true, children } ) => { +const Animate = ( { + type, + after = true, + children, + className = '', + duration = false, + timingFunction = false, +} ) => { const prefix = 'animate'; /** @@ -16,12 +25,35 @@ const Animate = ( { type, after = true, children } ) => { function getAnimateClassName() { if ( type ) { let classname = ''; - switch ( type ) { // Add animation types and appropriate CSS case 'fade-in': classname = prefix.concat( '__fade-in' ); break; + case 'fade-in-disabled': + classname = prefix.concat( '__fade-in--disabled' ); + break; + case 'fade-in-right': + classname = prefix.concat( '__fade-in--right' ); + break; + case 'fade-in-left': + classname = prefix.concat( '__fade-in--left' ); + break; + case 'fade-in-up': + classname = prefix.concat( '__fade-in--up' ); + break; + case 'shine': + classname = prefix.concat( '__shine' ); + break; + case 'shine-placeholder': + classname = prefix.concat( '__shine--placeholder' ); + break; + case 'dropdown': + classname = prefix.concat( '__dropdown' ); + break; + case 'load': + classname = prefix.concat( '__load' ); + break; } return classname; } @@ -30,7 +62,15 @@ const Animate = ( { type, after = true, children } ) => { return ! after ? (
diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/index.js b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/index.js index 5e3036994..976cb52b1 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/index.js +++ b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/index.js @@ -63,6 +63,7 @@ const StepWelcome = () => { title={ __(tab.subtitle, 'wp-module-onboarding')} text={ sprintf( __(tab.text, 'wp-module-onboarding'), translations('site'), brandName )} imgType={tab.imgType} + animationName = {tab.animationName} className="tab-data" /> }; } )} diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/stylesheet.scss b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/stylesheet.scss index ec13d6486..4a2bf0d2a 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/stylesheet.scss +++ b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/stylesheet.scss @@ -88,31 +88,22 @@ background-size: contain; background-repeat: no-repeat; height: 228px; - animation-duration: 360ms; width: clamp(180px, 50vw, 400px); - animation-timing-function: ease-out; - @media (prefers-reduced-motion) { - animation: none !important; - translation: none !important; - } } .content-img{ @extend .tab-img-base; background-image: var(--get-started-content-img); - animation-name: fadeInRight; } .features-img{ @extend .tab-img-base; background-image: var(--get-started-features-img); - animation-name: fadeInUp; } .design-img{ @extend .tab-img-base; background-image: var(--get-started-design-img); - animation-name: fadeInLeft; } .welcome-card { diff --git a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/tabContent.json b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/tabContent.json index 6ee086221..cf12b6ea4 100644 --- a/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/tabContent.json +++ b/src/OnboardingSPA/pages/Steps/GetStarted/Welcome/tabContent.json @@ -5,21 +5,24 @@ "title": "YOUR CONTENT", "subtitle": "Publish boldly with WordPress Blocks.", "text": "Build a beautiful %s using a visual builder. Block Patterns accelerate telling your story or tending your store with professional designs.", - "imgType": "content-img" + "imgType": "content-img", + "animationName": "fade-in-right" }, { "name": "tab2", "title": "POWERFUL FEATURES", "subtitle": "Proven, easy-to-use solutions.", "text": "Reach for your %s goals using proven WordPress Plugins & %s solutions. Send a newsletter, host a podcast, book clients, take payments and more.", - "imgType": "features-img" + "imgType": "features-img", + "animationName": "fade-in-up" }, { "name": "tab3", "title": "MODERN DESIGN", "subtitle": "Paint trim. Move walls. No sweat.", "text": "Establish your %s's unique design. Use the WordPress Editor to refine over time with professionally-designed patterns, parts, templates, colors and type.", - "imgType": "design-img" + "imgType": "design-img", + "animationName": "fade-in-left" } ] } \ No newline at end of file diff --git a/src/OnboardingSPA/pages/Steps/SitePages/stylesheet.scss b/src/OnboardingSPA/pages/Steps/SitePages/stylesheet.scss index 99ae99689..1782121a6 100644 --- a/src/OnboardingSPA/pages/Steps/SitePages/stylesheet.scss +++ b/src/OnboardingSPA/pages/Steps/SitePages/stylesheet.scss @@ -5,6 +5,14 @@ flex-direction: column; justify-content: center; + .highlighted { + background-color: var(--nfd-onboarding-light-gray-highlighted); + } + + .not-highlighted { + background-color: var(--nfd-onboarding-light-gray-3); + } + &__list { width: 50vw; height: 100%; @@ -104,7 +112,6 @@ border-top: none; margin: 0 0; height: 50px; - animation: dropdown 400ms ease-in-out forwards; transform-origin: top center; box-shadow: 0 11px 8px -3px rgba(88, 124, 175, 0.37); diff --git a/src/OnboardingSPA/pages/Steps/WhatNext/index.js b/src/OnboardingSPA/pages/Steps/WhatNext/index.js index 411bd0d35..1ee8e805e 100644 --- a/src/OnboardingSPA/pages/Steps/WhatNext/index.js +++ b/src/OnboardingSPA/pages/Steps/WhatNext/index.js @@ -42,6 +42,7 @@ const StepWhatNext = () => { title={ __(tab.subtitle, 'wp-module-onboarding')} text={ sprintf( __(tab.text, 'wp-module-onboarding'), translations('site'))} imgType={tab.imgType} + animationName = { tab.animationName } className="tab-data" /> }; } )} diff --git a/src/OnboardingSPA/pages/Steps/WhatNext/stylesheet.scss b/src/OnboardingSPA/pages/Steps/WhatNext/stylesheet.scss index 68bd5ac2b..0c990399c 100644 --- a/src/OnboardingSPA/pages/Steps/WhatNext/stylesheet.scss +++ b/src/OnboardingSPA/pages/Steps/WhatNext/stylesheet.scss @@ -90,31 +90,22 @@ background-size: contain; background-repeat: no-repeat; height: 228px; - animation-duration: 360ms; width: clamp(180px, 50vw, 400px); - animation-timing-function: ease-out; - @media (prefers-reduced-motion) { - animation: none !important; - transition: none !important; - } } .wpadmin-img { @extend .whatsnext-image; background-image: var(--what-next-wp-admin-img); - animation-name: fadeInRight; } .help-img { @extend .whatsnext-image; background-image: var(--what-next-help-img); - animation-name: fadeInUp; } .bluesky-img { @extend .whatsnext-image; background-image: var(--what-next-bluesky-img); - animation-name: fadeInLeft; } .whatnext-card { diff --git a/src/OnboardingSPA/pages/Steps/WhatNext/tabContent.json b/src/OnboardingSPA/pages/Steps/WhatNext/tabContent.json index 44f6d3a86..31aa1b20a 100644 --- a/src/OnboardingSPA/pages/Steps/WhatNext/tabContent.json +++ b/src/OnboardingSPA/pages/Steps/WhatNext/tabContent.json @@ -5,21 +5,24 @@ "title": "WHATS NEXT", "subtitle": "Add content, organize your menu and launch.", "text": "✅ Theme created, features added and Coming Soon mode activated. Thank you for building your site with Bluehost, we're always here to help!", - "imgType": "wpadmin-img" + "imgType": "wpadmin-img", + "animationName": "fade-in-right" }, { "name": "tab2", "title": "HELP & RESOURCES", "subtitle": "Next step or next level, we're your partner.", "text": "WordPress make it easy to grow your %s. Send a newsletter, broadcast a podcast, create courses and trainings. Dream it, build it.", - "imgType": "help-img" + "imgType": "help-img", + "animationName": "fade-in-up" }, { "name": "tab3", "title": "HIRE OUR EXPERTS", "subtitle": "Make our great people your people.", "text": "Pick your %s's unique design now and refine by customing your block templates, colors and fonts in the WordPress Site Editor.", - "imgType": "bluesky-img" + "imgType": "bluesky-img", + "animationName": "fade-in-left" } ] } diff --git a/src/OnboardingSPA/styles/_utilities.scss b/src/OnboardingSPA/styles/_utilities.scss index b916ae7d5..29f5ee105 100644 --- a/src/OnboardingSPA/styles/_utilities.scss +++ b/src/OnboardingSPA/styles/_utilities.scss @@ -1,96 +1,3 @@ -@keyframes fadeIn { - - from { - opacity: 0; - } - - to { - opacity: 1; - } -} - -@keyframes fadeInWithDisabledClicks { - - from { - opacity: 0; - pointer-events: none; - } - - to { - opacity: 1; - } -} - -@keyframes fadeInRight { - from { - opacity: 0; - transform: translate3d(33%,0,0); - } - to { - opacity: 1; - transform: translate3d(0,0,0); - } -} - -@keyframes fadeInLeft { - from { - opacity: 0; - transform: translate3d(-33%, 0, 0); - } - to { - opacity: 1; - transform: translate3d(0,0,0) - } -} - -@keyframes fadeInUp { - from { - opacity: 0; - transform: translate3d(0, 33%, 0); - } - to { - opacity: 1; - transform: translate3d(0,0,0) - } -} - -@keyframes shine { - - 0% { - transform: translateX(-100%); - } - - 100% { - transform: translateX(100%); - } -} - -@keyframes shine-placeholder { - - 0% { - background-position: -468px 0; - } - - 100% { - background-position: 468px 0; - } -} - -@keyframes dropdown { - - 0% { - transform: rotateX(-90deg); - } - - 70% { - transform: rotateX(20deg); - } - - 100% { - transform: rotateX(0deg); - } -} - .is-centered { display: flex; place-content: center; diff --git a/src/OnboardingSPA/styles/app.scss b/src/OnboardingSPA/styles/app.scss index 49c025c99..8dad365f7 100644 --- a/src/OnboardingSPA/styles/app.scss +++ b/src/OnboardingSPA/styles/app.scss @@ -36,7 +36,6 @@ @import "../components/ErrorState/stylesheet"; @import "../components/CheckboxTemplate/CheckboxItem/stylesheet"; @import "../components/CheckboxTemplate/CheckboxList/stylesheet"; -@import "../components/RadioControl/RadioControlSkeleton/stylesheet"; @import "../components/CheckboxTemplate/CheckboxListSkeleton/stylesheet"; @import "../components/Sidebar/components/LearnMore/Skeleton/stylesheet"; @import "../components/Animate/stylesheet";