hds-web 1.8.8 → 1.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hds-web",
3
- "version": "1.8.8",
3
+ "version": "1.8.9",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -8,6 +8,7 @@ const imgSizes = {
8
8
  'sm': 'h-10 w-10',
9
9
  'md': 'h-12 w-12 min-w-[48px]',
10
10
  'lg': 'h-[60px] w-[60px]',
11
+ 'xl': 'h-16 w-16',
11
12
  }
12
13
  const AvatarVariant = {
13
14
  'circular': 'shadow rounded-full ',
@@ -23,6 +23,7 @@ const colorVariants = {
23
23
  cyan: 'bg-cyan-200 text-cyan-800 group-hover:bg-cyan-300 ',
24
24
  cyan200: 'bg-cyan-200 text-cyan-600 border border-cyan-400 border border-cyan-400 ',
25
25
  green: 'bg-green-200 text-green-800 group-hover:bg-green-300 ',
26
+ purple500: 'bg-purple-500 shadow-sm'
26
27
  }
27
28
 
28
29
  export default function Badge({
@@ -35,6 +36,7 @@ export default function Badge({
35
36
  size,
36
37
  children,
37
38
  color,
39
+ text_color,
38
40
  onClick
39
41
  }) {
40
42
  const [isClicked, setIsClicked] = useState(false);
@@ -58,7 +60,7 @@ export default function Badge({
58
60
  <Icon height={'h-4 w-4 stroke-[1.5px]'} variant={leftIconVariant} strokeColor={leftIconColor} strokeClass={HDSColor(leftIconColorClass)} />
59
61
  </div>
60
62
  )}
61
- <Typography textStyle='body3c'>{children}</Typography>
63
+ <Typography textStyle='body3c' className={HDSColor(text_color)}>{children}</Typography>
62
64
 
63
65
  {rightIconVariant && rightIconVariant !== 'none' && (
64
66
  <div className='ml-1'>
@@ -7,54 +7,51 @@ import { HDSButton } from "../../Buttons";
7
7
 
8
8
  export default function FeedbackCard(props) {
9
9
  return (
10
- <div className='bg-neutral-0 rounded-3xl shadow p-6 tb-l:p-10'>
11
- <ProfileAvatar
12
- name={props.speakerName}
13
- size='md'
14
- designation={props.speakerDesignation}
15
- imageUrl={props.speakerImgUrl}
16
- avatarVariant="circle"
17
- avatarType="secondary"
18
-
19
- />
20
- <div className={((props.dividerClass) ? "py-8" : "py-6")}>
21
- <Typography textStyle={((props.dividerClass) ? "sub2" : "sub1")} className='text-neutral-1000'>{props.description}</Typography>
22
- </div>
23
- {
24
- props.dividerClass && (
25
- <div className={`${HDSColor(props.dividerClass)} my-2`}></div>
26
- )
27
- }
28
- <div className={"mb-s:flex items-start" + ((props.dividerClass) ? " pt-6" : "mt-0")}>
29
- <div className={"border border-neutral-150 p-2 flex items-center justify-center rounded-2xl" + ((props.dividerClass) ? " w-[72px] h-[56px] min-w-[72px]" : " w-[112px] h-[90px] min-w-[112px]")}>
30
- <img src={props.brandImgUrl} alt={props.brandImgAlt}/>
31
- </div>
32
- <div className={"pt-4 mb-s:pt-0 " + ((props.dividerClass) ? "mb-s:pl-6" : "mb-s:pl-8")}>
33
- <Typography textStyle={((props.dividerClass) ? "body2" : "body1")} className='text-neutral-600 pb-1'>{props.blurb}</Typography>
34
- <a href={props.caseStudyUrl} className="flex">
35
- <HDSButton
36
- label='Read casestudy'
37
- type='secondaryLink'
38
- leftIconVariant='none'
39
- rightIconVariant='none'
40
- state='default'
41
- size='md'
42
- rightAnimatedArrow={true}
43
- rightAnimatedArrowColor='#3970FD'
44
- className='mt-0 justify-start'
45
- btnTextColorClass='text-blue-500'
46
- btnTextHoverClass= 'hover:text-blue-500'
47
- animatedHoverStroke= 'group-hover:stroke-blue-500'
48
- />
49
- </a>
10
+ <div className='bg-neutral-0 rounded-3xl shadow p-6 tb-l:p-10 grid mb-6 db-s:mb-0 last:mb-0 flex-1 max-w-[920px] mx-auto flex-col'>
11
+ <div className=" self-start">
12
+ <ProfileAvatar
13
+ name={props.speakerName}
14
+ size='xl'
15
+ designation={props.speakerDesignation}
16
+ imageUrl={props.speakerImgUrl}
17
+ avatarVariant="circle"
18
+ avatarType="secondary"
19
+ />
20
+ <div className={((props.dividerClass) ? "py-8" : "py-6")}>
21
+ <Typography textStyle='sub1' className='text-neutral-1000'>{props.description}</Typography>
50
22
  </div>
51
-
52
23
  </div>
53
- <div className='pb-8'>
54
-
24
+ <div className=" self-end">
25
+ {
26
+ props.dividerClass && (
27
+ <div className={`${HDSColor(props.dividerClass)} mb-2`}></div>
28
+ )
29
+ }
30
+ <div className={"mb-s:flex items-start" + ((props.dividerClass) ? " pt-6" : "mt-0")}>
31
+ <div className={"border border-neutral-150 p-2 flex items-center justify-center rounded-2xl" + ((props.dividerClass) ? " w-[72px] h-[56px] min-w-[72px]" : " w-[112px] h-[90px] min-w-[112px]")}>
32
+ <img className="max-h-[20px]" src={props.brandImgUrl} alt={props.brandImgAlt}/>
33
+ </div>
34
+ <div className={"pt-4 mb-s:pt-0 " + ((props.dividerClass) ? "mb-s:pl-6" : "mb-s:pl-8")}>
35
+ <Typography textStyle={((props.dividerClass) ? "body2" : "body1")} className='text-neutral-600 pb-1'>{props.blurb}</Typography>
36
+ <a href={props.caseStudyUrl} className="flex">
37
+ <HDSButton
38
+ label='Read casestudy'
39
+ type='secondaryLink'
40
+ leftIconVariant='none'
41
+ rightIconVariant='none'
42
+ state='default'
43
+ size='md'
44
+ rightAnimatedArrow={true}
45
+ rightAnimatedArrowColor='#3970FD'
46
+ className='mt-0 justify-start'
47
+ btnTextColorClass='text-blue-500'
48
+ btnTextHoverClass= 'hover:text-blue-500'
49
+ animatedHoverStroke= 'group-hover:stroke-blue-500'
50
+ />
51
+ </a>
52
+ </div>
53
+ </div>
55
54
  </div>
56
-
57
-
58
55
  </div>
59
56
  )
60
57
  }
@@ -0,0 +1,27 @@
1
+ export default function imageBadgeCard (card){
2
+
3
+ return(
4
+ <>
5
+ <div className={`${HDSColor(card.cardBg)}bg-neutral-0 max-w-[700px] min-h-[245px] rounded-3xl p-8`}>
6
+ <div className='flex flex-row justify-between gap-4'>
7
+
8
+
9
+ <div className='max-w-[400px]'>
10
+
11
+ <Badges
12
+ color={card.badge.color}
13
+ children={card.badge.label}
14
+ text_color='text-neutral-0'
15
+ />
16
+ <Typography textStyle='h4' className='mt-2 text-neutral-1000'>{card.title}</Typography>
17
+ <Typography textStyle='sub2' className='mt-2 text-neutral-600'>{card.subTitle}</Typography>
18
+ </div>
19
+ <div>
20
+ <img src={card.imageUrl} alt={card.title} className='max-w-[290px] max-h-[181px]' />
21
+
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </>
26
+ )
27
+ }
@@ -26,8 +26,8 @@ export default function Testimonial(props) {
26
26
  return (
27
27
  <>
28
28
  <div className={`${HDSColor(card.cardBg)} bg-neutral-1000/40 rounded-2xl max-w-[220px] min-h-[441px] flex flex-col justify-between `}>
29
- <div className="mt-8">
30
- <div className="max-w-[64px] pt-8 pl-6">
29
+ <div className="">
30
+ <div className=" pt-8 pl-6">
31
31
  <img src="https://res.cloudinary.com/dh8fp23nd/image/upload/v1686737531/hasura-design-system/icons/optum_zn0bhw.png" alt="Card" className=" inline-block w-16 " />
32
32
  </div>
33
33
 
@@ -36,7 +36,7 @@ export default function Testimonial(props) {
36
36
  </div>
37
37
  <div className="pl-6 pb-8">
38
38
  <img
39
- className={` w-14 h-14 shadow rounded-full ${HDSColor(card.avatar.avatarBgColor)} rounded inline-block`}
39
+ className={` w-14 h-14 shadow rounded-full ${HDSColor(card.avatar['avatarBgColor'])} rounded inline-block`}
40
40
  alt='avatar'
41
41
  src={card.img_url}
42
42
  />
@@ -56,10 +56,10 @@ export default function Testimonial(props) {
56
56
  <div className="max-h-[441px]">
57
57
  <div className={`${HDSColor(cardHover.cardBg)} bg-blue-500 rounded-2xl max-w-[221px] justify-between h-[442px] flex flex-col`}>
58
58
  <div className=" ">
59
- <div className="max-w-[148px] pt-8 pl-6 ">
60
- <img src="https://res.cloudinary.com/dh8fp23nd/image/upload/v1685596743/website%20v3/capabilities-pre-footer_qxqlon.png" alt="Card" className=" inline-block max-w-[150px] h-[18.52px] pl-6 pr-12 pt-8" />
59
+ <div className="pt-8 pl-6 pr-12 ">
60
+ <img src="https://res.cloudinary.com/dh8fp23nd/image/upload/v1686760719/website%20v3/hascon_t5kwrf.png" alt="Card" className=" inline-block w-full" />
61
61
  </div>
62
- <div className="mt-6 px-6 font-petrona text-base font-normal text-neutral-0">{cardHover.title}</div>
62
+ <div className="mt-6 px-6 text-xl leading-[27px] font-semibold text-neutral-0">{cardHover.title}</div>
63
63
 
64
64
  </div>
65
65
  <div className="flex pb-8 pl-6 pt-5">
@@ -85,6 +85,7 @@ export default function Testimonial(props) {
85
85
  onMouseEnter={handleMouseEnter}
86
86
  onMouseLeave={handleMouseLeave}
87
87
  >
88
+
88
89
  <div className={`transition-all max-w-[220px] fixed ease-in-out duration-300 ${isHovered ? 'opacity-0 ' : 'opacity-100'}`}>
89
90
  <Card1 />
90
91
  </div>
@@ -98,6 +99,7 @@ export default function Testimonial(props) {
98
99
  Testimonial.defaultProps = {
99
100
  card: {
100
101
  cardBg: '',
102
+ img_url: 'https://res.cloudinary.com/dh8fp23nd/image/upload/v1679302435/main-web/roadshow/nagaraja-nayak_l4xte5.png',
101
103
  title_img: "Optum",
102
104
  img_alt: 'optum',
103
105
  subtitle: '“Optum goes from concept to production in 100 days with Hasura”',
@@ -110,7 +112,7 @@ Testimonial.defaultProps = {
110
112
  },
111
113
  cardHover: {
112
114
  cardBg: 'bg-green-500',
113
- img_url: '',
115
+ img_url:'',
114
116
  img_alt: '',
115
117
  title: 'Optum goes from concept to production in 100 days with Hasura',
116
118
  button: {
@@ -1,43 +1,31 @@
1
1
  import React, { useState } from 'react';
2
- import { MediaBox } from '../../../helpers/Media';
3
2
  import { Testimonial } from '../Testimonials';
4
3
 
5
4
  export default function HomeVC(props) {
6
-
7
-
8
5
  return (
9
6
  <>
10
-
11
7
  <div className='carouselShadow'>
12
8
  <div className='w-[643.51px] h-[472.64px] bg-base-1000 rounded-2xl flex flex-col items-center justify-center border-2 border-neutral-300'>
13
-
14
- {/* <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
15
- <div className='relative bg-neutral-0 w-full h-full'></div>
16
- <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
17
- </div>
18
- <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
19
- <div className='relative bg-neutral-0 w-full h-full'></div>
20
- <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
21
- </div>
22
- <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
23
- <div className='relative bg-neutral-0 w-full h-full'></div>
24
- <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
25
- </div> */}
26
- <div className='relative'>
9
+ <div className='absolute'>
27
10
  <div>
28
11
  <video
29
-
30
- autoPlay={true}
31
- className="object-contain max-w-full max-h-full"
32
- src='https://nutrien-prod-asset.s3.us-east-2.amazonaws.com/s3fs-public/video-thumbnails/2019-05/Nutrien-Banner-Loop-V4.mp4 ' />
12
+ autoPlay
13
+ loop
14
+ className="object-contain max-w-full max-h-full px-1"
15
+ src={props.video_url}
16
+ />
33
17
  </div>
34
- <div className='relative -top-[400px] left-[410px] filter-[16px]'>
18
+ <div className='fixed top-[15px] left-[415px] filter-[16px]'>
35
19
 
36
- <Testimonial />
20
+ <Testimonial {...props.testimonial}/>
37
21
  </div>
38
22
  </div>
39
23
  </div>
40
24
  {/* <div className='relative mx-auto top-[442.72px] w-[151.7px] h-[3.1px] bg-neutral-0/20' /> */}
41
25
  </div>
42
26
  </>)
27
+ }
28
+
29
+ HomeVC.defaultProps= {
30
+
43
31
  }
@@ -0,0 +1,193 @@
1
+ import React from "react";
2
+ import { useRef, useState } from "react";
3
+ import { Icon } from "../common-components/Icon";
4
+ import { HDSButton } from "../Buttons";
5
+ export default function CustomCarousel(props) {
6
+ const carouselRef = useRef(null); // Create a ref using useRef
7
+ const [currentCard, setCurrentCard] = React.useState(0);
8
+ const [touchStart, setTouchStart] = React.useState(0);
9
+ const [touchEnd, setTouchEnd] = React.useState(0);
10
+ const [showAllCards, setShowAllCards] = useState(false);
11
+
12
+ const handleTouchStart = e => {
13
+ setTouchStart(e.targetTouches[0].clientX);
14
+ };
15
+
16
+ const handleTouchMove = e => {
17
+ setTouchEnd(e.targetTouches[0].clientX);
18
+ };
19
+
20
+ const handleTouchEnd = () => {
21
+ if (touchStart - touchEnd > 150) {
22
+ nextCard();
23
+ }
24
+
25
+ if (touchStart - touchEnd < -150) {
26
+ previousCard();
27
+ }
28
+ };
29
+
30
+ const refs = props.cards.reduce((acc, val, i) => {
31
+ acc[i] = React.createRef();
32
+ return acc;
33
+ }, {});
34
+
35
+
36
+
37
+ const totalCards = props.cards.length;
38
+
39
+ const nextCard = () => {
40
+ let scrollByAmount = 1;
41
+
42
+ if (currentCard < totalCards - scrollByAmount) {
43
+ setCurrentCard(currentCard + scrollByAmount);
44
+ carouselRef.current.scrollTo({
45
+ left: carouselRef.current.scrollLeft + carouselRef.current.children[0].offsetWidth * scrollByAmount,
46
+ behavior: "smooth",
47
+ });
48
+ }
49
+ else {
50
+ setCurrentCard(0);
51
+ carouselRef.current.scrollTo({
52
+ left: 0,
53
+ behavior: "smooth",
54
+ });
55
+ }
56
+ };
57
+
58
+ const previousCard = () => {
59
+ let scrollByAmount = 1;
60
+
61
+ if (currentCard > 0) {
62
+ setCurrentCard(currentCard - scrollByAmount);
63
+ carouselRef.current.scrollTo({
64
+ left: carouselRef.current.scrollLeft - carouselRef.current.children[0].offsetWidth * scrollByAmount,
65
+ behavior: "smooth",
66
+ });
67
+ } else {
68
+ const lastCardIndex = totalCards - 1;
69
+ const scrollLeft = carouselRef.current.scrollWidth - carouselRef.current.children[0].offsetWidth * scrollByAmount;
70
+ setCurrentCard(lastCardIndex);
71
+ carouselRef.current.scrollTo({
72
+ left: scrollLeft,
73
+ behavior: "smooth",
74
+ });
75
+ }
76
+ };
77
+
78
+ const maxVisibleCards = 6;
79
+
80
+ const arrowStyle = ' text-2xl z-10 bg-black h-10 ml-6 w-10 rounded-full bg-neutral-0 shadow hover:bg-neutral-0 flex items-center justify-center';
81
+
82
+ const sliderControl = isLeft => (
83
+ <button
84
+ type="button"
85
+ onClick={isLeft ? previousCard : nextCard}
86
+ className={`flex ${arrowStyle} ${isLeft ? '' : ''}`}
87
+
88
+ >
89
+ <span role="img" aria-label={`Arrow ${isLeft ? 'left' : 'right'}`}>
90
+ {isLeft ?
91
+
92
+ <Icon height={'h-6 w-6'} variant={'chevronleft'} strokeColor='#00288E' />
93
+
94
+ :
95
+
96
+ <Icon height={'h-6 w-6'} variant={'chevronright'} strokeColor='#00288E' />
97
+
98
+ }
99
+ </span>
100
+ </button>
101
+ );
102
+ return (
103
+ <div className="">
104
+ <div className="block tb:hidden">
105
+ {showAllCards
106
+ ? props.cards.map((item, i) => (
107
+ <div className="my-5" key={i} ref={refs[i]}>
108
+ <div className="rounded-3xl overflow-hidden">
109
+ {React.createElement(props.component, item)}
110
+ </div>
111
+ </div>
112
+ ))
113
+ : props.cards.slice(0, maxVisibleCards).map((item, i) => (
114
+ <div className="my-5" key={i} ref={refs[i]}>
115
+ <div className="rounded-3xl overflow-hidden">
116
+ {React.createElement(props.component, item)}
117
+ </div>
118
+ </div>
119
+ ))}
120
+ {props.cards.length > maxVisibleCards && (
121
+ <div className="flex">
122
+ <HDSButton
123
+ label={showAllCards ? "View less" : "View more"}
124
+ type='secondary'
125
+ leftIconVariant='none'
126
+ rightIconVariant='none'
127
+ state='default'
128
+ size='sm'
129
+ rightAnimatedArrow={true}
130
+ rightAnimatedArrowColor='#1E56E3'
131
+ animatedHoverStroke='group-hover:stroke-neutral-0'
132
+ className='flex'
133
+ btnTextColorClass='text-blue-600'
134
+ btnBgColorClass=''
135
+ onClick={() => setShowAllCards(!showAllCards)}
136
+ />
137
+ {/* <button
138
+ className="text-blue-500 mt-1 cursor-pointer"
139
+ onClick={() => setShowAllCards(!showAllCards)}
140
+ >
141
+ {showAllCards ? "View less" : "View more"}
142
+ </button> */}
143
+ </div>
144
+ )}
145
+ </div>
146
+
147
+
148
+ <div className="hidden tb:flex tb:flex-col-reverse">
149
+ <div className="flex items-center justify-center mt-10">
150
+ {/* {slider()} */}
151
+ <div className="flex">
152
+ {sliderControl(true)}
153
+ {sliderControl()}
154
+ </div>
155
+ </div>
156
+ <div className="justify-center select-none items-center"
157
+ onTouchStart={handleTouchStart}
158
+ onTouchMove={handleTouchMove}
159
+ onTouchEnd={handleTouchEnd}
160
+ onMouseDown={e => setTouchStart(e.clientX)}
161
+ onMouseUp={e => {
162
+ if (touchStart - e.clientX > 50) {
163
+ nextCard();
164
+ }
165
+
166
+ if (touchStart - e.clientX < -50) {
167
+ previousCard();
168
+ }
169
+ }}
170
+ >
171
+ <div className="">
172
+ <div className={`snap-x w-full inline-flex select-none overflow-x-hidden scrollbar-hide`}
173
+ ref={carouselRef}
174
+ >
175
+
176
+ {props.cards.map((item, i) => (
177
+ // <div className="max-[1140px]:snap-always tb:snap-always mx-5 max-[1140px]:shrink-0" key={i} ref={refs[i]}>
178
+ <div className=" snap-center mx-5 shrink-0" key={i} ref={refs[i]}>
179
+ <div className="w-full select-none rounded-3xl object-contain">
180
+ {React.createElement(props.component, item)}
181
+ </div>
182
+
183
+ </div>
184
+ ))}
185
+
186
+ </div>
187
+ </div>
188
+ </div>
189
+ </div>
190
+
191
+ </div>
192
+ );
193
+ };
@@ -127,6 +127,97 @@ const carouselItems2 = [
127
127
  size: 'w-full'
128
128
  }
129
129
  ];
130
+
131
+ const video_props =
132
+ [
133
+ {
134
+ // video_url: 'https://nutrien-prod-asset.s3.us-east-2.amazonaws.com/s3fs-public/video-thumbnails/2019-05/Nutrien-Banner-Loop-V4.mp4',
135
+ video_url: 'https://res.cloudinary.com/dh8fp23nd/video/upload/v1654760488/samples/sea-turtle.mp4',
136
+
137
+ testimonial: {
138
+ card: {
139
+ cardBg: '',
140
+ title_img: "Optum",
141
+ img_alt: 'optum',
142
+ subtitle: '“Optum goes from concept to production in 100 days with Hasura”',
143
+ avatar: {
144
+ img_url: '',
145
+ name: 'Nagaraja Nayak',
146
+ designation: 'Optum',
147
+ avatarBgColor: 'bg-yellow-400'
148
+ }
149
+ },
150
+ cardHover: {
151
+ cardBg: 'bg-green-500',
152
+ img_url: 'https://res.cloudinary.com/dh8fp23nd/image/upload/v1679302435/main-web/roadshow/nagaraja-nayak_l4xte5.png',
153
+ img_alt: '',
154
+ title: 'Optum goes from concept to production in 100 days with Hasura',
155
+ button: {
156
+ cta_text: 'Read the case Study'
157
+ }
158
+
159
+
160
+ }
161
+ }
162
+ },
163
+ {
164
+ video_url: 'https://res.cloudinary.com/dh8fp23nd/video/upload/v1654760488/samples/sea-turtle.mp4',
165
+
166
+ testimonial: {
167
+ card: {
168
+ cardBg: '',
169
+ title_img: "Optum",
170
+ img_alt: 'optum',
171
+ subtitle: '“Optum goes from concept to production in 100 days with Hasura”',
172
+ avatar: {
173
+ img_url: 'https://res.cloudinary.com/dh8fp23nd/image/upload/v1679302435/main-web/roadshow/nagaraja-nayak_l4xte5.png',
174
+ name: 'Nagaraja Nayak',
175
+ designation: 'Optum',
176
+ avatarBgColor: 'bg-yellow-400'
177
+ }
178
+ },
179
+ cardHover: {
180
+ cardBg: 'bg-green-500',
181
+ img_url: '',
182
+ img_alt: '',
183
+ title: 'Optum goes from concept to production in 100 days with Hasura',
184
+ button: {
185
+ cta_text: 'Read the case Study'
186
+ }
187
+
188
+
189
+ }
190
+ }
191
+ },
192
+ {
193
+ video_url: 'https://res.cloudinary.com/dh8fp23nd/video/upload/v1654760488/samples/sea-turtle.mp4',
194
+ testimonial: {
195
+ card: {
196
+ cardBg: '',
197
+ title_img: "Optum",
198
+ img_alt: 'optum',
199
+ subtitle: '“Optum goes from concept to production in 100 days with Hasura”',
200
+ avatar: {
201
+ img_url: 'https://res.cloudinary.com/dh8fp23nd/image/upload/v1679302435/main-web/roadshow/nagaraja-nayak_l4xte5.png',
202
+ name: 'Nagaraja Nayak',
203
+ designation: 'Optum',
204
+ avatarBgColor: 'bg-yellow-400'
205
+ }
206
+ },
207
+ cardHover: {
208
+ cardBg: 'bg-green-500',
209
+ img_url: '',
210
+ img_alt: '',
211
+ title: 'Optum goes from concept to production in 100 days with Hasura',
212
+ button: {
213
+ cta_text: 'Read the case Study'
214
+ }
215
+
216
+
217
+ }
218
+ }
219
+ },
220
+ ]
130
221
  const SideCard = () => (
131
222
  <div className="h-full">
132
223
 
@@ -140,13 +231,13 @@ const SideCard = () => (
140
231
  </div>
141
232
  </div>
142
233
  )
143
- export default function HomePageCarousel2(props) {
234
+ export default function HomePageCarousePrimary(props) {
144
235
  const {
145
236
  cards = carouselItems,
146
237
  cards2 = carouselItems2,
147
238
  } = props;
148
239
 
149
- const [boolean, setBoolean] = React.useState(false);
240
+ const [boolean, setBoolean] = React.useState(null);
150
241
  const carouselRef = useRef(null); // Create a ref using useRef
151
242
  const carouselRef2 = useRef(null); // Create a ref using useRef
152
243
  const [currentCard, setCurrentCard] = React.useState(0);
@@ -193,14 +284,17 @@ export default function HomePageCarousel2(props) {
193
284
 
194
285
  const previousCard = () => {
195
286
  let scrollByAmount = 1;
196
-
197
-
287
+ let scrollByAmount2 = 5;
198
288
  if (currentCard > 0) {
199
289
  setCurrentCard(currentCard - scrollByAmount);
200
290
  carouselRef.current.scrollTo({
201
291
  left: carouselRef.current.scrollLeft - carouselRef.current.children[0].offsetWidth * scrollByAmount,
202
292
  behavior: "smooth",
203
293
  });
294
+ carouselRef2.current.scrollTo({
295
+ left: carouselRef2.current.scrollLeft - carouselRef2.current.children[0].offsetWidth * scrollByAmount2,
296
+ behavior: "smooth",
297
+ });
204
298
  } else {
205
299
  const lastCardIndex = totalCards - 1;
206
300
  const scrollLeft = carouselRef.current.scrollWidth - carouselRef.current.children[0].offsetWidth * scrollByAmount;
@@ -209,6 +303,12 @@ export default function HomePageCarousel2(props) {
209
303
  left: scrollLeft,
210
304
  behavior: "smooth",
211
305
  });
306
+ const scrollLeft2 = carouselRef2.current.scrollWidth - carouselRef2.current.children[0].offsetWidth * scrollByAmount2;
307
+ setCurrentCard(lastCardIndex);
308
+ carouselRef.current.scrollTo({
309
+ left: scrollLeft2,
310
+ behavior: "smooth",
311
+ });
212
312
  }
213
313
  };
214
314
 
@@ -267,10 +367,10 @@ export default function HomePageCarousel2(props) {
267
367
  <div className={`snap-x w-[643px] h-[800px] items-center bg-neutral-0 z-10 inline-flex select-none overflow-x-hidden scrollbar-hide`}
268
368
  ref={carouselRef}
269
369
  >
270
- {cards.map((item, i) => (
271
- <div className=" db:snap-center snap-center tb-m:snap-start mx-5 " key={i + 'cards1'} ref={refs[i]}>
370
+ {video_props.map((item, i) => (
371
+ <div className=" db:snap-center snap-center tb-m:snap-start mx-5 " key={i } ref={refs[i]}>
272
372
  <div className=" select-none rounded-3xl object-contain ">
273
- <VideoCard />
373
+ {React.createElement(VideoCard, item)}
274
374
  </div>
275
375
 
276
376
  </div>
@@ -284,7 +384,7 @@ export default function HomePageCarousel2(props) {
284
384
  >
285
385
 
286
386
  {cards.map((item, i) => {
287
-
387
+
288
388
  // toggleBoolean();
289
389
  return (
290
390
  <>
@@ -300,7 +400,7 @@ export default function HomePageCarousel2(props) {
300
400
  </div>
301
401
  </div>
302
402
  <div
303
- className={`${isScrollActive && i % 2 === 0 ? '' : ''} transition-all duration-[1500ms] z-[1] snap-center tb-m:snap-start mx-5 `}
403
+ className={`${isScrollActive ? ' opacity-0' : ''} transition-all duration-[1500ms] z-[1] snap-center tb-m:snap-start mx-5 `}
304
404
  key={i + 'y'}
305
405
  ref={refs2[i]}
306
406
  >
@@ -1,4 +1,5 @@
1
1
  export {default as Carousel} from './carousel';
2
2
  export {default as CarouselCard} from './carouselCard';
3
3
  export {default as HomepageCarousel} from './homepageCarousel';
4
- export {default as HomepageCarousel2} from './homeCarousel2';
4
+ export {default as HomepageCarouselPrimary} from './homeCarousel';
5
+ export {default as CustomCarousel} from './customCarousel';