Browse Source

chore: setupDynamicGradient->setupCursorTracking

pull/2/head
Muthu Kumar 1 year ago
parent
commit
81ae5c6ee7
Failed to extract signature
  1. 4
      src/components/Exp/Content.tsx
  2. 2
      src/util/index.ts

4
src/components/Exp/Content.tsx

@ -1,6 +1,6 @@
import { css } from "@emotion/css"; import { css } from "@emotion/css";
import React from "react"; import React from "react";
import { setupDynamicGradient } from "../../util"; import { setupCursorTracking } from "../../util";
import { Experience } from "./types"; import { Experience } from "./types";
const Circle: React.FC = () => ( const Circle: React.FC = () => (
@ -87,7 +87,7 @@ export const Content = ({
location, location,
}: Experience) => { }: Experience) => {
return ( return (
<button className={btn} onClick={onClick} ref={setupDynamicGradient}> <button className={btn} onClick={onClick} ref={setupCursorTracking}>
<div className="dynamic-gradient" /> <div className="dynamic-gradient" />
<Circle /> <Circle />
<h4> <h4>

2
src/util/index.ts

@ -58,7 +58,7 @@ export const get = {
import "./dynamic-gradient.css"; import "./dynamic-gradient.css";
export function setupDynamicGradient(el: HTMLElement | null) { export function setupCursorTracking(el: HTMLElement | null) {
if (!el) return; if (!el) return;
el.addEventListener("mousemove", e => { el.addEventListener("mousemove", e => {

Loading…
Cancel
Save