Skip to content

Commit

Permalink
ui: make spectator accessed via tab
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Spanos committed Mar 13, 2024
1 parent a3c90fa commit 35c18bd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ui/src/components/card/votingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const VotingCard: Component<{
}> = (_props) => {
const props = mergeProps({ selected: false }, _props);
return (
<div
<button
classList={{ "voting-card": true, selected: props.selected }}
data-testid={`voting-card-${props.points}`}
onClick={props.action}
Expand All @@ -20,6 +20,6 @@ export const VotingCard: Component<{
<img src={`/cup-small-${props.selected ? "white" : "black"}.svg`} />
</Match>
</Switch>
</div>
</button>
);
};
7 changes: 5 additions & 2 deletions ui/src/components/toggle/toggle.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
width: 10px;
height: 10px;
}

.switch:has(input:focus) {
outline: 2px solid black;
}
/* The slider */
.slider {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/toggle/toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const Toggle: Component<{
return (
<div class="toggle-container">
<label for={props.name}>{props.label}</label>
<label class="switch">
<label class="switch" >
<input
disabled={props.disabled}
name={props.name}
Expand Down
1 change: 0 additions & 1 deletion ui/src/pages/room/room.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const Room: Component = () => {
});
createEffect(() => {
if (roomEl()) {
console.log('to register esc event lsitener')
window.addEventListener('keyup', (e: KeyboardEvent) => {
if (e.key === 'Escape' && revealing()) {
cancelReveal(socket())();
Expand Down
1 change: 1 addition & 0 deletions ui/src/pages/room/subheader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const RoomSubheader: Component = () => {
return (
<div class="room-subheader">
<span
tabindex="0"
class="primary cursor-pointer"
onClick={() => {
navigator.clipboard.writeText(location.href);
Expand Down
4 changes: 4 additions & 0 deletions ui/src/styles/input.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
input {
height: 48px;
&:focus {
outline: 2px solid black;
}
}

0 comments on commit 35c18bd

Please sign in to comment.