diff --git a/Dockerfile b/Dockerfile index bd30c8f..e8325f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM node:20-alpine3.18 AS build +FROM docker.io/node:20-alpine3.18 AS build WORKDIR /app COPY package*.json ./ RUN npm install COPY . . RUN npm run build -FROM nginx:alpine AS runtime +FROM docker.io/nginx:alpine AS runtime COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf COPY --from=build /app/dist /usr/share/nginx/html diff --git a/src/components/about/about.module.css b/src/components/about/about.module.css index aaba9aa..641d30d 100644 --- a/src/components/about/about.module.css +++ b/src/components/about/about.module.css @@ -86,5 +86,9 @@ &:hover { background-color: var(--color-neutral-100); } + + &:focus-visible { + outline: 1px solid white; + } } } diff --git a/src/components/buttons/play/play.module.css b/src/components/buttons/play/play.module.css index f40798a..af84c78 100644 --- a/src/components/buttons/play/play.module.css +++ b/src/components/buttons/play/play.module.css @@ -27,4 +27,8 @@ & span { font-size: var(--font-lg); } + + &:focus-visible { + outline: 1px solid white; + } } diff --git a/src/components/buttons/unselect/unselect.module.css b/src/components/buttons/unselect/unselect.module.css index 797d0a7..23fcdcd 100644 --- a/src/components/buttons/unselect/unselect.module.css +++ b/src/components/buttons/unselect/unselect.module.css @@ -23,6 +23,10 @@ &:hover { background-color: var(--color-neutral-200); } + + &:focus-visible { + outline: 1px solid white; + } } .tooltip { diff --git a/src/components/sound/favorite/favorite.module.css b/src/components/sound/favorite/favorite.module.css index c12cb04..f915be1 100644 --- a/src/components/sound/favorite/favorite.module.css +++ b/src/components/sound/favorite/favorite.module.css @@ -24,4 +24,8 @@ &.isFavorite { color: var(--color-foreground); } + + &:focus-visible { + outline: 1px solid white; + } } diff --git a/src/components/sound/sound.tsx b/src/components/sound/sound.tsx index dba6639..d65bef9 100644 --- a/src/components/sound/sound.tsx +++ b/src/components/sound/sound.tsx @@ -65,20 +65,34 @@ export function Sound({ }, [unselect, setVolume, id]); const toggle = useCallback(() => { - if (isSelected) return _unselect(); + if (isSelected) _unselect(); + else _select(); + }, [isSelected, _select, _unselect]); - _select(); - }, [isSelected, _unselect, _select]); + const handleClick = useCallback(() => { + toggle(); + }, [toggle]); + + const handleKeyDown = useCallback( + (event: React.KeyboardEvent) => { + if (event.key === 'Enter') { + toggle(); + } + }, + [toggle], + ); return (