Skip to content

Commit

Permalink
globe grabbing off
Browse files Browse the repository at this point in the history
  • Loading branch information
RavindraP04 committed Apr 5, 2023
1 parent 41b5aea commit 573c925
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions components/home/HeroSection/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,45 +113,45 @@ export function HeroSection() {
<div className="green-gradient absolute z-0 top-96 bottom-48 opacity-70 -left-20 block sm:hidden"></div>
<canvas
ref={canvasRef}
onPointerDown={(e) => {
if (canvasRef.current != null) {
canvasRef.current.style.cursor = 'grabbing';
}
pointerInteracting.current =
e.clientX - pointerInteractionMovement.current;
}}
onPointerUp={() => {
pointerInteracting.current = null;
if (canvasRef.current != null) {
canvasRef.current.style.cursor = 'grab';
}
}}
onPointerOut={() => {
pointerInteracting.current = null;
if (canvasRef.current != null) {
canvasRef.current.style.cursor = 'grab';
}
}}
onMouseMove={(e) => {
if (pointerInteracting.current !== null) {
const delta = e.clientX - pointerInteracting.current;
pointerInteractionMovement.current = delta;
api.start({
r: delta / 200,
});
}
}}
onTouchMove={(e) => {
if (pointerInteracting.current !== null && e.touches[0]) {
const delta = e.touches[0].clientX - pointerInteracting.current;
pointerInteractionMovement.current = delta;
api.start({
r: delta / 100,
});
}
}}
// onPointerDown={(e) => {
// if (canvasRef.current != null) {
// canvasRef.current.style.cursor = 'grabbing';
// }
// pointerInteracting.current =
// e.clientX - pointerInteractionMovement.current;
// }}
// onPointerUp={() => {
// pointerInteracting.current = null;
// if (canvasRef.current != null) {
// canvasRef.current.style.cursor = 'grab';
// }
// }}
// onPointerOut={() => {
// pointerInteracting.current = null;
// if (canvasRef.current != null) {
// canvasRef.current.style.cursor = 'grab';
// }
// }}
// onMouseMove={(e) => {
// if (pointerInteracting.current !== null) {
// const delta = e.clientX - pointerInteracting.current;
// pointerInteractionMovement.current = delta;
// api.start({
// r: delta / 200,
// });
// }
// }}
// onTouchMove={(e) => {
// if (pointerInteracting.current !== null && e.touches[0]) {
// const delta = e.touches[0].clientX - pointerInteracting.current;
// pointerInteractionMovement.current = delta;
// api.start({
// r: delta / 100,
// });
// }
// }}
style={{
cursor: 'grab',
// cursor: 'grab',
contain: 'layout paint size',
opacity: 0,
transition: 'opacity 1s ease',
Expand Down

0 comments on commit 573c925

Please sign in to comment.