Skip to content

Commit

Permalink
Revert "Finish landing animations (#535)"
Browse files Browse the repository at this point in the history
This reverts commit e2e94be.
  • Loading branch information
AmsterGet committed Oct 23, 2024
1 parent 2b6a154 commit a02c129
Show file tree
Hide file tree
Showing 26 changed files with 151 additions and 326 deletions.
7 changes: 4 additions & 3 deletions src/components/AnimatedHeader/AnimatedHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import { createElement, FC, PropsWithChildren } from 'react';
import { motion, Transition } from 'framer-motion';
import { useInView } from '@app/hooks/useInView';
import { useMotionEnterAnimation } from '@app/hooks/useMotionEnterAnimation';
import { easeInOutTransition, opacityScaleAnimationProps, PropsWithAnimation } from '@app/utils';
import { easeInOutTransition, opacityScaleAnimationProps } from '@app/utils';

interface AnimatedHeaderProps {
transition?: Transition;
delay?: number;
headerLevel?: 1 | 2 | 3 | 4 | 5 | 6;
className?: string;
isAnimationEnabled?: boolean;
}

export const AnimatedHeader: FC<PropsWithChildren<PropsWithAnimation<AnimatedHeaderProps>>> = ({
export const AnimatedHeader: FC<PropsWithChildren<AnimatedHeaderProps>> = ({
transition = easeInOutTransition,
delay,
headerLevel = 2,
Expand All @@ -28,7 +29,7 @@ export const AnimatedHeader: FC<PropsWithChildren<PropsWithAnimation<AnimatedHea

return createElement(
motion[`h${headerLevel}`],
{ className, ref: titleRef, ...getAnimation({ isInView: isTitleInView, delay }) },
{ className, ref: titleRef, ...getAnimation({ inView: isTitleInView, delay }) },
children,
);
};
12 changes: 5 additions & 7 deletions src/components/AnimatedList/AnimatedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ export const AnimatedList: FC<AnimatedListProps> = ({
<section ref={ref} className={classNames(getBlocksWith(), 'container')}>
<div>
<AnimatedHeader transition={defaultSpringTransition}>{title}</AnimatedHeader>
<motion.h3 {...getSubtitleAnimation({ delay: 0.1, isInView: inView })}>
{subtitle}
</motion.h3>
<motion.h3 {...getSubtitleAnimation({ delay: 0.1, inView })}>{subtitle}</motion.h3>
</div>
<div className={getBlocksWith('__content')}>
<div
Expand All @@ -91,15 +89,15 @@ export const AnimatedList: FC<AnimatedListProps> = ({
className={getBlocksWithList('__item')}
key={itemTitle}
onClick={() => setIndexAndResetInterval(index)}
{...getCardAnimation({ isInView: inView, delay: 0.2 * index })}
{...getCardAnimation({ inView, delay: 0.2 * index })}
>
<strong>{itemTitle}</strong>
</motion.li>
) : (
<motion.li
className={getBlocksWithList('__item', '__item--active')}
key={itemTitle}
{...getCardAnimation({ isInView: inView, delay: 0.2 * index })}
{...getCardAnimation({ inView, delay: 0.2 * index })}
>
<img src={image} alt="" />
<LinkedCard
Expand All @@ -118,7 +116,7 @@ export const AnimatedList: FC<AnimatedListProps> = ({
key={image}
alt=""
{...getImageAnimation({
isInView: inView,
inView,
delay: isFirstImageAnimationPlayed.current ? 0 : 0.6,
additionalEffects: {
transitionAdditional: {
Expand All @@ -136,7 +134,7 @@ export const AnimatedList: FC<AnimatedListProps> = ({
<div className={getBlocksWith('__leading')}>
<motion.div
className={getBlocksWith('__leading-button-group')}
{...getButtonsAnimation({ isInView: inView, delay: 1.7 })}
{...getButtonsAnimation({ inView, delay: 1.7 })}
>
{children}
</motion.div>
Expand Down
13 changes: 4 additions & 9 deletions src/components/ArticlePreview/ArticlePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import React, { FC } from 'react';
import isEmpty from 'lodash/isEmpty';
import chunk from 'lodash/chunk';
import { useMediaQuery } from 'react-responsive';
import { BlogPostDto, MEDIA_DESKTOP_SM, MEDIA_TABLET_SM, PropsWithAnimation } from '@app/utils';
import { BlogPostDto, MEDIA_DESKTOP_SM, MEDIA_TABLET_SM } from '@app/utils';

import { ArticlePreviewRow } from './ArticlePreviewRow';

import './ArticlePreview.scss';

interface ArticlePreviewProps {
posts: BlogPostDto[];
hasFixedItemsPerRow?: boolean;
}

const getItemsPerRow = (isDesktop: boolean, isTablet: boolean) => {
Expand All @@ -25,19 +24,15 @@ const getItemsPerRow = (isDesktop: boolean, isTablet: boolean) => {
return 1;
};

export const ArticlePreview: FC<PropsWithAnimation<ArticlePreviewProps>> = ({
posts,
hasFixedItemsPerRow = false,
isAnimationEnabled = false,
}) => {
export const ArticlePreview: FC<ArticlePreviewProps> = ({ posts }) => {
const isDesktop = useMediaQuery({ query: MEDIA_DESKTOP_SM });
const isTablet = useMediaQuery({ query: MEDIA_TABLET_SM });
const rows = chunk(posts, hasFixedItemsPerRow ? 3 : getItemsPerRow(isDesktop, isTablet));
const rows = chunk(posts, getItemsPerRow(isDesktop, isTablet));

return !isEmpty(posts) ? (
<ul>
{rows.map((row, rowIndex) => (
<ArticlePreviewRow key={rowIndex} row={row} isAnimationEnabled={isAnimationEnabled} />
<ArticlePreviewRow key={rowIndex} row={row} />
))}
</ul>
) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
createBemBlockBuilder,
getEaseInOutTransition,
opacityScaleAnimationProps,
PropsWithAnimation,
} from '@app/utils';
import { useInView } from '@app/hooks/useInView';
import { useMotionEnterAnimation } from '@app/hooks/useMotionEnterAnimation';
Expand All @@ -18,25 +17,19 @@ interface ArticlePreviewRowProps {

const getBlocksWith = createBemBlockBuilder(['article-preview-list']);

export const ArticlePreviewRow: FC<PropsWithAnimation<ArticlePreviewRowProps>> = ({
row,
isAnimationEnabled = false,
}) => {
export const ArticlePreviewRow: FC<ArticlePreviewRowProps> = ({ row }) => {
const [rowRef, isInView] = useInView();
const getAnimation = useMotionEnterAnimation(
{
...opacityScaleAnimationProps,
...getEaseInOutTransition(0.7),
},
isAnimationEnabled,
);
const getAnimation = useMotionEnterAnimation({
...opacityScaleAnimationProps,
...getEaseInOutTransition(0.7),
});

return (
<motion.div
ref={rowRef}
className={getBlocksWith()}
{...getAnimation({
isInView,
inView: isInView,
additionalEffects: {
hiddenAdditional: {
y: 150,
Expand Down
8 changes: 4 additions & 4 deletions src/components/HeroSwitching/HeroSwitching.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
createBemBlockBuilder,
defaultSpringTransition,
opacityScaleAnimationProps,
PropsWithAnimation,
} from '@app/utils';
import { AnimatedHeader } from '@app/components/AnimatedHeader';
import { useMotionEnterAnimation } from '@app/hooks/useMotionEnterAnimation';
Expand All @@ -19,12 +18,13 @@ interface HeroSwitchingProps {
switchActiveBtn?: (text: string) => void;
subtitle?: string;
isHeroInView?: boolean;
isAnimationEnabled?: boolean;
children?: ReactNode;
}

const getBlocksWith = createBemBlockBuilder(['hero-switching']);

export const HeroSwitching: FC<PropsWithAnimation<HeroSwitchingProps>> = ({
export const HeroSwitching: FC<HeroSwitchingProps> = ({
title,
subtitle,
buttons,
Expand Down Expand Up @@ -55,15 +55,15 @@ export const HeroSwitching: FC<PropsWithAnimation<HeroSwitchingProps>> = ({
{subtitle && (
<motion.p
className={getBlocksWith('__subtitle')}
{...getSubtitleAnimation({ delay: 0.1, isInView: isHeroInView })}
{...getSubtitleAnimation({ delay: 0.1, inView: isHeroInView })}
>
{subtitle}
</motion.p>
)}
{children}
<motion.div
className={getBlocksWith('__btn-box')}
{...getSubtitleAnimation({ delay: 0.2, isInView: isHeroInView })}
{...getSubtitleAnimation({ delay: 0.2, inView: isHeroInView })}
>
<ButtonSwitcher buttons={buttons} activeBtnName={activeButton} onSwitch={switchActiveBtn} />
</motion.div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/LinkedCard/LinkedCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const LinkedCard: FC<LinkedCardProps> = ({
itemTitle,
description,
link,
linkText = '',
linkText,
icon,
delay = false,
}) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/OfferPageWrapper/OfferPageWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const OfferPageWrapper: FC<OfferPageWrapperProps> = ({
className={getBlocksWith('__pentagons')}
ref={cardsRef}
{...getCardsAnimation({
isInView: areCardsInView,
inView: areCardsInView,
delay: 0.6,
additionalEffects: {
hiddenAdditional: {
Expand Down
10 changes: 5 additions & 5 deletions src/components/PricingHero/PricingHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
easeInOutOpacityScaleAnimationProps,
easeInOutTransition,
heroBackgroundAnimationProps,
PropsWithAnimation,
} from '@app/utils';
import { useInView } from '@app/hooks/useInView';
import { useMotionEnterAnimation } from '@app/hooks/useMotionEnterAnimation';
Expand All @@ -24,6 +23,7 @@ interface PricingHeroProps {
description: string;
switcherProps: PlanTypeSwitcherProps;
subtitle?: string;
isAnimationEnabled?: boolean;
}

const getBlocksWith = createBemBlockBuilder(['pricing-hero']);
Expand All @@ -40,7 +40,7 @@ const offerDescriptionAnimation = {
...easeInOutTransition,
};

export const PricingHero: FC<PropsWithAnimation<PricingHeroProps>> = ({
export const PricingHero: FC<PricingHeroProps> = ({
title,
subtitle,
buttons,
Expand Down Expand Up @@ -69,7 +69,7 @@ export const PricingHero: FC<PropsWithAnimation<PricingHeroProps>> = ({
<motion.div
className={getBlocksWith()}
ref={heroRef}
{...getBackgroundAnimation({ isInView: isHeroInView })}
{...getBackgroundAnimation({ inView: isHeroInView })}
>
<HeroSwitching
activeButton={activeButton}
Expand All @@ -82,7 +82,7 @@ export const PricingHero: FC<PropsWithAnimation<PricingHeroProps>> = ({
<motion.div
className={getBlocksWith('__wrapper')}
{...getOfferDescriptionAnimation({
isInView: isHeroInView,
inView: isHeroInView,
})}
>
<div className={getBlocksWith('__wrapper-title')}>{offerType}</div>
Expand All @@ -91,7 +91,7 @@ export const PricingHero: FC<PropsWithAnimation<PricingHeroProps>> = ({
<motion.div
className={getBlocksWith('__plan-type-switcher')}
{...getDiscountSwitcherAnimation({
isInView: isHeroInView,
inView: isHeroInView,
delay: 0.5,
additionalEffects: {
hiddenAdditional: {
Expand Down
90 changes: 28 additions & 62 deletions src/components/ProcessIntegration/ProcessIntegration.tsx
Original file line number Diff line number Diff line change
@@ -1,75 +1,41 @@
import React, { forwardRef } from 'react';
import { motion } from 'framer-motion';
import Marquee from 'react-fast-marquee';
import { Link } from '@app/components/Link';
import { useHomePage } from '@app/hooks/useHomePage';
import {
createBemBlockBuilder,
defaultSpringTransition,
DOCUMENTATION_URL,
easeInOutTransition,
opacityScaleAnimationProps,
PropsWithAnimation,
} from '@app/utils';
import { AnimatedHeader } from '@app/components/AnimatedHeader';
import { useInView } from '@app/hooks/useInView';
import { useMotionEnterAnimation } from '@app/hooks/useMotionEnterAnimation';
import { createBemBlockBuilder, DOCUMENTATION_URL } from '@app/utils';

import './ProcessIntegration.scss';

const getBlocksWith = createBemBlockBuilder(['process-integration']);

export const ProcessIntegration = forwardRef<HTMLDivElement, PropsWithAnimation>(
({ isAnimationEnabled = false }, ref) => {
const { integrations } = useHomePage();
const [containerRef, isInView] = useInView();
export const ProcessIntegration = forwardRef((props, ref) => {
const { integrations } = useHomePage();

const getButtonAnimation = useMotionEnterAnimation(
{
...opacityScaleAnimationProps,
...easeInOutTransition,
},
isAnimationEnabled,
);

return (
<section className={getBlocksWith()} ref={ref}>
<div className="container" ref={containerRef}>
<AnimatedHeader
isAnimationEnabled={isAnimationEnabled}
transition={defaultSpringTransition}
>
Integrate with your existing test automation process
</AnimatedHeader>
<AnimatedHeader isAnimationEnabled={isAnimationEnabled} headerLevel={3} delay={0.1}>
Integrate ReportPortal with frameworks, bug tracking systems, infrastructure providers
you already use and others so as to streamline the development and testing processes
</AnimatedHeader>
<motion.div
className={getBlocksWith('__link-container')}
{...getButtonAnimation({ isInView, delay: 0.1 })}
>
<Link className="btn btn--outline btn--large" to={`${DOCUMENTATION_URL}/plugins/`}>
See all integrations
</Link>
</motion.div>
</div>
<div className={getBlocksWith('__carousel')}>
<Marquee
className={getBlocksWith('__carousel-marquee')}
speed={25}
gradientWidth="19.27%"
>
{[integrations, integrations].flat().map((slide, index) => (
<div className={getBlocksWith('__carousel-logo')} key={index}>
<img src={slide.icon.url} alt={slide.alt} />
</div>
))}
</Marquee>
return (
<section className={getBlocksWith()} ref={ref}>
<div className="container">
<h2>Integrate with your existing test automation process</h2>
<h3>
Integrate ReportPortal with frameworks, bug tracking systems, infrastructure providers you
already use and others so as to streamline the development and testing processes
</h3>
<div className={getBlocksWith('__link-container')}>
<Link className="btn btn--outline btn--large" to={`${DOCUMENTATION_URL}/plugins/`}>
See all integrations
</Link>
</div>
</section>
);
},
);
</div>
<div className={getBlocksWith('__carousel')}>
<Marquee className={getBlocksWith('__carousel-marquee')} speed={25} gradientWidth="19.27%">
{[integrations, integrations].flat().map((slide, index) => (
<div className={getBlocksWith('__carousel-logo')} key={index}>
<img src={slide.icon.url} alt={slide.alt} />
</div>
))}
</Marquee>
</div>
</section>
);
});

ProcessIntegration.displayName = 'ProcessIntegration';
Loading

0 comments on commit a02c129

Please sign in to comment.