hds-web 1.8.5 → 1.8.7

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.5",
3
+ "version": "1.8.7",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -14,11 +14,23 @@ const AvatarVariant = {
14
14
  'square': 'rounded-lg',
15
15
  }
16
16
 
17
- export default function ProfileAvatar({avatarBgColor, name, designation, size, imageUrl, avatarVariant }) {
17
+ const ProfileAvatarVariant = {
18
+ 'default': {
19
+ 'titleTextStyle': 'text-hds-m-body2c-bold tb:text-hds-t-body2c-bold db:text-hds-d-body2c-bold',
20
+ 'desgnTextStyle': 'text-hds-m-body3c tb:text-hds-t-body3c db:text-hds-d-body3c'
21
+ },
22
+ 'secondary': {
23
+ 'titleTextStyle': 'text-hds-m-sub2 tb:text-hds-t-sub2 db:text-hds-d-sub2',
24
+ 'desgnTextStyle': 'text-hds-m-body2 tb:text-hds-t-body2 db:text-hds-d-body2'
25
+ }
26
+ }
27
+
28
+ export default function ProfileAvatar({avatarBgColor, name, designation, size, imageUrl, avatarVariant, avatarType }) {
18
29
  const imgSizeClass = imgSizes[size] || imgSizes.md;
19
30
  const avatarVariantClass = AvatarVariant[avatarVariant] || AvatarVariant.circular;
20
31
  const defaultAvatarIcon = "user03";
21
32
  const hasImageUrl = imageUrl && imageUrl.length > 0;
33
+ const AvType = avatarType || 'default';
22
34
 
23
35
  return (
24
36
  <div className="group block flex-shrink-0">
@@ -28,6 +40,7 @@ export default function ProfileAvatar({avatarBgColor, name, designation, size, i
28
40
  <img
29
41
  className={`${imgSizeClass} ${avatarVariantClass} ${HDSColor(avatarBgColor)} rounded inline-block`}
30
42
  src={imageUrl}
43
+ alt={name}
31
44
  />
32
45
  ) : (
33
46
  <Icon
@@ -38,8 +51,8 @@ export default function ProfileAvatar({avatarBgColor, name, designation, size, i
38
51
  )}
39
52
  </div>
40
53
  <div className="ml-3">
41
- <Typography textStyle='body2c-bold' className={` text-neutral-800`}>{name}</Typography>
42
- <Typography textStyle='body3c' className={` text-neutral-500`}>{designation}</Typography>
54
+ <div className={`${ProfileAvatarVariant[AvType]['titleTextStyle']} text-neutral-800`}>{name}</div>
55
+ <div className={`${ProfileAvatarVariant[AvType]['desgnTextStyle']} text-neutral-600`}>{designation}</div>
43
56
  </div>
44
57
  </div>
45
58
  </div>
@@ -1,14 +1,22 @@
1
1
  import React from "react";
2
2
  import { Typography } from '../../../foundation/Typography'
3
3
 
4
+ const Twitter = () => (
5
+ <svg width="26" height="32" viewBox="0 0 26 32" fill="none" xmlns="http://www.w3.org/2000/svg">
6
+ <path d="M8.67602 24.7482C16.8006 24.7482 21.2437 18.0172 21.2437 12.1806C21.2437 11.9893 21.2398 11.7991 21.2309 11.6096C22.0934 10.9861 22.8431 10.208 23.4345 9.32253C22.6431 9.67415 21.7914 9.91094 20.8979 10.0177C21.8098 9.47092 22.5101 8.60557 22.8404 7.5742C21.9868 8.08033 21.0417 8.44812 20.0358 8.64646C19.2294 7.78796 18.0815 7.25098 16.8114 7.25098C14.3718 7.25098 12.3935 9.22924 12.3935 11.6676C12.3935 12.0143 12.4325 12.3513 12.5079 12.6747C8.83714 12.4903 5.58191 10.7325 3.4036 8.06001C3.02381 8.71257 2.80515 9.47116 2.80515 10.2799C2.80515 11.8123 3.58504 13.1652 4.77092 13.9568C4.04637 13.9345 3.36564 13.7352 2.77038 13.4042C2.7694 13.4225 2.7694 13.4411 2.7694 13.4605C2.7694 15.5999 4.29221 17.3859 6.31308 17.7907C5.94211 17.8918 5.55179 17.9462 5.14875 17.9462C4.86421 17.9462 4.58752 17.9178 4.31841 17.8666C4.88062 19.6213 6.51142 20.8985 8.44486 20.9345C6.93283 22.1194 5.02827 22.8253 2.95892 22.8253C2.60265 22.8253 2.25102 22.805 1.90527 22.7641C3.86002 24.0168 6.18109 24.7482 8.67602 24.7482Z" fill="#00acee" />
7
+ </svg>
8
+ )
9
+
4
10
  export default function CommunityCard(props) {
5
11
 
6
- return (
7
- <div className="p-5 tb:p-8 bg-neutral-0 shadow-sm rounded-3xl">
8
- <Typography textStyle="h5" as="h5" className="text-neutral-1000">{props.name}</Typography>
9
- <Typography textStyle="body1-medium" className="text-neutral-500 pb-4">{props.designation}</Typography>
12
+ return (
13
+ <a href={props.linkUrl}>
14
+ <div className="p-5 tb:p-8 bg-neutral-0 shadow-sm rounded-3xl mx-5">
15
+ <Twitter />
16
+ <Typography textStyle="h5" as="h5" className="text-neutral-1000 py-4">{props.name}</Typography>
10
17
  <Typography textStyle="body1" className="text-neutral-500">{props.tweets}</Typography>
11
18
  </div>
12
- )
19
+ </a>
20
+ )
13
21
 
14
22
  }
@@ -2,24 +2,59 @@ import React from "react";
2
2
  import {HDSColor} from '../../../foundation/ColorPalette'
3
3
  import { ProfileAvatar } from '../../Avatars'
4
4
  import { Typography } from '../../../foundation/Typography'
5
+ import { HDSButton } from "../../Buttons";
5
6
 
6
7
 
7
8
  export default function FeedbackCard(props) {
8
9
  return (
9
10
  <div className='bg-neutral-0 rounded-3xl shadow p-6 tb-l:p-10'>
10
- <div className='pb-8'>
11
- <img src={props.brandImgUrl} alt={props.brandImgAlt} className=' h-8 '/>
12
- </div>
13
- <div className="pb-10">
14
- <Typography textStyle="quote" className='text-neutral-1000'>{props.description}</Typography>
15
- </div>
16
11
  <ProfileAvatar
17
12
  name={props.speakerName}
18
13
  size='md'
19
14
  designation={props.speakerDesignation}
20
15
  imageUrl={props.speakerImgUrl}
21
- avatarVariant="square"
16
+ avatarVariant="circle"
17
+ avatarType="secondary"
18
+
22
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>
50
+ </div>
51
+
52
+ </div>
53
+ <div className='pb-8'>
54
+
55
+ </div>
56
+
57
+
23
58
  </div>
24
59
  )
25
60
  }
@@ -0,0 +1,28 @@
1
+ import React, { useState } from 'react';
2
+
3
+ export default function HomeVC(props) {
4
+
5
+
6
+ return (
7
+ <>
8
+
9
+ <div className='carouselShadow'>
10
+ <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'>
11
+ <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
12
+ <div className='relative bg-neutral-0 w-full h-full'></div>
13
+ <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
14
+ </div>
15
+ <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
16
+ <div className='relative bg-neutral-0 w-full h-full'></div>
17
+ <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
18
+ </div>
19
+ <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
20
+ <div className='relative bg-neutral-0 w-full h-full'></div>
21
+ <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
22
+ </div>
23
+
24
+ </div>
25
+ {/* <div className='relative mx-auto top-[442.72px] w-[151.7px] h-[3.1px] bg-neutral-0/20' /> */}
26
+ </div>
27
+ </>)
28
+ }
@@ -0,0 +1 @@
1
+ export { default as VideoCard } from './homeVC';
@@ -8,3 +8,4 @@ export * from './TalkDetailCard';
8
8
  export * from './ImageSlider';
9
9
  export * from './CommunityCard';
10
10
  export * from './Announcement';
11
+ export * from './VideoCard';
@@ -0,0 +1,316 @@
1
+ import React from "react";
2
+ import { useRef, useState } from "react";
3
+ import { Icon } from "../common-components/Icon";
4
+ import { HDSButton } from "../Buttons";
5
+ import { VideoCard } from '../Cards/VideoCard'
6
+ const carouselItems = [
7
+ {
8
+ name: "John Smith",
9
+ designation: "CEO",
10
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
11
+ size: 'w-full'
12
+ },
13
+ {
14
+ name: "Jane Doe",
15
+ designation: "CTO",
16
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
17
+ size: 'w-full'
18
+ },
19
+ {
20
+ name: "Bob Johnson",
21
+ designation: "COO",
22
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
23
+ size: 'w-full'
24
+ },
25
+ {
26
+ name: "Gourav",
27
+ designation: "SDE",
28
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
29
+ size: 'w-full'
30
+ },
31
+ {
32
+ name: "Gourav",
33
+ designation: "SDE",
34
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
35
+ size: 'w-full'
36
+ },
37
+ {
38
+ name: "Gourav",
39
+ designation: "SDE",
40
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
41
+ size: 'w-full'
42
+ },
43
+ {
44
+ name: "Bob Johnson",
45
+ designation: "COO",
46
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
47
+ size: 'w-full'
48
+ },
49
+ {
50
+ name: "Gourav",
51
+ designation: "SDE",
52
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
53
+ size: 'w-full'
54
+ },
55
+ {
56
+ name: "Gourav",
57
+ designation: "SDE",
58
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
59
+ size: 'w-full'
60
+ },
61
+ {
62
+ name: "Gourav",
63
+ designation: "SDE",
64
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
65
+ size: 'w-full'
66
+ }
67
+ ];
68
+ const carouselItems2 = [
69
+ {
70
+ name: "John Smith",
71
+ designation: "CEO",
72
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
73
+ size: 'w-full'
74
+ },
75
+ {
76
+ name: "Jane Doe",
77
+ designation: "CTO",
78
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
79
+ size: 'w-full'
80
+ },
81
+ {
82
+ name: "Bob Johnson",
83
+ designation: "COO",
84
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
85
+ size: 'w-full'
86
+ },
87
+ {
88
+ name: "Gourav",
89
+ designation: "SDE",
90
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
91
+ size: 'w-full'
92
+ },
93
+ {
94
+ name: "Gourav",
95
+ designation: "SDE",
96
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
97
+ size: 'w-full'
98
+ },
99
+ {
100
+ name: "Gourav",
101
+ designation: "SDE",
102
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
103
+ size: 'w-full'
104
+ },
105
+ {
106
+ name: "Bob Johnson",
107
+ designation: "COO",
108
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
109
+ size: 'w-full'
110
+ },
111
+ {
112
+ name: "Gourav",
113
+ designation: "SDE",
114
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
115
+ size: 'w-full'
116
+ },
117
+ {
118
+ name: "Gourav",
119
+ designation: "SDE",
120
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
121
+ size: 'w-full'
122
+ },
123
+ {
124
+ name: "Gourav",
125
+ designation: "SDE",
126
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
127
+ size: 'w-full'
128
+ }
129
+ ];
130
+ const SideCard = () => (
131
+ <div className='bg-green-500 w-[300px] flex flex-col items-center justify-between rounded-3xl max-h-[338px]'>
132
+ <div className='w-[300px] flex justify-center'>
133
+ <img src='https://res.cloudinary.com/dh8fp23nd/image/upload/v1686737531/hasura-design-system/icons/optum_zn0bhw.png' alt='imgb' className='p-5 ' />
134
+ </div>
135
+ <div className='w-[300px] flex justify-center'>
136
+ <img src='https://res.cloudinary.com/dh8fp23nd/image/upload/v1685596743/website%20v3/capabilities-pre-footer_qxqlon.png' alt='imga' className='p-2 w-[194px]' />
137
+ </div>
138
+ </div>
139
+ )
140
+ export default function HomePageCarousel2(props) {
141
+ const {
142
+ cards = carouselItems,
143
+ cards2 = carouselItems2,
144
+ } = props;
145
+
146
+
147
+ const carouselRef = useRef(null); // Create a ref using useRef
148
+ const carouselRef2 = useRef(null); // Create a ref using useRef
149
+ const [currentCard, setCurrentCard] = React.useState(0);
150
+ const refs = cards.reduce((acc, val, i) => {
151
+ acc[i] = React.createRef();
152
+ return acc;
153
+ }, {});
154
+ const refs2 = cards2.reduce((acc, val, i) => {
155
+ acc[i] = React.createRef();
156
+ return acc;
157
+ }, {});
158
+
159
+
160
+
161
+ const totalCards = carouselItems.length;
162
+
163
+ const nextCard = () => {
164
+ let scrollByAmount = 1;
165
+
166
+ if (currentCard < totalCards - scrollByAmount) {
167
+ setCurrentCard(currentCard + scrollByAmount);
168
+ carouselRef.current.scrollTo({
169
+ left: carouselRef.current.scrollLeft + carouselRef.current.children[0].offsetWidth * scrollByAmount,
170
+ behavior: "smooth",
171
+ });
172
+ carouselRef2.current.scrollTo({
173
+ left: carouselRef2.current.scrollLeft + carouselRef2.current.children[0].offsetWidth * scrollByAmount,
174
+ behavior: "smooth",
175
+ });
176
+ }
177
+ else {
178
+ setCurrentCard(0);
179
+ carouselRef.current.scrollTo({
180
+ left: 0,
181
+ behavior: "smooth",
182
+ });
183
+ carouselRef2.current.scrollTo({
184
+ left: 0,
185
+ behavior: "smooth",
186
+ });
187
+ }
188
+ };
189
+
190
+ const previousCard = () => {
191
+ let scrollByAmount = 1;
192
+
193
+
194
+ if (currentCard > 0) {
195
+ setCurrentCard(currentCard - scrollByAmount);
196
+ carouselRef.current.scrollTo({
197
+ left: carouselRef.current.scrollLeft - carouselRef.current.children[0].offsetWidth * scrollByAmount,
198
+ behavior: "smooth",
199
+ });
200
+ } else {
201
+ const lastCardIndex = totalCards - 1;
202
+ const scrollLeft = carouselRef.current.scrollWidth - carouselRef.current.children[0].offsetWidth * scrollByAmount;
203
+ setCurrentCard(lastCardIndex);
204
+ carouselRef.current.scrollTo({
205
+ left: scrollLeft,
206
+ behavior: "smooth",
207
+ });
208
+ }
209
+ };
210
+
211
+ const arrowStyle = ' text-2xl z-10 bg-black h-10 ml-6 w-10 rounded-full bg-purple-200 hover:bg-neutral-0 flex items-center justify-center';
212
+
213
+ const sliderControl = isLeft => (
214
+ <button
215
+ type="button"
216
+ onClick={isLeft ? previousCard : nextCard}
217
+ className={`flex ${arrowStyle} ${isLeft ? '' : ''}`}
218
+
219
+ >
220
+ <span role="img" aria-label={`Arrow ${isLeft ? 'left' : 'right'}`}>
221
+ {isLeft ?
222
+
223
+ <Icon height={'h-6 w-6'} variant={'chevronleft'} strokeColor='#00288E' />
224
+
225
+ :
226
+
227
+ <Icon height={'h-6 w-6'} variant={'chevronright'} strokeColor='#00288E' />
228
+
229
+ }
230
+ </span>
231
+ </button>
232
+ );
233
+ const [isScrollActive, setScrollActive] = useState(false);
234
+
235
+ const handleMouseEnter = () => {
236
+ setScrollActive(true); // Mouse entered, scroll is active
237
+ };
238
+
239
+ const handleMouseLeave = () => {
240
+ setScrollActive(false); // Mouse left, scroll is inactive
241
+ };
242
+ return (
243
+ <div className=""
244
+ onMouseEnter={handleMouseEnter}
245
+ onMouseLeave={handleMouseLeave}
246
+ >
247
+ <div className="hidden tb:flex tb:flex-col-reverse">
248
+ <div className="flex absolute top-[33rem] justify-center items-center">
249
+ {/* {slider()} */}
250
+ <div className="flex w-screen justify-center ">
251
+ {sliderControl(true)}
252
+ {sliderControl()}
253
+ </div>
254
+ </div>
255
+ <div className="justify-center w-screen absolute select-none items-center"
256
+
257
+ >
258
+ <div className="w-screen flex justify-center">
259
+ <div className={`snap-x w-[643px] bg-neutral-0 absolute z-10 inline-flex select-none overflow-x-hidden scrollbar-hide`}
260
+ ref={carouselRef}
261
+ >
262
+
263
+ {cards.map((item, i) => (
264
+ <div className=" db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={i} ref={refs[i]}>
265
+ <div className=" select-none rounded-3xl object-contain ">
266
+ <VideoCard />
267
+ </div>
268
+
269
+ </div>
270
+ ))}
271
+
272
+
273
+ </div>
274
+ <div className={`snap-x w-[1279px] h-screen top-24 absolute inline-flex gap-[9.25rem] select-none overflow-x-hidden scrollbar-hide`}
275
+ ref={carouselRef2}
276
+
277
+ >
278
+
279
+ {cards.map((item, i) => (
280
+ <>
281
+
282
+ <div
283
+ className={`${isScrollActive ? '-translate-y-36' : ''}
284
+ transition-all duration-[1500ms] h-screen db:snap-center z-[1] snap-center tb-m:snap-start mx-5 shrink-0`}
285
+ key={i}
286
+ ref={refs2[i]}
287
+ >
288
+ <div className="select-none rounded-3xl object-contain">
289
+ <SideCard />
290
+ {i}x
291
+ </div>
292
+ </div>
293
+
294
+ <div
295
+ className={`${isScrollActive ? 'translate-y-36' : ''}
296
+ transition-all duration-[1500ms] h-screen db:snap-center z-[1] snap-center tb-m:snap-start mx-5 shrink-0`}
297
+ key={i}
298
+ ref={refs2[i]}
299
+ >
300
+ <div className="select-none rounded-3xl object-contain">
301
+ <SideCard />
302
+ {i}z
303
+ </div>
304
+ </div>
305
+ </>
306
+ ))}
307
+
308
+ </div>
309
+ </div>
310
+ </div>
311
+ </div>
312
+
313
+ </div>
314
+ );
315
+ };
316
+
@@ -5,28 +5,8 @@ import { HDSButton } from "../Buttons";
5
5
  export default function HomePageCarousel(props) {
6
6
  const carouselRef = useRef(null); // Create a ref using useRef
7
7
  const [currentCard, setCurrentCard] = React.useState(0);
8
- const [touchStart, setTouchStart] = React.useState(0);
9
- const [touchEnd, setTouchEnd] = React.useState(0);
10
8
  const [showAllCards, setShowAllCards] = useState(false);
11
9
 
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
10
  const refs = props.cards.reduce((acc, val, i) => {
31
11
  acc[i] = React.createRef();
32
12
  return acc;
@@ -146,8 +126,8 @@ export default function HomePageCarousel(props) {
146
126
  </div>
147
127
 
148
128
 
149
- <div className="hidden tb:flex tb:flex-col">
150
- <div className="flex pb-12 items-center justify-end ">
129
+ <div className="hidden tb:flex tb:flex-col-reverse">
130
+ <div className="flex pt-10 justify-center items-center">
151
131
  {/* {slider()} */}
152
132
  <div className="flex">
153
133
  {sliderControl(true)}
@@ -155,19 +135,7 @@ export default function HomePageCarousel(props) {
155
135
  </div>
156
136
  </div>
157
137
  <div className="justify-center select-none items-center"
158
- onTouchStart={handleTouchStart}
159
- onTouchMove={handleTouchMove}
160
- onTouchEnd={handleTouchEnd}
161
- onMouseDown={e => setTouchStart(e.clientX)}
162
- onMouseUp={e => {
163
- if (touchStart - e.clientX > 50) {
164
- nextCard();
165
- }
166
-
167
- if (touchStart - e.clientX < -50) {
168
- previousCard();
169
- }
170
- }}
138
+
171
139
  >
172
140
  <div className="">
173
141
  <div className={`snap-x w-full inline-flex select-none overflow-x-hidden scrollbar-hide`}
@@ -175,7 +143,6 @@ export default function HomePageCarousel(props) {
175
143
  >
176
144
 
177
145
  {props.cards.map((item, i) => (
178
- // <div className="max-[1140px]:snap-always tb:snap-always mx-5 max-[1140px]:shrink-0" key={i} ref={refs[i]}>
179
146
  <div className=" db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={i} ref={refs[i]}>
180
147
  <div className="w-full select-none rounded-3xl object-contain">
181
148
  {React.createElement(props.component, item)}
@@ -183,6 +150,12 @@ export default function HomePageCarousel(props) {
183
150
 
184
151
  </div>
185
152
  ))}
153
+ <div className="db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={totalCards}>
154
+ <div className="w-full select-none rounded-3xl object-contain">
155
+ {React.createElement(props.component, props.cards[0])}
156
+ </div>
157
+ </div>
158
+
186
159
 
187
160
  </div>
188
161
  </div>
@@ -1,3 +1,4 @@
1
1
  export {default as Carousel} from './carousel';
2
2
  export {default as CarouselCard} from './carouselCard';
3
- export {default as HomepageCarousel} from './homepageCarousel';
3
+ export {default as HomepageCarousel} from './homepageCarousel';
4
+ export {default as HomepageCarousel2} from './homeCarousel2';
@@ -0,0 +1 @@
1
+ export { default as ScrollSlider } from './scrollSlider';