Skip to content

Commit

Permalink
fix: focus page about
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielviol committed Nov 14, 2024
1 parent bad9ae4 commit fee6109
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 103 deletions.
6 changes: 6 additions & 0 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This file is automatically updated during development when running `dev.ts`.

import * as $_app from "./routes/_app.tsx";
import * as $affiliates_island from "./islands/affiliates-island.tsx";
import * as $all_affiliates_island from "./islands/all-affiliates-island.tsx";
import * as $all_news from "./islands/all-news.tsx";
import * as $all_research_pagination from "./islands/all-research-pagination.tsx";
Expand All @@ -11,6 +12,8 @@ import * as $featured_news from "./islands/featured-news.tsx";
import * as $footer_island from "./islands/footer-island.tsx";
import * as $header_mobile_site from "./islands/header-mobile-site.tsx";
import * as $header_site from "./islands/header-site.tsx";
import * as $history_island from "./islands/history-island.tsx";
import * as $our_board_island from "./islands/our-board-island.tsx";
import * as $projects_island from "./islands/projects-island.tsx";
import * as $projects_pagination from "./islands/projects-pagination.tsx";
import * as $resource_islands from "./islands/resource-islands.tsx";
Expand All @@ -26,6 +29,7 @@ const manifest = {
"./routes/_app.tsx": $_app,
},
islands: {
"./islands/affiliates-island.tsx": $affiliates_island,
"./islands/all-affiliates-island.tsx": $all_affiliates_island,
"./islands/all-news.tsx": $all_news,
"./islands/all-research-pagination.tsx": $all_research_pagination,
Expand All @@ -34,6 +38,8 @@ const manifest = {
"./islands/footer-island.tsx": $footer_island,
"./islands/header-mobile-site.tsx": $header_mobile_site,
"./islands/header-site.tsx": $header_site,
"./islands/history-island.tsx": $history_island,
"./islands/our-board-island.tsx": $our_board_island,
"./islands/projects-island.tsx": $projects_island,
"./islands/projects-pagination.tsx": $projects_pagination,
"./islands/resource-islands.tsx": $resource_islands,
Expand Down
58 changes: 58 additions & 0 deletions islands/affiliates-island.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { useEffect, useRef } from "preact/hooks";
import type { ImageWidget } from "apps/admin/widgets.ts";
import Icon from "site/components/ui/Icon.tsx";

export interface CTA {
src?: string;
href: string;
text?: string;
alt?: string;
}

export interface Props {
title: string;
description: string;
button: CTA;
logos?: ImageWidget[];
}

export default function AffiliatesIsland({
title,
description,
button,
logos,
}: Props) {
const boardRef = useRef<HTMLDivElement>(null);

useEffect(() => {
const params = new URLSearchParams(window.location.search);
if (params.get("section") === "afiliadas" && boardRef.current) {
boardRef.current.scrollIntoView({ behavior: "smooth" });
}
}, []);

return (
<div class="lg:container lg:p-16 text-sm py-8 lg:py-20 px-5">
<div class="space-y-10">
<div class="flex w-full md:w-[350px] flex-col gap-4 justify-center">
<h2 class="text-4xl font-black leading-snug">{title}</h2>
<span class="text-lg font-medium leading-snug">{description}</span>
<button
class="w-[12rem] p-2 flex gap-2 items-center justify-center text-white rounded-md bg-pink-500 hover:bg-pink-600 transition duration-300"
href={button.href}
>
{button.text}
<Icon id="ArrowNorthEast" size={12} strokeWidth={1} />
</button>
</div>
<div class="grid grid-cols-2 md:grid-cols-5 gap-6 md:gap-10 items-center justify-center">
{logos?.map((logo) => (
<div>
<img src={logo} alt={logo} decoding="async" loading="lazy" />
</div>
))}
</div>
</div>
</div>
);
}
64 changes: 64 additions & 0 deletions islands/history-island.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { useEffect, useRef } from "preact/hooks";
import Image from "apps/website/components/Image.tsx";
import { ImageWidget } from "apps/admin/widgets.ts";
import { Text1 } from "site/islands/text1-history.tsx";
import { Text2 } from "site/islands/text2-history.tsx";
import { Text3 } from "site/islands/text3-history.tsx";
interface Props {
image1: ImageWidget;
image2: ImageWidget;
}
export default function HistoryIsland({ image1, image2 }: Props) {
const boardRef = useRef<HTMLDivElement>(null);
const params = new URLSearchParams(window.location.search);
useEffect(() => {
if (params.get("section") === "historia" && boardRef.current) {
boardRef.current.scrollIntoView({ behavior: "smooth" });
}
}, [params]);

return (
<div className="lg:container text-sm mb-40">
<div className="space-y-10">
<div class="px-6 flex flex-col items-center gap-8">
<div class="w-full max-w-[850px] flex flex-col">
<h2 class="text-6xl font-bold text-black leading-snug">
E assim nasceu o
</h2>
<h2 class="text-6xl font-bold text-black leading-snug text-center">
<span class="text-blue-400">movimento</span>{" "}
<span class="text-pink-500">nacional</span>
</h2>
<h2 class="text-6xl font-bold text-black leading-snug text-right">
de <span class="text-black">Travestis e Transexuais</span>.
</h2>
<p class="text-gray-500 mt-2 text-right">Keila Simpson Sousa</p>
</div>
<Text1 />
<Text2 />
<div class="flex gap-5 max-w-[800px] w-full">
<Image
className="w-1/2 object-contain rounded-2xl"
width={380}
height={274}
src={image1}
alt={image1}
decoding="async"
loading="lazy"
/>
<Image
className="w-1/2 object-contain rounded-2xl"
width={380}
height={274}
src={image2}
alt={image2}
decoding="async"
loading="lazy"
/>
</div>
<Text3 />
</div>
</div>
</div>
);
}
55 changes: 55 additions & 0 deletions islands/our-board-island.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { useEffect, useRef } from "preact/hooks";
import type { ImageWidget } from "apps/admin/widgets.ts";
import Image from "apps/website/components/Image.tsx";

interface Member {
name: string;
role: string;
description: string;
image: ImageWidget;
}
export interface Props {
title: string;
members: Member[];
}

export default function OurBoardIsland({ title, members }: Props) {
const boardRef = useRef<HTMLDivElement>(null);

useEffect(() => {
const params = new URLSearchParams(window.location.search);
if (params.get("section") === "diretoria" && boardRef.current) {
boardRef.current.scrollIntoView({ behavior: "smooth" });
}
}, []);

return (
<div ref={boardRef} className="lg:container text-sm mb-10">
<div className="space-y-10 px-6 md:px-24 py-8 md:py-24">
<div class="w-full flex flex-col gap-8">
<h1 class="text-4xl md:text-5xl font-semibold">{title}</h1>
<div className="flex flex-col md:flex-row gap-8">
{members.map((member, index) => (
<div class="flex flex-col gap-6" key={index}>
<Image
className="w-full rounded-2xl"
width={380}
height={274}
src={member.image}
alt={member.image}
decoding="async"
loading="lazy"
/>
<div class="md:px-6">
<p class="text-xl font-semibold">{member.name}</p>
<p class="text-lg">{member.role}</p>
</div>
<p class="md:px-6">{member.description}</p>
</div>
))}
</div>
</div>
</div>
</div>
);
}
31 changes: 7 additions & 24 deletions sections/Affiliates.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ImageWidget } from "apps/admin/widgets.ts";
import Image from "apps/website/components/Image.tsx";
import Icon from "site/components/ui/Icon.tsx";
import AffiliatesIsland from "site/islands/affiliates-island.tsx";

export interface CTA {
src?: string;
Expand All @@ -23,27 +22,11 @@ export default function Affiliates({
logos,
}: Props) {
return (
<div class="lg:container lg:p-16 text-sm py-8 lg:py-20 px-5">
<div class="space-y-10">
<div class="flex w-full md:w-[350px] flex-col gap-4 justify-center">
<h2 class="text-4xl font-black leading-snug">{title}</h2>
<span class="text-lg font-medium leading-snug">{description}</span>
<button
class="w-[12rem] p-2 flex gap-2 items-center justify-center text-white rounded-md bg-pink-500 hover:bg-pink-600 transition duration-300"
href={button.href}
>
{button.text}
<Icon id="ArrowNorthEast" size={12} strokeWidth={1} />
</button>
</div>
<div class="grid grid-cols-2 md:grid-cols-5 gap-6 md:gap-10 items-center justify-center">
{logos?.map((logo) => (
<div>
<img src={logo} alt={logo} decoding="async" loading="lazy" />
</div>
))}
</div>
</div>
</div>
<AffiliatesIsland
title={title}
description={description}
button={button}
logos={logos}
/>
);
}
51 changes: 3 additions & 48 deletions sections/History.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,10 @@
import Image from "apps/website/components/Image.tsx";
import { ImageWidget } from "apps/admin/widgets.ts";
import { Text1 } from "site/islands/text1-history.tsx";
import { Text2 } from "site/islands/text2-history.tsx";
import { Text3 } from "site/islands/text3-history.tsx";
import HistoryIsland from "site/islands/history-island.tsx";

interface Props {
image1: ImageWidget;
image2: ImageWidget;
}
export default function History({ image1, image2 }: Props) {
return (
<div className="lg:container text-sm mb-40">
<div className="space-y-10">
<div class="px-6 flex flex-col items-center gap-8">
<div class="w-full max-w-[850px] flex flex-col">
<h2 class="text-6xl font-bold text-black leading-snug">
E assim nasceu o
</h2>
<h2 class="text-6xl font-bold text-black leading-snug text-center">
<span class="text-blue-400">movimento</span>{" "}
<span class="text-pink-500">nacional</span>
</h2>
<h2 class="text-6xl font-bold text-black leading-snug text-right">
de <span class="text-black">Travestis e Transexuais</span>.
</h2>
<p class="text-gray-500 mt-2 text-right">Keila Simpson Sousa</p>
</div>
<Text1 />
<Text2 />
<div class="flex gap-5 max-w-[800px] w-full">
<Image
className="w-1/2 object-contain rounded-2xl"
width={380}
height={274}
src={image1}
alt={image1}
decoding="async"
loading="lazy"
/>
<Image
className="w-1/2 object-contain rounded-2xl"
width={380}
height={274}
src={image2}
alt={image2}
decoding="async"
loading="lazy"
/>
</div>
<Text3 />
</div>
</div>
</div>
);
return <HistoryIsland image1={image1} image2={image2} />;
}
33 changes: 2 additions & 31 deletions sections/OurBoard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ImageWidget } from "apps/admin/widgets.ts";
import Image from "apps/website/components/Image.tsx";
import Icon from "site/components/ui/Icon.tsx";
import OurBoardIsland from "site/islands/our-board-island.tsx";

interface Member {
name: string;
Expand All @@ -14,33 +13,5 @@ export interface Props {
}

export default function OurBoard({ title, members }: Props) {
return (
<div className="lg:container text-sm mb-10">
<div className="space-y-10 px-6 md:px-24 py-8 md:py-24">
<div class="w-full flex flex-col gap-8">
<h1 class="text-4xl md:text-5xl font-semibold">{title}</h1>
<div className="flex flex-col md:flex-row gap-8">
{members.map((member, index) => (
<div class="flex flex-col gap-6">
<Image
className="w-full rounded-2xl"
width={380}
height={274}
src={member.image}
alt={member.image}
decoding="async"
loading="lazy"
/>
<div class="md:px-6">
<p class="text-xl font-semibold">{member.name}</p>
<p class="text-lg">{member.role}</p>
</div>
<p class="md:px-6">{member.description}</p>
</div>
))}
</div>
</div>
</div>
</div>
);
return <OurBoardIsland title={title} members={members} />;
}

0 comments on commit fee6109

Please sign in to comment.