Skip to content

Commit e4875fe

Browse files
committed
i 🧡 hover effects
1 parent 248d53e commit e4875fe

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎astro.config.mjs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export default defineConfig({
1616
host: 'apiv4321.skibidihomer.fun',
1717
port: 4321
1818
}
19+
},
20+
preview: {
21+
allowedHosts: true,
22+
host: true,
23+
port: 4321
1924
}
2025
}
2126
});

‎src/components/PortfolioCard.astro‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { background, middleground, foreground, video } = Astro.props;
1010
---
1111

1212
<div
13-
class="parallax-card relative w-full max-w-[384px] aspect-[16/9] rounded-xl overflow-hidden bg-black shadow-xl hover:shadow-2xl transition-shadow duration-300 hover:cursor-pointer"
13+
class="parallax-card relative w-full max-w-[384px] aspect-[16/9] rounded-xl overflow-hidden bg-black shadow-xl hover:shadow-2xl hover:scale-110 transition-all duration-300 hover:cursor-pointer"
1414
data-background={background}
1515
data-middleground={middleground}
1616
data-foreground={foreground}
@@ -127,8 +127,8 @@ const { background, middleground, foreground, video } = Astro.props;
127127
const x = e.clientX - rect.left - rect.width / 2;
128128
const y = e.clientY - rect.top - rect.height / 2;
129129

130-
const tiltX = (y / rect.height) * 2;
131-
const tiltY = -(x / rect.width) * 2;
130+
const tiltX = y / rect.height;
131+
const tiltY = -(x / rect.width);
132132

133133
card.style.transform = `rotateX(${tiltX}deg) rotateY(${tiltY}deg)`;
134134

@@ -163,6 +163,7 @@ const { background, middleground, foreground, video } = Astro.props;
163163

164164
card.addEventListener("mouseenter", () => {
165165
if (videoSrc && video) {
166+
//@ts-ignore ts doesnt like me :(
166167
videoTimeout = setTimeout(startVideo, 2000);
167168
}
168169
});

0 commit comments

Comments
 (0)