Ver código fonte

home headings

blog-new
Pavle Golubovic 3 anos atrás
pai
commit
976473b09a

+ 3
- 3
frontend/src/components/PortfolioSection.jsx Ver arquivo

], ],
}; };


function PortfolioSection() {
function PortfolioSection({heading,cta}) {
const linkTo = useNavigate(); const linkTo = useNavigate();


return ( return (
<Wrapper padding={' py-90p'} bg> <Wrapper padding={' py-90p'} bg>
<div className="py-32p"> <div className="py-32p">
<PageTitle left heading={'Case Studies'} subheading={'our Work'} />
<PageTitle left heading={heading.title} subheading={heading.subtitle} />
</div> </div>


<div className="flex flex-col lg:flex-row justify-center items-center lg:justify-between gap-8"> <div className="flex flex-col lg:flex-row justify-center items-center lg:justify-between gap-8">
> >
<img src={item.imgUrl} alt={item.alt} className={'mb-12'}></img> <img src={item.imgUrl} alt={item.alt} className={'mb-12'}></img>
<h3 className="h3-heading">{item.title}</h3> <h3 className="h3-heading">{item.title}</h3>
<button className="btn text-dg-secondary mt-4">Read More</button>
<button className="btn text-dg-secondary mt-4">{cta}</button>
</a> </a>
))} ))}
</div> </div>

+ 42
- 45
frontend/src/components/ProcessSection.jsx Ver arquivo

import React, { useEffect, useState } from 'react'
import PageTitle from './shared/PageTitle'
import {ReactComponent as ProcessSvg} from './../assets/images/Process.svg';
import React, { useEffect, useState } from 'react';
import PageTitle from './shared/PageTitle';
import { ReactComponent as ProcessSvg } from './../assets/images/Process.svg';
import Wrapper from '../layout/Wrapper'; import Wrapper from '../layout/Wrapper';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import ProcessSlider from './ProcessSlider'; import ProcessSlider from './ProcessSlider';
import { useWindowInfo } from '@faceless-ui/window-info'; import { useWindowInfo } from '@faceless-ui/window-info';
import useWindowSize from '../hooks/useWindowSize'; import useWindowSize from '../hooks/useWindowSize';



const _data = { const _data = {
heading: "How We Do It",
subheading: "Our process",
imgUrl: "",
btn: "check it out"
}
heading: 'How We Do It',
subheading: 'Our process',
imgUrl: '',
btn: 'check it out',
};


const ProcessSection = () => {
const api_url = process.env.REACT_APP_API_URL;


const ProcessSection = ({ image, imageAlt, heading, btn, mobileImages }) => {
const [isMobile, setIsMobile] = useState(false); const [isMobile, setIsMobile] = useState(false);


const windowInfo = useWindowSize(); const windowInfo = useWindowSize();


useEffect(() => { useEffect(() => {
//console.log(windowInfo.width); //console.log(windowInfo.width);
if (windowInfo.width < 1000)
setIsMobile(true);
else
setIsMobile(false);
},[windowInfo]);
if (windowInfo.width < 1000) setIsMobile(true);
else setIsMobile(false);
}, [windowInfo]);


const link = useNavigate(); const link = useNavigate();


return ( return (
<Wrapper padding={" py-90p"} hideOverflow>
<div className='w-full'>
<PageTitle heading={_data.heading} subheading={_data.subheading} color left />
</div>
<div className="relative mx-auto my-32p md:my-90p">
{!isMobile ? (
<div className='w-full' draggable >
<ProcessSvg className='' />
</div>
) :
(
<div className='' >
<ProcessSlider/>
</div>
)
}
<Wrapper padding={' py-90p'} hideOverflow>
<div className="w-full">
{heading ? (
<PageTitle
heading={heading.title}
subheading={heading.subtitle}
color
left
/>
) : null}
</div>

<div className="relative mx-auto my-32p md:my-90p">
{!isMobile ? (
<div className="w-full">
{image ? <img src={api_url + image.data.attributes.url} alt={image.data.attributes.alternativeText}></img> : null}
</div> </div>
<div className='flex justify-center w-full'>
<button className="btn-secondary" onClick={()=>link('/process')}>{_data.btn}</button>
) : (
<div className="">
<ProcessSlider images={mobileImages.data} />
</div> </div>
)}
</div>
<div className="flex justify-center w-full">
<button className="btn-secondary" onClick={() => link('/process')}>
{btn}
</button>
</div>
</Wrapper> </Wrapper>
)
}
);
};


