Minor additions to allow for better navigation, especially for screen readers.

This commit is contained in:
Alexis Werefox 2021-05-01 23:25:28 +00:00
parent d7354f3c3a
commit b3887c63ef
8 changed files with 68 additions and 48 deletions

View File

@ -4,7 +4,12 @@ import WCard from "../components/werefox-card";
import FCard from "./footer-card"; import FCard from "./footer-card";
import PButton from "../components/page-button"; import PButton from "../components/page-button";
export default function BasicPage({ is_home, page_title, card_title, children }) { export default function BasicPage({
is_home,
page_title,
card_title,
children,
}) {
if (is_home) { if (is_home) {
return ( return (
<div className="min-h-screen bg-werefox-grey-lighter dark:bg-werefox-grey-dark font-nerd"> <div className="min-h-screen bg-werefox-grey-lighter dark:bg-werefox-grey-dark font-nerd">
@ -56,23 +61,27 @@ export default function BasicPage({ is_home, page_title, card_title, children })
{card_title} {card_title}
</h1> </h1>
</WCard> </WCard>
<PButton <nav>
title="Take me back home!" <PButton
images={[ title="Take me back home!"
{ src: "/emoji/pixel_alexis.png", alt: "Pixel Alexis!" }, images={[
{ src: "/emoji/blue_heart.svg", alt: "Blue heart" }, { src: "/emoji/pixel_alexis.png", alt: "Pixel Alexis!" },
]} { src: "/emoji/blue_heart.svg", alt: "Blue heart" },
url="/" ]}
/> url="/"
/>
</nav>
{children} {children}
<PButton <nav>
title="Take me back home!" <PButton
images={[ title="Take me back home!"
{ src: "/emoji/pixel_alexis.png", alt: "Pixel Alexis!" }, images={[
{ src: "/emoji/blue_heart.svg", alt: "Blue heart" }, { src: "/emoji/pixel_alexis.png", alt: "Pixel Alexis!" },
]} { src: "/emoji/blue_heart.svg", alt: "Blue heart" },
url="/" ]}
/> url="/"
/>
</nav>
<FCard /> <FCard />
</div> </div>
</div> </div>

View File

@ -3,16 +3,19 @@ import { IDENTITIES } from "../js/variables";
export default function IdentityBlock() { export default function IdentityBlock() {
return ( return (
<div className="grid xl:grid-rows-2 xl:grid-cols-5 sm:grid-rows-3 sm:grid-cols-3 grid-rows-9 grid-cols-1 sm:gap-2 gap-0"> <nav>
{Object.keys(IDENTITIES).map((ids) => ( <div className="grid xl:grid-rows-2 xl:grid-cols-5 sm:grid-rows-3 sm:grid-cols-3 grid-rows-9 grid-cols-1 sm:gap-2 gap-0">
<IDButton {Object.keys(IDENTITIES).map((ids) => (
key={ids} <IDButton
innerText={ids} key={ids}
url={IDENTITIES[ids].url} innerText={ids}
imageObj={IDENTITIES[ids].images} url={IDENTITIES[ids].url}
extraClasses={IDENTITIES[ids].extra_classes} locator={IDENTITIES[ids].locator}
/> imageObj={IDENTITIES[ids].images}
))} extraClasses={IDENTITIES[ids].extra_classes}
</div> />
))}
</div>
</nav>
); );
} }

View File

@ -6,14 +6,15 @@ export default function IdentityButton({
imageObj, imageObj,
innerText, innerText,
url, url,
locator,
}) { }) {
const images = Array(imageObj).flat(); const images = Array(imageObj).flat();
const maybeLocator = locator ? `#${locator}` : "";
return ( return (
<div className="animate-wiggle container max-w-sm mx-auto md:px-2 p-2"> <div className="animate-wiggle container max-w-sm mx-auto md:px-2 p-2">
<Link href={url}> <Link href={`${url}${maybeLocator}`}>
<a <a
target=""
className={`${extraClasses} block ring-2 ring-werefox-grey-darker dark:ring-werefox-grey-darker rounded-lg text-lg text-center text-werefox-grey-lighter dark:text-werefox-grey-dark bg-werefox-grey dark:bg-werefox-grey-lightest transition hover:bg-werefox-grey-dark dark:hover:bg-werefox-grey-light`} className={`${extraClasses} block ring-2 ring-werefox-grey-darker dark:ring-werefox-grey-darker rounded-lg text-lg text-center text-werefox-grey-lighter dark:text-werefox-grey-dark bg-werefox-grey dark:bg-werefox-grey-lightest transition hover:bg-werefox-grey-dark dark:hover:bg-werefox-grey-light`}
> >
{images.map((source) => ( {images.map((source) => (

View File

@ -66,7 +66,7 @@ export default function IdentityCard({
} else if (url) { } else if (url) {
return ( return (
<div className="rounded-lg ring-2 ring-werefox-grey dark:ring-werefox-grey-darker bg-werefox-grey-light dark:bg-werefox-grey"> <div className="rounded-lg ring-2 ring-werefox-grey dark:ring-werefox-grey-darker bg-werefox-grey-light dark:bg-werefox-grey">
<div className="p-2 flow space-y-3"> <div className="p-2 flow space-y-3" id={title}>
<div className="rounded-lg ring-2 ring-werefox-grey dark:ring-werefox-grey-darker bg-werefox-grey-lighter dark:bg-werefox-grey-dark"> <div className="rounded-lg ring-2 ring-werefox-grey dark:ring-werefox-grey-darker bg-werefox-grey-lighter dark:bg-werefox-grey-dark">
<p className="p-4 text-center text-lg sm:text-2xl text-werefox-grey-dark dark:text-werefox-grey-lighter"> <p className="p-4 text-center text-lg sm:text-2xl text-werefox-grey-dark dark:text-werefox-grey-lighter">
<span className="relative inline-block w-8 h-8 align-middle mb-1"> <span className="relative inline-block w-8 h-8 align-middle mb-1">

View File

@ -3,15 +3,17 @@ import { PAGES } from "../js/variables";
export default function ProjectBlock() { export default function ProjectBlock() {
return ( return (
<> <nav>
{Object.keys(PAGES).map((page) => ( <div className="flow space-y-2">
<PButton {Object.keys(PAGES).map((page) => (
key={page} <PButton
title={page} key={page}
images={PAGES[page].images} title={page}
url={PAGES[page].url} images={PAGES[page].images}
/> url={PAGES[page].url}
))} />
</> ))}
</div>
</nav>
); );
} }

View File

@ -25,7 +25,7 @@ export const IDENTITIES = {
], ],
extra_classes: "xl:pt-1 xl:align-text-bottom xl:text-sm xl:min-h-full", extra_classes: "xl:pt-1 xl:align-text-bottom xl:text-sm xl:min-h-full",
}, },
"She/her": { "She/Her": {
url: "/identities/pronouns", url: "/identities/pronouns",
images: [ images: [
{ {
@ -37,6 +37,7 @@ export const IDENTITIES = {
}, },
Polyam: { Polyam: {
url: "/identities/sexuality", url: "/identities/sexuality",
locator: "Polyam",
images: [ images: [
{ {
src: "/emoji/polyamory_flag.svg", src: "/emoji/polyamory_flag.svg",
@ -47,6 +48,7 @@ export const IDENTITIES = {
}, },
Pansexual: { Pansexual: {
url: "/identities/sexuality", url: "/identities/sexuality",
locator: "Pansexual",
images: [ images: [
{ {
src: "/emoji/pansexual_flag.svg", src: "/emoji/pansexual_flag.svg",
@ -57,6 +59,7 @@ export const IDENTITIES = {
}, },
Lesbian: { Lesbian: {
url: "/identities/sexuality", url: "/identities/sexuality",
locator: "Lesbian",
images: [ images: [
{ {
src: "/emoji/lesbian_flag.svg", src: "/emoji/lesbian_flag.svg",
@ -298,9 +301,11 @@ export const FAQS = {
}, },
q4: { q4: {
question: `"What do you do?"`, question: `"What do you do?"`,
answer: `Something! I mainly focus on maintaining the services I run at the answer: `Lots of things! Lately, though, I've been focusing on myself and my
moment, Beat Saber streaming, myself and my transition. I could use some transition. I could use some financial support (since I'm currently
financial support, if you're feeling up to it and can afford it!`, unemployed) if you're feeling up to it and can afford it! If you want to
know more about what I do, you can check out "Stuff I do!" from the main
page, and "Support Me?" if you wanna toss me some funds!`,
src: "/images/alexis_shrug.png", src: "/images/alexis_shrug.png",
alt: "Alexis shrugging", alt: "Alexis shrugging",
}, },

View File

@ -8,7 +8,7 @@ export default function Pronouns() {
card_title="Pronouns! Important!" card_title="Pronouns! Important!"
> >
<IDCard <IDCard
title="She / Her" title="She/Her"
info={{ info={{
info: `When you're referring to me, please use the pronouns "She/Her".`, info: `When you're referring to me, please use the pronouns "She/Her".`,
more: `If you need some examples, for whatever reason, here are some from the site you can visit by clicking on the link below!`, more: `If you need some examples, for whatever reason, here are some from the site you can visit by clicking on the link below!`,

View File

@ -8,9 +8,9 @@ export default function Sexuality() {
card_title="Sexuality Details!" card_title="Sexuality Details!"
> >
<IDCard <IDCard
title="Polyamory" title="Polyam"
info={{ info={{
info: `This means that I am okay with having multiple partners!`, info: `Short for "Polyamory", this means that I am okay with having multiple partners!`,
more: `There's a lot I can say about Polyamory, but I feel like if you really want to learn more about it, you might be better off following the link below.`, more: `There's a lot I can say about Polyamory, but I feel like if you really want to learn more about it, you might be better off following the link below.`,
}} }}
url="https://lgbta.wikia.org/wiki/Polyamorous" url="https://lgbta.wikia.org/wiki/Polyamorous"