Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. //import FormSwitch from '../components/shared/FormSwitch';
  2. import PageHeading from './../components/shared/PageHeading';
  3. import SocialNetworks from '../components/shared/SocialNetworks';
  4. import Contact from '../components/shared/Contact';
  5. import BlogSection from '../components/BlogSection';
  6. import WhyUsCard from '../components/WhyUsCard';
  7. import HiringWidget from '../components/HiringWidget';
  8. import Animation_Diligent from '../assets/animation_diligent.webm';
  9. import '../styles/buttons.css';
  10. import '../styles/cards.css';
  11. //import bg_home from '../assets/logos/bg_home.png';
  12. //import post_1 from '../assets/logos/post_1.png';
  13. import { motion } from 'framer-motion';
  14. import { useState, useEffect, useRef, useLayoutEffect, useContext } from 'react';
  15. import axios from 'axios';
  16. import OrbitOnScroll from '../components/shared/graphics/OrbitOnScroll';
  17. import LandingSVG from '../components/shared/graphics/LandingSVG';
  18. import ServicesHome from '../components/ServicesHome';
  19. import Testimonials from '../components/Testimonials';
  20. import LandingSVGv2 from '../components/shared/graphics/LandingSVG-v2';
  21. import Landing from '../components/Landing';
  22. import WhySection from '../components/WhySection';
  23. import ProcessSection from '../components/ProcessSection';
  24. import TechStack from '../components/TechStack';
  25. import PortfolioSection from '../components/PortfolioSection';
  26. import PageLayout from '../layout/PageLayout';
  27. import MapDilig from '../components/Map';
  28. import useDataApi from '../hooks/useDataApi';
  29. //const api_url = process.env.REACT_APP_API_URL;
  30. const api_url = 'http://localhost:1337';
  31. //const query = '';
  32. const strapiPopulate = [
  33. 'Cards',
  34. 'Cards.Card1',
  35. 'Cards.Card1.Icon',
  36. 'Cards.Card2',
  37. 'Cards.Card2.Icon',
  38. 'Cards.Card3',
  39. 'Cards.Card3.Icon',
  40. 'HeroNumbers',
  41. 'HeroNumbers.number',
  42. ]
  43. const stringBuilder = () => {
  44. let stringQuery = '';
  45. strapiPopulate.map((item,index) => {
  46. if (index !== 0) stringQuery += '&';
  47. stringQuery += `populate=${item}`;
  48. });
  49. return stringQuery;
  50. };
  51. export default function Home({forwardedRef}) {
  52. const [cnt, setCnt] = useState('');
  53. const [contactRef, setRef] = useState(forwardedRef)
  54. const [{data, isLoading, isError}, doFetch] = useDataApi(`${api_url}/api/w-home-page?${stringBuilder()}`);
  55. const landingData = {
  56. data
  57. }
  58. useEffect(() => {
  59. document.title = 'Diligent Software';
  60. },[]);
  61. useEffect(() => {
  62. console.log(data);
  63. //stringBuilder();
  64. },[data]);
  65. // useEffect(() => {
  66. // var vid = document.getElementById('animation');
  67. // vid.playbackRate = 2;
  68. // axios
  69. // .get(
  70. // `${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`,
  71. // // 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
  72. // )
  73. // .then(res => {
  74. // setCnt(res.data.data.attributes);
  75. // //console.log(res)
  76. // setIsLoaded(true);
  77. // })
  78. // .catch(err => {
  79. // console.log(err);
  80. // setIsLoaded(false);
  81. // });
  82. // }, []);
  83. useEffect(() => {
  84. const url = window.location.pathname;
  85. const h = window.document.body.offsetHeight;
  86. }, [contactRef, cnt])
  87. if (isLoading) {
  88. return (
  89. <div className="z-50 w-full h-screen bg-white dark:bg-dg-primary-1700 overflow-hidden dark:text-white flex items-center justify-center text-3xl font-semibold">
  90. <video id="animation" width="540" height="540" autoPlay muted loop>
  91. <source src={Animation_Diligent} type="video/webm" />
  92. Loading...
  93. </video>
  94. </div>
  95. );
  96. } else {
  97. return (
  98. <PageLayout>
  99. <div className="bg-white dark:bg-dg-primary-1700 w-full pt-32 overflow-hidden">
  100. {/* <FormSwitch /> */}
  101. {/* <Tab.Group>
  102. <Tab.List>
  103. <Tab>Tab 1</Tab>
  104. <Tab>Tab 2</Tab>
  105. </Tab.List>
  106. <Tab.Panels>
  107. <Tab.Panel><ClientForm /></Tab.Panel>
  108. <Tab.Panel><JobForm /></Tab.Panel>
  109. </Tab.Panels>
  110. </Tab.Group> */}
  111. {/* Landing Section */}
  112. <Landing />
  113. {/* Why Us Section */}
  114. <WhySection data={cnt.why} />
  115. {/* Our Services Section */}
  116. {/* <ServicesHome /> */}
  117. {/* Our Process Section */}
  118. <ProcessSection />
  119. {/* Our Process Section */}
  120. <TechStack />
  121. {/* Testimonials Section*/}
  122. <Testimonials
  123. />
  124. {/* Social Networks Section */}
  125. {/* <section
  126. id="socials"
  127. className="h-fit bg-white dark:bg-dg-primary-1700 flex flex-col items-center px-4"
  128. >
  129. <SocialNetworks />
  130. </section> */}
  131. <PortfolioSection />
  132. {/* Contact Section */}
  133. <section id="contact" className="" ref={forwardedRef}>
  134. <Contact defaultIndex={0} />
  135. </section>
  136. <MapDilig />
  137. </div>
  138. </PageLayout>
  139. );
  140. }
  141. }