reactjs18-3d-portfolio icon indicating copy to clipboard operation
reactjs18-3d-portfolio copied to clipboard

Help Needed

Open TiwariAbhishek23 opened this issue 2 years ago • 2 comments
trafficstars

Hello, I updated this portfolio for my own here is the Link. I want to add a video clip that starts on hover, instead of normal image of my project in Work section, I tried to use this React-hover module but it is not working because of project structure, react-dependencies. I will be thankful if you can guide me for this

TiwariAbhishek23 avatar Oct 27 '23 20:10 TiwariAbhishek23

Hi AbhishekTiwari23, It's been a while since your issue was published, but I saw on your site that you haven't implemented it yet so I'll share my two cents with you. In my opinion, you don't need to use any 3d party libraries, html video element (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video), onMouseEnter & onMouseLeave event handlers and useRef hook may be sufficient for this.

Here is a basic example of how you should implement this:

const videoRef= useRef(null);
const onMouseEnter = () => ref.current.play();
const onMouseLeave = () => ref.current.pause();

<video ref={videoRef}>
    <source src={source} type='video/mp4' onMouseEnter={onMouseEnter } onMouseLeave={onMouseLeave } />
</video>

Hope this helps you :)

ladunjexa avatar Nov 27 '23 06:11 ladunjexa

Hi, I need little help, I updated the code as per the latest update and made the required changes, you can check them here - https://github.com/ladunjexa/reactjs18-3d-portfolio/compare/main...AbhishekTiwari23:tiwariabhishek23:main why after deploying it is becoming like Screenshot 2024-05-09 at 3 10 28 AM

TiwariAbhishek23 avatar May 08 '24 21:05 TiwariAbhishek23