export default ProcessSection
export default ProcessSection;

+ 2
- 2
frontend/src/components/ProcessSlider.jsx Ver arquivo

import ProcessSliderWrapper from './shared/ProcessSliderWrapper' import ProcessSliderWrapper from './shared/ProcessSliderWrapper'
import ProcessFacelessSlider from './shared/ProcessFacelessSlider' import ProcessFacelessSlider from './shared/ProcessFacelessSlider'


const ProcessSlider = props => {
const ProcessSlider = ({images}) => {
return ( return (
<> <>
<ProcessSliderWrapper> <ProcessSliderWrapper>
<ProcessFacelessSlider/>
<ProcessFacelessSlider images={images}/>
</ProcessSliderWrapper> </ProcessSliderWrapper>
</> </>

+ 3
- 3
frontend/src/components/TechStack.jsx Ver arquivo

paragraph: "And many more..." paragraph: "And many more..."
} }


function TechStack() {
function TechStack({heading, btn}) {
return ( return (
<Wrapper bg padding={" py-90p"}> <Wrapper bg padding={" py-90p"}>
<div className='flex flex-col gap-90p justify-center items-center'> <div className='flex flex-col gap-90p justify-center items-center'>
<div className='w-full'> <div className='w-full'>
<PageTitle heading={_data.heading} subheading={_data.subheading} left />
<PageTitle heading={heading.title} subheading={heading.subtitle} left />
</div> </div>
<div className='w-full'> <div className='w-full'>
<StackWrapper /> <StackWrapper />
</div> </div>
<p className='paragraph'>{_data.paragraph}</p>
<p className='paragraph'>{btn}</p>
</div> </div>
</Wrapper> </Wrapper>

+ 11
- 11
frontend/src/components/WhySection.jsx Ver arquivo



<motion.section <motion.section
id="why_us" id="why_us"
className=" flex flex-col items-center relative pt-164p pb-240p"
className=" flex flex-col items-center relative pt-64p lg:pt-164p pb-[144px]"
> >
<div className="flex flex-col justify-center items-center gap-90p"> <div className="flex flex-col justify-center items-center gap-90p">
<div className="max-w-[780px]"> <div className="max-w-[780px]">
transition={{ delay: 0, default: { duration: 0.45 } }} transition={{ delay: 0, default: { duration: 0.45 } }}
> >
<WhyUsCard <WhyUsCard
image={cards.Card1.Icon.data.attributes.url}
alt={cards.Card1.Icon.data.attributes.alternativeText}
image={cards.Card1.Image.data.attributes.url}
alt={cards.Card1.Image.data.attributes.alternativeText}
heading={cards.Card1.Title} heading={cards.Card1.Title}
paragraph={cards.Card1.paragraph} paragraph={cards.Card1.paragraph}
/> />
transition={{ delay: 0.27, default: { duration: 0.45 } }} transition={{ delay: 0.27, default: { duration: 0.45 } }}
> >
<WhyUsCard <WhyUsCard
image={_data.card_mid.imgUrl}
alt={_data.card_mid.alt}
heading={_data.card_mid.heading}
paragraph={_data.card_mid.paragraph}
image={cards.Card2.Image.data.attributes.url}
alt={cards.Card2.Image.data.attributes.alternativeText}
heading={cards.Card2.Title}
paragraph={cards.Card2.paragraph}
/> />
</motion.div> </motion.div>
{/* Card - right */} {/* Card - right */}
transition={{ delay: 0.54, default: { duration: 0.45 } }} transition={{ delay: 0.54, default: { duration: 0.45 } }}
> >
<WhyUsCard <WhyUsCard
image={_data.card_right.imgUrl}
alt={_data.card_right.alt}
heading={_data.card_right.heading}
paragraph={_data.card_right.paragraph}
image={cards.Card3.Image.data.attributes.url}
alt={cards.Card3.Image.data.attributes.alternativeText}
heading={cards.Card3.Title}
paragraph={cards.Card3.paragraph}
/> />
</motion.div> </motion.div>
</div> </div>

+ 4
- 2
frontend/src/components/shared/PageHeading.jsx Ver arquivo

export default function PageHeading(props) { export default function PageHeading(props) {
return ( return (
<div className="flex flex-col gap-8p items-center justify-center"> <div className="flex flex-col gap-8p items-center justify-center">
<h2 className="subheading">{props.subheading}</h2>
<h3 className="heading text-center">{props.heading}</h3>
<div className="mb-32p lg:mb-64p flex flex-col gap-8p items-center justify-center">
<h2 className="subheading">{props.subheading}</h2>
<h3 className="heading text-center">{props.heading}</h3>
</div>
<div className="flex flex-col gap-16p"> <div className="flex flex-col gap-16p">
<p className="paragraph text-start">{props.paragraph1}</p> <p className="paragraph text-start">{props.paragraph1}</p>
<p className="paragraph text-start">{props.paragraph2}</p> <p className="paragraph text-start">{props.paragraph2}</p>

+ 6
- 4
frontend/src/components/shared/ProcessFacelessSlider.jsx Ver arquivo

import ProcessSvgPart2 from './../../assets/ProcessPart2.svg'; import ProcessSvgPart2 from './../../assets/ProcessPart2.svg';
import ProcessSvgPart3 from './../../assets/ProcessPart3.svg'; import ProcessSvgPart3 from './../../assets/ProcessPart3.svg';


const slides = [ProcessSvgPart1, ProcessSvgPart2, ProcessSvgPart3];
const api_url = process.env.REACT_APP_API_URL;


const ProcessFacelessSlider = props => {
const ProcessFacelessSlider = ({images}) => {

const slides = [images[0].attributes,images[1].attributes, images[2].attributes];
return ( return (
<SliderProvider slidesToShow={1} scrollSnap dragScroll> <SliderProvider slidesToShow={1} scrollSnap dragScroll>
<div className={''}> <div className={''}>
{slides.map((slide, index) => ( {slides.map((slide, index) => (
<Slide key={index} index={index} className={'h-full'}> <Slide key={index} index={index} className={'h-full'}>
<img <img
src={slide}
alt={`step ${index + 1}`}
src={api_url + slide.url}
alt={slide.alternativeText}
className={'h-full mx-auto'} className={'h-full mx-auto'}
></img> ></img>
</Slide> </Slide>

+ 80
- 62
frontend/src/pages/Home.jsx Ver arquivo

import { strapiApiBuilder } from '../utils/strapiApiBuilder'; import { strapiApiBuilder } from '../utils/strapiApiBuilder';


const api_url = process.env.REACT_APP_API_URL; const api_url = process.env.REACT_APP_API_URL;
const fieldArray = [
'landing',
'why',
'why.heading',
'why.card_left.icon',
'why.card_mid.icon',
'why.card_right.icon',
'landing.heading',
// const fieldArray = [
// 'landing',
// 'why',
// 'why.heading',
// 'why.card_left.icon',
// 'why.card_mid.icon',
// 'why.card_right.icon',
// 'landing.heading',
// 'SEO',
// 'SEO.metaSocial',
// 'SEO.metaImage',
// 'SEO.metaSocial.image',
// ];


const strapiPopulate = [
'Heading',
'Heading.subtitle',
'Heading.title',
'WhyUsHeading',
'Cards',
'Cards.Card1',
'Cards.Card1.Image',
'Cards.Card2',
'Cards.Card2.Image',
'Cards.Card3',
'Cards.Card3.Image',
'HeroNumbers',
'HeroNumbers.number',
'ProcessHeading',
'ProcessImage',
'TechStackHeading',
'ProcessMobileImg',
'ProcessMobileImg.Image',
'CaseStudies',
'BusinessInquiry',
'BusinessInquiry.image',
'ApplyPosition',
'ApplyPosition.image',
'Map',
'SEO', 'SEO',
'SEO.metaSocial', 'SEO.metaSocial',
'SEO.metaImage', 'SEO.metaImage',
'SEO.metaSocial.image', 'SEO.metaSocial.image',
]; ];



// const strapiPopulate = [
// 'Heading',
// 'Heading.subtitle',
// 'Heading.title',
// 'WhyUsHeading',
// 'Cards',
// 'Cards.Card1',
// 'Cards.Card1.Icon',
// 'Cards.Card2',
// 'Cards.Card2.Icon',
// 'Cards.Card3',
// 'Cards.Card3.Icon',
// 'HeroNumbers',
// 'HeroNumbers.number',
// ];
const stringBuilder = () => {
let stringQuery = '';
strapiPopulate.map((item, index) => {
if (index !== 0) stringQuery += '&';
stringQuery += `populate=${item}`;
});
return stringQuery;
};


export default function Home({ forwardedRef }) { export default function Home({ forwardedRef }) {
const [cnt, setCnt] = useState(''); const [cnt, setCnt] = useState('');
const [landingData, setLandingData] = useState(null);
const [cardData, setCardData] = useState(null);


const [contactRef, setRef] = useState(forwardedRef); const [contactRef, setRef] = useState(forwardedRef);


const [{ data, isLoading, isError }, doFetch] = useDataApi( const [{ data, isLoading, isError }, doFetch] = useDataApi(
`${api_url}/api/w-home-page?${stringBuilder(fieldArray)}`,
`${api_url}/api/w-home-page?${stringBuilder()}`,
); );
const [contactElement, setContactElement] = useState(0); const [contactElement, setContactElement] = useState(0);




useEffect(() => { useEffect(() => {
console.log(data); console.log(data);
setLandingData(data?.Heading);
}, [data]); }, [data]);


// useEffect(() => {
// var vid = document.getElementById('animation');
// vid.playbackRate = 2;
// axios
// .get(
// `${api_url}/api/homepage?populate[0]=landing&populate[1]=why&populate[2]=why.heading&populate[3]=why.card_left.icon&populate[4]=why.card_mid.icon&populate[5]=why.card_right.icon&populate[6]=why.card_left.icon&populate[7]=why.card_mid.icon&populate[8]=why.card_right.icon&populate[9]=landing.heading`,
// // api/homepage?&populate[0]=why&populate[1]=why.heading&populate[2]=why.card_left.icon&populate[3]=why.card_mid.icon&populate[4]=why.card_right.icon&populate[5]=why.card_left.icon&populate[6]=why.card_mid.icon&populate[7]=why.card_right.icon
// )
// .then(res => {
// setCnt(res.data.data.attributes);
// //console.log(res)
// setIsLoaded(true);
// })
// .catch(err => {
// console.log(err);
// setIsLoaded(false);
// });
// }, []);

useEffect(() => { useEffect(() => {
const url = window.location.pathname; const url = window.location.pathname;
const h = window.document.body.offsetHeight; const h = window.document.body.offsetHeight;
</Tab.Group> */} </Tab.Group> */}


{/* Landing Section */} {/* Landing Section */}
<Landing data={cnt.landing.heading} />
{data ?
<Landing heading={data.Heading} numbers={data.HeroNumbers.number} paragraph={data.paragraph} button={data.button} />
: null
}


{/* Why Us Section */} {/* Why Us Section */}
<WhySection data={cnt.why} />
{data ?
<WhySection heading={data.WhyUsHeading} p1={data.WhyUsParagraph1} p2={data.WhyUsParagraph2} cards={data.Cards} />
: null
}


{/* Our Services Section */} {/* Our Services Section */}
{/* <ServicesHome /> */} {/* <ServicesHome /> */}


{/* Our Process Section */} {/* Our Process Section */}
<ProcessSection />
{data ?
<ProcessSection heading={data.ProcessHeading} btn={data.ProcessCTA} image={data.ProcessImage} mobileImages={data.ProcessMobileImg.Image} />
: null
}


{/* Our Process Section */} {/* Our Process Section */}
<TechStack />
{data ?
<TechStack heading={data.TechStackHeading} btn={data.TechStackCTA} />
: null
}


{/* Testimonials Section*/} {/* Testimonials Section*/}
<Testimonials />

{/* Social Networks Section */}
{/* <section
id="socials"
className="h-fit bg-white dark:bg-dg-primary-1700 flex flex-col items-center px-4"
>
<SocialNetworks />
</section> */}
<PortfolioSection />
{data ?
<Testimonials />
: null
}
{/* Portfolio Section*/}
{data ?
<PortfolioSection heading={data.CaseStudies} cta={data.CtaForCaseStudiesCards} />
: null
}


{/* Contact Section */} {/* Contact Section */}
<section id="contact" className="" ref={forwardedRef}> <section id="contact" className="" ref={forwardedRef}>

Carregando…
Cancelar
Salvar