aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/screenshare.js
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-08-10 19:04:54 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-10 22:34:54 +0530
commit969eda02a66050cf4518ddfa657e86d1d6d8b6c3 (patch)
tree9f21b062f0c188f2c3ddfbb6594670982610aadf /src/webview/screenshare.js
parentrefactor: Move platform-specific logic for shortcut keys into common location. (diff)
downloadferdium-app-969eda02a66050cf4518ddfa657e86d1d6d8b6c3.tar.gz
ferdium-app-969eda02a66050cf4518ddfa657e86d1d6d8b6c3.tar.zst
ferdium-app-969eda02a66050cf4518ddfa657e86d1d6d8b6c3.zip
feat: follow OS reduced motion setting (#1757)
- add missing meta charset to index.html - dont restrict scaling for user in index.html - load animations.css conditionally based on motion preference - load transitions conditionally in js and css based on motion preference Co-authored-by: Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>
Diffstat (limited to 'src/webview/screenshare.js')
-rw-r--r--src/webview/screenshare.js16
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';
3const CANCEL_ID = 'desktop-capturer-selection__cancel'; 3const CANCEL_ID = 'desktop-capturer-selection__cancel';
4 4
5export async function getDisplayMediaSelector() { 5export 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,