Skip to content

Commit

Permalink
Fixed it on PC view, mobile view is a WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Arush committed Aug 20, 2024
1 parent bf29267 commit d920e88
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
28 changes: 14 additions & 14 deletions app/components/helper/glow-card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const GlowCard = ({ children , identifier}) => {
useEffect(() => {
const CONTAINER = document.querySelector(`.glow-container-${identifier}`);
const CARDS = document.querySelectorAll(`.glow-card-${identifier}`);
const WRAPPER = document.querySelector(`.wrapper-${identifier}`);

const CONFIG = {
proximity: 40,
Expand Down Expand Up @@ -47,32 +46,33 @@ const GlowCard = ({ children , identifier}) => {
}
};

WRAPPER.addEventListener('pointermove', UPDATE);
document.body.addEventListener('pointermove', UPDATE);

const RESTYLE = () => {
if (CONTAINER) {
CONTAINER.style.setProperty('--gap', CONFIG.gap);
CONTAINER.style.setProperty('--blur', CONFIG.blur);
CONTAINER.style.setProperty('--spread', CONFIG.spread);
CONTAINER.style.setProperty(
'--direction',
CONFIG.vertical ? 'column' : 'row'
);
}
CONTAINER.style.setProperty('--gap', CONFIG.gap);
CONTAINER.style.setProperty('--blur', CONFIG.blur);
CONTAINER.style.setProperty('--spread', CONFIG.spread);
CONTAINER.style.setProperty(
'--direction',
CONFIG.vertical ? 'column' : 'row'
);
};

RESTYLE();
UPDATE();

// Cleanup event listener
return () => {
WRAPPER.removeEventListener('pointermove', UPDATE);
document.body.removeEventListener('pointermove', UPDATE);
};
}, [identifier]);

return (
<div className={`wrapper-${identifier}`}>
{children}
<div className={`glow-container-${identifier} glow-container`}>
<article className={`glow-card glow-card-${identifier} h-fit cursor-pointer border border-[#2a2e5a] transition-all duration-300 relative bg-[#101123] text-gray-200 rounded-xl hover:border-transparent w-full`}>
<div className="glows"></div>
{children}
</article>
</div>
);
};
Expand Down
12 changes: 1 addition & 11 deletions app/css/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
body {
color: rgb(var(--foreground-rgb));
background-color: #0d1224;
overflow-x: hidden;
width: 100%;
position: relative;
width: 100%;
}
#sticky-card-1 {
--index: 1;
Expand All @@ -34,14 +33,5 @@ body {
}

html {
overflow-x: hidden;
width: 100%;
}

/* Add this CSS for the wrapper element */
.wrapper {
position: relative;
width: 100%;
height: 100%;
overflow-x: visible;
}

0 comments on commit d920e88

Please sign in to comment.