Skip to content

Commit ec2917c

Browse files
committed
fix(): Fixing minor issue with the 3d pin
1 parent a558a23 commit ec2917c

2 files changed

Lines changed: 24 additions & 25 deletions

File tree

src/components/3dPin/3dPin.tsx

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use client';
2-
import React, { useState } from 'react';
2+
import React, { useRef, useState } from 'react';
33
import { motion } from 'framer-motion';
4-
import { Link } from 'react-router-dom';
4+
import { useCursor } from '../Cursor';
5+
import { Box, Link } from '@chakra-ui/react';
56

6-
const PinContainer = ({
7+
const ThreeDPin = ({
78
children,
89
title,
910
href,
@@ -28,7 +29,8 @@ const PinContainer = ({
2829
className={'relative group/pin z-50 cursor-pointer'}
2930
onMouseEnter={onMouseEnter}
3031
onMouseLeave={onMouseLeave}
31-
to={href ?? '/'}
32+
href={href}
33+
isExternal
3234
>
3335
<div
3436
style={{
@@ -51,31 +53,26 @@ const PinContainer = ({
5153
);
5254
};
5355

54-
export const PinPerspective = ({
55-
title,
56-
href,
57-
}: {
58-
title?: string;
59-
href?: string;
60-
}) => {
56+
const PinPerspective = ({ title, href }: { title?: string; href?: string }) => {
6157
return (
62-
<motion.div className="pointer-events-none w-96 h-80 flex items-center justify-center opacity-0 group-hover/pin:opacity-100 z-[60] transition duration-500">
58+
<motion.div className="pointer-events-none w-96 h-96 flex items-center justify-center opacity-0 group-hover/pin:opacity-100 z-[60] transition duration-500">
6359
<div className=" w-full h-full -mt-7 flex-none inset-0">
6460
<div className="absolute top-0 inset-x-0 flex justify-center">
6561
<a
6662
href={href}
67-
target={'_blank'}
6863
className="relative flex space-x-2 items-center z-10 rounded-full bg-zinc-950 py-0.5 px-4 ring-1 ring-white/10 "
69-
rel="noreferrer"
64+
target="_blank"
65+
rel="noopener noreferrer"
66+
onClick={() => {
67+
console.log('onClick');
68+
}}
7069
>
7170
<span className="relative z-20 text-white text-xs font-bold inline-block py-0.5">
7271
{title}
7372
</span>
74-
75-
<span className="absolute -bottom-0 left-[1.125rem] h-px w-[calc(100%-2.25rem)] bg-gradient-to-r from-emerald-400/0 via-emerald-400/90 to-emerald-400/0 transition-opacity duration-500 group-hover/btn:opacity-40"></span>
73+
<span className="absolute -bottom-0 left-[1.125rem] h-px w-[calc(100%-2.25rem)] bg-gradient-to-r from-emerald-400/0 via-violet-400/90 to-emerald-400/0 transition-opacity duration-500 group-hover/btn:opacity-40"></span>
7674
</a>
7775
</div>
78-
7976
<div
8077
style={{
8178
perspective: '1000px',
@@ -158,4 +155,4 @@ export const PinPerspective = ({
158155
);
159156
};
160157

161-
export default PinContainer;
158+
export default ThreeDPin;

src/screens/mainFlow/contents/Contents.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Box, Text } from '@chakra-ui/react';
2-
import { Card } from '@components';
2+
import { Card, ThreeDPin } from '@components';
33

44
const Contents = () => {
55
return (
@@ -15,12 +15,14 @@ const Contents = () => {
1515
bg={'black'}
1616
color={'white'}
1717
>
18-
<Card
19-
centerText="Hourcoding"
20-
titleText="Hourcoding.com"
21-
subtitleText="A blog about coding and programming"
22-
chipText="React, Next.js, TypeScript, Chakra UI"
23-
/>
18+
<ThreeDPin title="Hourcoding.com" href="https://hourcoding.com">
19+
<Card
20+
centerText="Hourcoding"
21+
titleText="Hourcoding.com"
22+
subtitleText="A blog about coding and programming"
23+
chipText="React, Next.js, TypeScript, Chakra UI"
24+
/>
25+
</ThreeDPin>
2426
</Box>
2527
);
2628
};

0 commit comments

Comments
 (0)