Skip to content

Commit a17ab5c

Browse files
authored
Change some CSS (#14)
Former-commit-id: 78a3c6a
1 parent 12d042c commit a17ab5c

1 file changed

Lines changed: 30 additions & 36 deletions

File tree

app/src/controls.tsx

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,21 @@ export function Controls(props: {
2626
canvas: Canvas;
2727
}): JSX.Element {
2828
return (
29-
<div class="controls pointer-gaps" role="toolbar" aria-label="Media controls">
30-
{/* Left group */}
31-
<div class="flex gap-inherit">
32-
<Microphone audio={props.camera.audio} />
33-
<Camera video={props.camera.video} room={props.room} />
34-
<Screen video={props.screen.video} audio={props.screen.audio} room={props.room} />
35-
</div>
36-
37-
{/* Center group */}
38-
<div class="flex-1 flex justify-center">
39-
<Chat broadcast={props.camera} />
40-
</div>
41-
42-
{/* Right group */}
43-
<div class="flex gap-inherit">
44-
<Volume room={props.room} />
45-
<ClosedCaptions />
46-
<Advanced />
47-
<Fullscreen canvas={props.canvas} />
48-
</div>
29+
<div
30+
class="fixed bottom-0 left-0 right-0 flex items-end gap-3 p-3 text-shadow-lg text-xl pointer-events-none"
31+
style={{ "z-index": "10" }}
32+
role="toolbar"
33+
aria-label="Media controls"
34+
>
35+
<Microphone audio={props.camera.audio} />
36+
<Camera video={props.camera.video} room={props.room} />
37+
<Screen video={props.screen.video} audio={props.screen.audio} room={props.room} />
38+
<Chat broadcast={props.camera} />
39+
<div style={{ "flex-grow": "1", "pointer-events": "none", "backdrop-filter": "none" }} />
40+
<Volume room={props.room} />
41+
<ClosedCaptions />
42+
<Advanced />
43+
<Fullscreen canvas={props.canvas} />
4944
</div>
5045
);
5146
}
@@ -67,7 +62,7 @@ function Microphone(props: { audio: Publish.Audio }): JSX.Element {
6762
return (
6863
<Tooltip content={root() ? "Disable microphone" : "Enable microphone"} position="top">
6964
<fieldset
70-
class="flex flex-col-reverse"
65+
class="flex flex-col-reverse pointer-events-auto"
7166
aria-label="Microphone controls"
7267
onMouseEnter={() => setHover(true)}
7368
onMouseLeave={() => setHover(false)}
@@ -77,7 +72,7 @@ function Microphone(props: { audio: Publish.Audio }): JSX.Element {
7772
<button
7873
type="button"
7974
onClick={toggle}
80-
class="relative border hover:bg-gray-700 transition-all cursor-pointer p-2"
75+
class="relative border hover:bg-gray-700 transition-all cursor-pointer p-2 backdrop-blur-sm bg-transparent rounded"
8176
role="switch"
8277
aria-checked={!!root()}
8378
aria-label="Toggle microphone"
@@ -98,7 +93,7 @@ function Microphone(props: { audio: Publish.Audio }): JSX.Element {
9893
max="2"
9994
value={volume()}
10095
onInput={(e) => Settings.microphoneGain.set(Number(e.currentTarget.value))}
101-
class="cursor-pointer"
96+
class="cursor-pointer backdrop-blur-sm bg-transparent rounded py-1 px-2 outline-none"
10297
aria-label="Microphone volume"
10398
style={{
10499
"writing-mode": "vertical-rl",
@@ -123,7 +118,7 @@ function Camera(props: { video: Publish.Video; room: Room }): JSX.Element {
123118
<button
124119
type="button"
125120
onClick={toggle}
126-
class="relative border hover:bg-gray-700 transition-all cursor-pointer p-2"
121+
class="relative border hover:bg-gray-700 transition-all cursor-pointer p-2 pointer-events-auto backdrop-blur-sm bg-transparent rounded"
127122
role="switch"
128123
aria-checked={!!media()}
129124
aria-label="Toggle camera"
@@ -153,7 +148,7 @@ function Screen(props: { video: Publish.Video; audio: Publish.Audio; room: Room
153148
<button
154149
type="button"
155150
onClick={toggle}
156-
class="relative border hover:bg-gray-700 transition-all cursor-pointer p-2"
151+
class="relative border hover:bg-gray-700 transition-all cursor-pointer p-2 pointer-events-auto backdrop-blur-sm bg-transparent rounded"
157152
role="switch"
158153
aria-checked={!!media()}
159154
aria-label="Toggle screen sharing"
@@ -289,17 +284,17 @@ function Chat(props: { broadcast: Publish.Broadcast }): JSX.Element {
289284
};
290285

291286
return (
292-
<form id="chat" onSubmit={submit} class="w-full max-w-md">
287+
<form id="chat" onSubmit={submit} class="flex-1 min-w-48">
293288
<input
294289
type="text"
295290
autocomplete="off"
296-
placeholder="type to chat"
291+
placeholder="chat"
297292
ref={setInput}
298293
value={message()}
299294
onInput={(e) => setMessage(e.currentTarget.value)}
300295
aria-label="Chat message"
301296
tabIndex={0}
302-
class="w-full text-center placeholder:text-center"
297+
class="w-full pointer-events-auto backdrop-blur-sm bg-transparent rounded py-1 px-2 outline-none"
303298
/>
304299
</form>
305300
);
@@ -341,7 +336,7 @@ function Volume(props: { room: Room }): JSX.Element {
341336
return (
342337
<Tooltip content={muted() || suspended() ? "Enable audio" : "Disable audio"} position="top">
343338
<fieldset
344-
class="flex flex-col-reverse"
339+
class="flex flex-col-reverse pointer-events-auto"
345340
aria-label="Volume controls"
346341
onMouseEnter={() => setShowSlider(true)}
347342
onMouseLeave={() => setShowSlider(false)}
@@ -354,7 +349,7 @@ function Volume(props: { room: Room }): JSX.Element {
354349
role="switch"
355350
aria-checked={!muted()}
356351
aria-label="Toggle mute"
357-
class="hover:bg-gray-700 transition-all cursor-pointer p-2"
352+
class="hover:bg-gray-700 transition-all cursor-pointer p-2 backdrop-blur-sm bg-transparent rounded"
358353
classList={{ "text-red-500": muted() || suspended() }}
359354
>
360355
{muted() ? <IconVolumeMute /> : <IconVolumeHigh />}
@@ -367,12 +362,11 @@ function Volume(props: { room: Room }): JSX.Element {
367362
max="2"
368363
value={muted() ? 0 : volume()}
369364
onInput={(e) => setVolume(Number(e.currentTarget.value))}
370-
class="cursor-pointer"
365+
class="cursor-pointer backdrop-blur-sm bg-transparent rounded py-1 px-2 outline-none"
371366
aria-label="Output Volume"
372367
style={{
373368
"writing-mode": "vertical-rl",
374369
direction: "rtl",
375-
"vertical-align": "middle",
376370
opacity: opacity(),
377371
}}
378372
/>
@@ -397,7 +391,7 @@ function ClosedCaptions(): JSX.Element {
397391
role="switch"
398392
aria-checked={enabled()}
399393
aria-label="Toggle closed captions"
400-
class="hover:bg-gray-700 transition-all cursor-pointer p-2"
394+
class="hover:bg-gray-700 transition-all cursor-pointer p-2 pointer-events-auto backdrop-blur-sm bg-transparent rounded"
401395
>
402396
{enabled() ? <IconClosedCaption /> : <IconClosedCaptionDisabled />}
403397
</button>
@@ -440,7 +434,7 @@ function Advanced(): JSX.Element {
440434
aria-label="Settings"
441435
aria-expanded={showSettings()}
442436
aria-haspopup="dialog"
443-
class="hover:bg-gray-700 transition-all cursor-pointer p-2"
437+
class="hover:bg-gray-700 transition-all cursor-pointer p-2 backdrop-blur-sm bg-transparent rounded"
444438
>
445439
<IconSettings />
446440
</button>
@@ -475,7 +469,7 @@ function Fullscreen(props: { canvas: Canvas }): JSX.Element {
475469
type="button"
476470
onClick={toggle}
477471
aria-label="Toggle fullscreen"
478-
class="hover:bg-gray-700 transition-all cursor-pointer p-2"
472+
class="hover:bg-gray-700 transition-all cursor-pointer p-2 pointer-events-auto backdrop-blur-sm bg-transparent rounded"
479473
>
480474
<IconFullscreen />
481475
</button>
@@ -520,4 +514,4 @@ function Opacity(fn: () => boolean): Accessor<number> {
520514
});
521515

522516
return opacity;
523-
}
517+
}

0 commit comments

Comments
 (0)