From 138464759f45a463104bfc6ca92a118e7a74101c Mon Sep 17 00:00:00 2001 From: 0neGal Date: Fri, 14 Jun 2024 23:30:39 +0200 Subject: initial gamepad/keyboard navigation support Far from complete, but this does the bulk of the work, the rest is just fixing places where the selection moves in weird ways after doing some things, and overall improving the look and feel of it. --- src/app/css/selection.css | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/app/css/selection.css (limited to 'src/app/css/selection.css') diff --git a/src/app/css/selection.css b/src/app/css/selection.css new file mode 100644 index 0000000..04e1d5d --- /dev/null +++ b/src/app/css/selection.css @@ -0,0 +1,19 @@ +#selection { + z-index: 99999999999999; + + transition: 0.15s ease-in-out; + transition-property: + opacity, border-radius, + transform, width, height, top, left; + + position: fixed; + pointer-events: none; + transform: scale(1.0); + background: rgba(255, 255, 255, 0.3); + border-radius: calc(var(--padding) / 2); +} + +#selection.keyboard-selecting, +#selection.controller-selecting { + transform: scale(1.1); +} -- cgit v1.2.3 From fce388b3d9b520459413988e190f916f334a8d48 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Wed, 19 Jun 2024 23:24:47 +0200 Subject: proper gamepad element scrolling support --- src/app/css/selection.css | 6 ++- src/app/index.html | 6 +-- src/app/js/navigate.js | 112 ++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 116 insertions(+), 8 deletions(-) (limited to 'src/app/css/selection.css') diff --git a/src/app/css/selection.css b/src/app/css/selection.css index 04e1d5d..5b7d647 100644 --- a/src/app/css/selection.css +++ b/src/app/css/selection.css @@ -3,7 +3,7 @@ transition: 0.15s ease-in-out; transition-property: - opacity, border-radius, + opacity, border-radius, background, transform, width, height, top, left; position: fixed; @@ -13,6 +13,10 @@ border-radius: calc(var(--padding) / 2); } +:has(.active-selection.scroll-selection) #selection { + background: rgba(255, 255, 255, 0.2); +} + #selection.keyboard-selecting, #selection.controller-selecting { transform: scale(1.1); diff --git a/src/app/index.html b/src/app/index.html index 40b64a0..1f9f443 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -228,7 +228,7 @@ - +