diff options
Diffstat (limited to 'src/webview/screenshare.js')
-rw-r--r-- | src/webview/screenshare.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/webview/screenshare.js b/src/webview/screenshare.js index ab548a625..e7e43c04e 100644 --- a/src/webview/screenshare.js +++ b/src/webview/screenshare.js | |||
@@ -3,17 +3,23 @@ import { desktopCapturer } from 'electron'; | |||
3 | const CANCEL_ID = 'desktop-capturer-selection__cancel'; | 3 | const CANCEL_ID = 'desktop-capturer-selection__cancel'; |
4 | 4 | ||
5 | export async function getDisplayMediaSelector() { | 5 | export async function getDisplayMediaSelector() { |
6 | const sources = await desktopCapturer.getSources({ types: ['screen', 'window'] }); | 6 | const sources = await desktopCapturer.getSources({ |
7 | types: ['screen', 'window'], | ||
8 | }); | ||
7 | return `<div class="desktop-capturer-selection__scroller"> | 9 | return `<div class="desktop-capturer-selection__scroller"> |
8 | <ul class="desktop-capturer-selection__list"> | 10 | <ul class="desktop-capturer-selection__list"> |
9 | ${sources.map(({ id, name, thumbnail }) => ` | 11 | ${sources |
12 | .map( | ||
13 | ({ id, name, thumbnail }) => ` | ||
10 | <li class="desktop-capturer-selection__item"> | 14 | <li class="desktop-capturer-selection__item"> |
11 | <button class="desktop-capturer-selection__btn" data-id="${id}" title="${name}"> | 15 | <button class="desktop-capturer-selection__btn" data-id="${id}" title="${name}"> |
12 | <img class="desktop-capturer-selection__thumbnail" src="${thumbnail.toDataURL()}" /> | 16 | <img class="desktop-capturer-selection__thumbnail" src="${thumbnail.toDataURL()}" /> |
13 | <span class="desktop-capturer-selection__name">${name}</span> | 17 | <span class="desktop-capturer-selection__name">${name}</span> |
14 | </button> | 18 | </button> |
15 | </li> | 19 | </li> |
16 | `).join('')} | 20 | `, |
21 | ) | ||
22 | .join('')} | ||
17 | <li class="desktop-capturer-selection__item"> | 23 | <li class="desktop-capturer-selection__item"> |
18 | <button class="desktop-capturer-selection__btn" data-id="${CANCEL_ID}" title="Cancel"> | 24 | <button class="desktop-capturer-selection__btn" data-id="${CANCEL_ID}" title="Cancel"> |
19 | <span class="desktop-capturer-selection__name desktop-capturer-selection__name--cancel">Cancel</span> | 25 | <span class="desktop-capturer-selection__name desktop-capturer-selection__name--cancel">Cancel</span> |
@@ -67,7 +73,9 @@ export const screenShareCss = ` | |||
67 | padding: 4px; | 73 | padding: 4px; |
68 | background: #252626; | 74 | background: #252626; |
69 | text-align: left; | 75 | text-align: left; |
70 | transition: background-color .15s, box-shadow .15s, color .15s; | 76 | @media (prefers-reduced-motion: no-preference) { |
77 | transition: background-color .15s, box-shadow .15s, color .15s; | ||
78 | } | ||
71 | color: #dedede; | 79 | color: #dedede; |
72 | } | 80 | } |
73 | .desktop-capturer-selection__btn:hover, | 81 | .desktop-capturer-selection__btn:hover, |