Skip to content

Commit

Permalink
documentation changes + tailwind changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jxmoose committed Apr 12, 2024
1 parent f5b8784 commit 3ed4501
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
18 changes: 11 additions & 7 deletions src/app/exhibitsPage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import BackButton from '../../components/userComponents/BackButton/page';
*/
function App() {
const [exhibits, setExhibits] = useState<CategoryRow[]>([]);
// fetches all the exhibits to display on the page
useEffect(() => {
// Get exhibits
const getExhibits = async () => {
Expand All @@ -23,12 +24,15 @@ function App() {
// Detect the hash in URL and scroll to the element with the corresponding ID
}, [exhibits]);

// activates whenever the page opens.
// checks if there's a "hash" which is an id of one of the exhibits to scroll to.
// scrolls down to corresponding exhibit with slight offset
useEffect(() => {
const { hash } = window.location;
if (hash) {
setTimeout(() => {
const element = document.querySelector(hash);
const yOffset = -50;
const yOffset = -200;
if (element) {
const y =
element.getBoundingClientRect().top + window.scrollY + yOffset;
Expand All @@ -44,21 +48,21 @@ function App() {
<div className="p-4 m-auto">
<BackButton />
<div className="flex-col justify-start items-start mt-2">
<div className="text-night text-[32px] font-bold leading-9 font-['Lato'] mb-4">
<h1 className="text-night leading-9 font-['Lato'] mb-4">
Our Exhibits{' '}
</div>
<div className="text-night text-base leading-5 font-normal font-['Lato']">
</h1>
<p className="text-night leading-5 font-normal font-['Lato']">
Saratoga is home to an abundance of plant and animal life. As you
explore these exhibits you will learn about species that are
endangered and being carefully monitored by scientists with
protective efforts in place.
</div>
</p>
</div>
<Link href="/siteMapPage">
<div className="px-4 py-2 mb-2 mt-6 rounded-md border active:border-hunterGreen border-asparagus justify-start items-start inline-flex">
<div className="active:text-hunterGreen text-center text-asparagus text-base font-bold font-['Lato'] leading-tight">
<p className="active:text-hunterGreen text-center text-asparagus font-bold font-['Lato'] leading-tight">
Go to Map
</div>
</p>
</div>
</Link>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions src/components/userComponents/Exhibit/Exhibit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ export default function Exhibit({
}) {
return (
<li key={id} id={`a${id}`}>
<div className="w-[100%] px-4 py-8 bg-mint-cream rounded-lg flex-col justify-start items-start gap-2.5 inline-flex mt-6">
<div className="w-full px-4 py-8 bg-mint-cream rounded-lg flex-col justify-start items-start gap-2.5 inline-flex mt-6">
<div className="flex-col justify-start items-start gap-5 flex">
<div className="justify-start items-center gap-2 inline-flex">
<h2 className="text-night text-2xl font-semibold font-['Lato']">
<h2 className="text-night font-semibold font-['Lato']">
{' '}
{title}
</h2>
</div>
<p className="text-night text-base leading-normal font-normal font-['Lato']">
<p className="text-night leading-normal font-normal font-['Lato']">
{description}
</p>
<Image src={image} alt="Exhibit" width={354} height={150} />
Expand Down

0 comments on commit 3ed4501

Please sign in to comment.