Add titles to social icons and update URLs

Added titles to the social icons for better accessibility and updated the URLs for each social platform in the navigation component. Also added an aria-label to the LanguagePicker component and included the icon title in the Icon.astro file.
This commit is contained in:
Emil Gulamov 2024-03-31 00:48:41 +04:00
parent 007e23dd23
commit 559569cf1c
4 changed files with 11 additions and 5 deletions

View file

@ -7,6 +7,7 @@ import Icon from "./icons/Icon.astro";
<button <button
id="hs-dropdown-default" id="hs-dropdown-default"
type="button" type="button"
aria-label="Change language"
class="hs-dropdown-toggle inline-flex items-center gap-x-2 rounded-lg px-1.5 py-1.5 text-sm font-medium text-neutral-600 outline-none ring-zinc-500 transition duration-300 hover:bg-neutral-200 hover:text-[#fa5a15] dark:border-neutral-700 dark:text-neutral-400 dark:ring-zinc-200 dark:hover:bg-neutral-700 dark:hover:text-[#fb713b] dark:focus:outline-none" class="hs-dropdown-toggle inline-flex items-center gap-x-2 rounded-lg px-1.5 py-1.5 text-sm font-medium text-neutral-600 outline-none ring-zinc-500 transition duration-300 hover:bg-neutral-200 hover:text-[#fa5a15] dark:border-neutral-700 dark:text-neutral-400 dark:ring-zinc-200 dark:hover:bg-neutral-700 dark:hover:text-[#fb713b] dark:focus:outline-none"
> >
<Icon name="earth" /> <Icon name="earth" />

View file

@ -27,7 +27,7 @@ let paths: Path[] = icon.paths || [];
stroke-width={icon.strokeWidth} stroke-width={icon.strokeWidth}
stroke-linecap={icon.strokeLinecap} stroke-linecap={icon.strokeLinecap}
stroke-linejoin={icon.strokeLinejoin} stroke-linejoin={icon.strokeLinejoin}
> ><title>{icon.title}</title>
{paths.map((path: Path) => ( {paths.map((path: Path) => (
<path d={path.d} class={path.class || ""} /> <path d={path.d} class={path.class || ""} />
))} ))}

View file

@ -285,6 +285,7 @@ export const Icons = {
"h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400", "h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400",
viewBox: "0 0 24 24", viewBox: "0 0 24 24",
fill: "currentColor", fill: "currentColor",
title: "Twitter",
}, },
facebookFooter: { facebookFooter: {
paths: [ paths: [
@ -296,6 +297,7 @@ export const Icons = {
"h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400", "h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400",
viewBox: "0 0 24 24", viewBox: "0 0 24 24",
fill: "currentColor", fill: "currentColor",
title: "Facebook",
}, },
githubFooter: { githubFooter: {
paths: [ paths: [
@ -307,6 +309,7 @@ export const Icons = {
"h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400", "h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400",
viewBox: "0 0 24 24", viewBox: "0 0 24 24",
fill: "currentColor", fill: "currentColor",
title: "GitHub",
}, },
googleFooter: { googleFooter: {
paths: [ paths: [
@ -318,6 +321,7 @@ export const Icons = {
"h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400", "h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400",
viewBox: "0 0 24 24", viewBox: "0 0 24 24",
fill: "currentColor", fill: "currentColor",
title: "Google",
}, },
slackFooter: { slackFooter: {
paths: [ paths: [
@ -329,6 +333,7 @@ export const Icons = {
"h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400", "h-4 w-4 flex-shrink-0 fill-current text-neutral-700 dark:text-neutral-400",
viewBox: "0 0 24 24", viewBox: "0 0 24 24",
fill: "currentColor", fill: "currentColor",
title: "Slack",
}, },
quotation: { quotation: {
paths: [ paths: [

View file

@ -28,11 +28,11 @@ const footerLinks = [
]; ];
// An object of links for social icons // An object of links for social icons
const socialLinks = { const socialLinks = {
facebook: "#", facebook: "https://www.facebook.com/",
x: "#", x: "https://twitter.com/",
github: "https://github.com/mearashadowfax/ScrewFast", github: "https://github.com/mearashadowfax/ScrewFast",
google: "#", google: "https://www.google.com/",
slack: "#", slack: "https://slack.com/",
}; };
export default { export default {