From dd934e2b465123033770137413c789e5bbd7bd53 Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Sat, 15 Jun 2024 14:42:51 +0300 Subject: [PATCH] Use anchor elements for clickables in big MOS pyramid Makes keyboard navigation possible. ref #753 --- src/components/MosPyramid.vue | 44 +++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/src/components/MosPyramid.vue b/src/components/MosPyramid.vue index 625f7795..b3513512 100644 --- a/src/components/MosPyramid.vue +++ b/src/components/MosPyramid.vue @@ -76,21 +76,26 @@ const generators = computed(() => { @@ -114,18 +119,26 @@ const generators = computed(() => { image { cursor: pointer; } -g { - cursor: pointer; -} rect { fill: var(--color-accent-background); stroke: var(--color-accent-text-btn); stroke-width: 0.01; } -g:hover > rect { +ellipse { + opacity: 0; + transition: opacity 0.5s; +} +a:focus { + outline: none; +} +a:focus > rect, +a:hover > rect { fill: var(--color-accent); stroke: var(--color-accent); } +a:focus > ellipse { + opacity: 1; +} .selected > rect { fill: var(--color-background-mute); stroke-width: 0.02; @@ -134,7 +147,8 @@ text { dominant-baseline: central; fill: var(--color-accent-text-btn); } -g:hover > text { +a:focus > text, +a:hover > text { fill: white; }