Skip to content

Commit ababc25

Browse files
updated navbar and project
1 parent 147d5b3 commit ababc25

3 files changed

Lines changed: 14 additions & 31 deletions

File tree

src/components/projects/VideoProject.svelte

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,16 @@
2626
onMount(() => {
2727
const videos = document.querySelectorAll<HTMLVideoElement>(".playable");
2828
29-
let userInteracted = false;
30-
31-
const handleUserInteraction = () => {
32-
userInteracted = true;
33-
document.removeEventListener("click", handleUserInteraction);
34-
document.removeEventListener("keydown", handleUserInteraction);
35-
};
36-
37-
document.addEventListener("click", handleUserInteraction);
38-
document.addEventListener("keydown", handleUserInteraction);
39-
4029
videos.forEach((video) => {
4130
// Ensure the video element supports play and pause methods
4231
if (
4332
typeof video.play === "function" &&
4433
typeof video.pause === "function"
4534
) {
4635
video.addEventListener("mouseenter", () => {
47-
if (userInteracted) {
48-
video.volume = 0.2;
49-
video.muted = false;
50-
video.play();
51-
} else {
52-
video.volume = 0;
53-
video.muted = true;
54-
video.play();
55-
}
36+
video.volume = 0;
37+
video.muted = true;
38+
video.play();
5639
});
5740
5841
video.addEventListener("mouseleave", () => {

src/components/socials/Socials.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<div class="flex flex-row items-center justify-center gap-2">
1+
<div class="flex flex-row items-center justify-center gap-3">
22
<a href="https://github.com/liyunze-coding" target="_blank">
33
<div
4-
class="flex h-7 w-7 items-center justify-center rounded-full bg-white transition-[filter] duration-150 hover:invert"
4+
class="flex h-8 w-8 items-center justify-center rounded-full bg-white transition-[filter] duration-150 hover:invert"
55
>
66
<img
77
src="/images/socials/github.svg"
@@ -13,7 +13,7 @@
1313
</a>
1414
<a href="https://codepen.io/rythondev" target="_blank">
1515
<div
16-
class="flex h-7 w-7 items-center justify-center rounded-full bg-white transition-[filter] duration-150 hover:invert"
16+
class="flex h-8 w-8 items-center justify-center rounded-full bg-white transition-[filter] duration-150 hover:invert"
1717
>
1818
<img
1919
src="/images/socials/codepen.svg"
@@ -24,7 +24,7 @@
2424
</a>
2525
<a href="https://youtube.com/@RythonDev" target="_blank">
2626
<div
27-
class="flex h-7 w-7 items-center justify-center rounded-full bg-white transition-[filter,background-color] duration-150 hover:bg-[#00ffff] hover:invert"
27+
class="flex h-8 w-8 items-center justify-center rounded-full bg-white transition-[filter,background-color] duration-150 hover:bg-[#00ffff] hover:invert"
2828
>
2929
<img
3030
src="/images/socials/youtube.svg"
@@ -35,7 +35,7 @@
3535
</a>
3636
<a href="https://twitch.tv/RythonDev" target="_blank">
3737
<div
38-
class="flex h-7 w-7 items-center justify-center rounded-full bg-white transition-[filter,background-color] duration-150 hover:bg-[#6eb900] hover:invert"
38+
class="flex h-8 w-8 items-center justify-center rounded-full bg-white transition-[filter,background-color] duration-150 hover:bg-[#6eb900] hover:invert"
3939
>
4040
<img
4141
src="/images/socials/twitch.svg"

src/components/ui/NavigationBar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const HoverNavigation = ({
120120
</div>
121121
<div
122122
ref={hamburgerRef}
123-
className="bg-secondary fixed right-5 bottom-10 z-50 flex rounded-full border-2 border-white px-1 py-1 md:hidden"
123+
className="fixed top-10 right-5 z-50 flex rounded-full bg-gray-100 px-1 py-1 md:hidden [&>div]:rounded-full [&>div_div]:bg-black!"
124124
>
125125
<HamburgerCross
126126
toggle={setHamburgerOpen}
@@ -137,24 +137,24 @@ export const HoverNavigation = ({
137137
animate={{ opacity: 1, scale: 1 }}
138138
exit={{ opacity: 0, scale: 0.95 }}
139139
transition={{ duration: 0.2 }}
140-
className="bg-secondary/20 border-accent fixed right-5 bottom-32 z-40 rounded-2xl border-2 py-2 backdrop-blur-md md:hidden"
140+
className="fixed top-32 right-5 z-40 rounded-2xl bg-white/90 py-2 text-black backdrop-blur-sm md:hidden"
141141
>
142142
<nav aria-label="Mobile Navigation">
143143
<ul className="flex flex-col gap-2">
144144
{items.map((item, idx) => (
145145
<motion.li
146146
key={item?.link}
147-
initial={{ opacity: 0, x: -20 }}
148-
animate={{ opacity: 1, x: 0 }}
147+
initial={{ opacity: 0, y: -20 }}
148+
animate={{ opacity: 1, y: 0 }}
149149
transition={{
150-
delay: (items.length - idx) * 0.1,
150+
delay: idx * 0.1,
151151
duration: 0.3,
152152
}}
153153
className="rounded-2xl px-3"
154154
>
155155
<a
156156
href={item?.link}
157-
className="block rounded-lg px-4 py-3 text-center text-lg transition-colors hover:bg-neutral-700"
157+
className="block rounded-lg px-4 py-3 text-center text-lg transition-colors"
158158
onClick={() =>
159159
setHamburgerOpen(false)
160160
}

0 commit comments

Comments
 (0)