Skip to content

Commit

Permalink
color change
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-m-masood committed Aug 15, 2024
1 parent 4c874cb commit bf06b02
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/layouts/PostSingle.astro
Original file line number Diff line number Diff line change
Expand Up @@ -143,24 +143,20 @@ const { title, description, authors, categories, image, date, tags } =
);

if (entry.isIntersecting) {
index?.classList.remove("bg-slate-200", "dark:bg-slate-800"); // remove bg
index?.classList.add(
"bg-indigo-600",
"dark:bg-indigo-700",
"text-white",
"bg-blue-100",
"bg-blue-100",
"font-bold",
"transition-colors",
"duration-200",
"duration-100",
);
} else {
index?.classList.add("bg-slate-200", "dark:bg-slate-800"); // add bg
index?.classList.remove(
"bg-indigo-600",
"dark:bg-indigo-700",
"text-white",
"bg-blue-100",
"bg-blue-100",
"font-bold",
"transition-colors",
"duration-200",
"duration-100",
);
}
});
Expand All @@ -182,6 +178,7 @@ const { title, description, authors, categories, image, date, tags } =
observer.observe(heading);
});
};

fnObserver();
document.addEventListener("astro:after-swap", fnObserver);
</script>
Expand Down

0 comments on commit bf06b02

Please sign in to comment.