I am new to react js and I am trying a frontend website for practice. Trying to make it look this
I want to make this svg logo follow the cursor like on the actual metamask website like here
I found this codepen link that does exactly what I want – codepen link
I want to integrate this with my website but I am unable to do so as when I paste the js code gives error on my editor.
I have never used codepen before, so I am curious if there is any specific way to use it? As the code clearly runs on the website but its not working on my editor.
This is the react code I have written till now
index.js
import React from 'react'
import {
InfoContainer,
InfoWrapper,
InfoRow,
Column1,
Column2,
TextWrapper,
Heading,
Subtitle,
ImgWrap,
Img
} from './experienceElements';
const InfoSection = ({
lightBg,
imgStart,
lightText,
headLine,
img,
alt,
id,
darkText,
}) => {
return (
<InfoContainer lightBg={lightBg} id={id}>
<InfoWrapper>
<InfoRow imgStart={imgStart}>
<Column1>
<TextWrapper>
<Heading lightText={lightText}>{headLine}</Heading>
<Subtitle darkText={darkText}>1. Open a Metamask wallet - it's free</Subtitle>
<Subtitle darkText={darkText}>2. Upload a picture</Subtitle>
<Subtitle darkText={darkText}>3. Publish on OpenSea</Subtitle>
</TextWrapper>
</Column1>
<Column2>
<ImgWrap>
<Img src={img} alt={alt} />
</ImgWrap>
</Column2>
</InfoRow>
</InfoWrapper>
</InfoContainer>
)
}
export default InfoSection
CSS and styled components
import styled from 'styled-components'
export const InfoContainer = styled.div`
color: #fff;
background: ${({ lightBg }) => (lightBg ? '#f7f8fa' : '#010606')};
height: 750px;
@media screen and (max-width: 768px) {
padding: 100px 0;
}
`;
export const InfoWrapper = styled.div`
display: grid;
z-index: 1;
height: 100%;
width: 100%;
max-width: 1100px;
margin-right: auto;
margin-left: auto;
padding: 0 24px;
justify-content: center;
`;
export const InfoRow = styled.div`
display: grid;
grid-auto-columns: minmax(auto, 1fr);
align-items: center;
grid-template-areas: ${({ imgStart }) =>
imgStart ? "'col2 col1'" : "'col1 col2'"};
@media screen and (max-width: 768px) {
grid-template-areas: ${({ imgStart }) =>
imgStart ? `'col1' 'col2'` : `'col1 col1' 'col2 col2'`};
}
`;
export const Column1 = styled.div`
margin-bottom: 15px;
padding: 0 15px;
grid-area: col1;
`;
export const Column2 = styled.div`
margin-bottom: 15px;
padding: 0 15px;
grid-area: col2;
`;
export const TextWrapper = styled.div`
max-width: 540px;
padding-top: 0;
padding-bottom: 60px;
margin-left:50px;
`;
export const TopLine = styled.div`
color: #01BF71;
font-size: 20px;
line-height: 16px;
font-weight: 700;
letter-spacing: 1.4px;
text-transform: uppercase;
margin-top: 40px;
margin-bottom: 20px;
`;
export const Heading = styled.h1`
color: #000;
margin-bottom: 30px;
font-size: 34px;
line-height: 1;
font-weight: 650;
@media screen and (max-width: 480px) {
font-size: 32px;
}
`;
export const Subtitle = styled.p`
max-width: 440px;
margin-bottom: 15px;
margin-left: 5px;
font-size: 18px;
line-height: 20px;
font-weight: 300;
color: ${({ darkText }) => (darkText ? '#010606' : '#f7f8fa')};
`;
export const TimeLine = styled.p`
max-width: 440px;
margin-bottom: 20px;
font-size: 18px;
line-height: 24px;
color: ${({ darkText }) => (darkText ? '#010606' : '#f7f8fa')};
`;
export const BtnWrap = styled.div`
display: flex;
justify-content: flex-start;
`;
export const ImgWrap = styled.div`
max-width: 555px;
height: 100%;
`;
export const Img = styled.img`
width: 100%;
margin-top: 0;
margin-right: 0;
margin-left: 10px;
padding-right: 0;
`;
How can I integrate this cursor following metamask logo with my code?