Skip to content

Commit 397a793

Browse files
authored
Fullscreen updates (#628)
* Improve fullscreen visibility & add shortcut * Update docs * Update DeckProps interface
1 parent bb2a4a5 commit 397a793

File tree

15 files changed

+408
-192
lines changed

15 files changed

+408
-192
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,13 @@ You can toggle the presenter or overview mode by pressing respectively `alt+p` a
279279
| Alt/Option + P | Toggle Presenter Mode |
280280
| Alt/Option + T | Toggle Timer in Presenter Mode |
281281
| Alt/Option + A | Start autoplay (if enabled) |
282+
| Alt/Option + F | Toggle Fullscreen Mode |
282283

283284
<a name="fullscreen"></a>
284285

285286
## Fullscreen
286287

287-
Fullscreen can be toggled via browser options, or by hovering over the bottom right corner of your window until the fullscreen icon appears and clicking it.
288+
Fullscreen can be toggled via browser options, <kbd>Alt/Option</kbd> + <kbd>F</kbd>, or by pressing the button in the bottom right corner of your window.
288289

289290
<a name="pdf-export"></a>
290291

@@ -484,6 +485,7 @@ The Deck tag is the root level tag for your presentation. It supports the follow
484485
| onStateChange | PropTypes.func | Called whenever a new slide becomes visible with the arguments `(previousState, nextState)` where state refers to the outgoing and incoming `<Slide />`'s `state` props, respectively. The default implementation attaches the current state as a class to the document root. | see description |
485486
| history | PropTypes.object | Accepts custom configuration for [history](https://github.com/ReactTraining/history). | |
486487
| progress | PropTypes.string | Accepts `pacman`, `bar`, `number` or `none`. To override the color, change the 'quaternary' color in the theme. | `pacman` |
488+
| showFullscreenControl | PropTypes.bool | Show the fullscreen control button in bottom right of the screen. | `true` |
487489
| theme | PropTypes.object | Accepts a theme object for styling your presentation. | |
488490
| transition | PropTypes.array | Accepts `slide`, `zoom`, `fade` or `spin`, and can be combined. Sets global slide transitions. **Note: If you use the 'scale' transition, fitted text won't work in Safari.** | |
489491
| transitionDuration | PropTypes.number | Accepts integer value in milliseconds for global transition duration. | `500` |

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ declare module 'spectacle' {
160160
controls?: boolean;
161161
globalStyles?: boolean;
162162
history?: any; // Needs a type, see https://github.com/ReactTraining/history
163+
showFullscreenControl?: boolean;
163164
onStateChange?: (previousState?: string, nextState?: string) => void;
164165
progress?: progressType;
165166
theme?: Theme;

src/components/__snapshots__/component-playground.test.js.snap

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ exports[`<ComponentPlayground /> Should render the dark theme correctly 1`] = `
2121
class="css-1a7vuu6 ev51h780"
2222
>
2323
<svg
24-
viewBox="0 0 24 24"
24+
viewBox="0 0 512 512"
2525
>
2626
<path
27-
d="M0 0h24v24H0z"
28-
fill="none"
29-
/>
30-
<path
31-
d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"
27+
d="M64 371.2h76.795V448H192V320H64v51.2zm76.795-230.4H64V192h128V64h-51.205v76.8zM320 448h51.2v-76.8H448V320H320v128zm51.2-307.2V64H320v128h128v-51.2h-76.8z"
3228
fill="currentColor"
3329
/>
3430
</svg>
@@ -557,14 +553,10 @@ exports[`<ComponentPlayground /> Should render the light theme correctly 1`] = `
557553
class="css-1a7vuu6 ev51h780"
558554
>
559555
<svg
560-
viewBox="0 0 24 24"
556+
viewBox="0 0 512 512"
561557
>
562558
<path
563-
d="M0 0h24v24H0z"
564-
fill="none"
565-
/>
566-
<path
567-
d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"
559+
d="M64 371.2h76.795V448H192V320H64v51.2zm76.795-230.4H64V192h128V64h-51.205v76.8zM320 448h51.2v-76.8H448V320H320v128zm51.2-307.2V64H320v128h128v-51.2h-76.8z"
568560
fill="currentColor"
569561
/>
570562
</svg>
@@ -1093,14 +1085,10 @@ exports[`<ComponentPlayground /> Should render with a custom background color 1`
10931085
class="css-1a7vuu6 ev51h780"
10941086
>
10951087
<svg
1096-
viewBox="0 0 24 24"
1088+
viewBox="0 0 512 512"
10971089
>
10981090
<path
1099-
d="M0 0h24v24H0z"
1100-
fill="none"
1101-
/>
1102-
<path
1103-
d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"
1091+
d="M64 371.2h76.795V448H192V320H64v51.2zm76.795-230.4H64V192h128V64h-51.205v76.8zM320 448h51.2v-76.8H448V320H320v128zm51.2-307.2V64H320v128h128v-51.2h-76.8z"
11041092
fill="currentColor"
11051093
/>
11061094
</svg>
@@ -1629,14 +1617,10 @@ exports[`<ComponentPlayground /> Should render with a custom code block 1`] = `
16291617
class="css-1a7vuu6 ev51h780"
16301618
>
16311619
<svg
1632-
viewBox="0 0 24 24"
1620+
viewBox="0 0 512 512"
16331621
>
16341622
<path
1635-
d="M0 0h24v24H0z"
1636-
fill="none"
1637-
/>
1638-
<path
1639-
d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"
1623+
d="M64 371.2h76.795V448H192V320H64v51.2zm76.795-230.4H64V192h128V64h-51.205v76.8zM320 448h51.2v-76.8H448V320H320v128zm51.2-307.2V64H320v128h128v-51.2h-76.8z"
16401624
fill="currentColor"
16411625
/>
16421626
</svg>

src/components/__snapshots__/fullscreen.test.js.snap

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`<Fullscreen /> should render correctly. 1`] = `
4-
<Fullscreen>
4+
<Fullscreen
5+
onClick={[Function]}
6+
>
57
<Styled(FullscreenButton)
8+
isFullscreen={false}
69
onClick={[Function]}
710
styles={undefined}
8-
viewBox="0 0 512 512"
911
>
1012
<FullscreenButton
11-
className="css-12n5ud e4v3eea0"
13+
className="css-12w3q3u e4v3eea0"
14+
isFullscreen={false}
1215
onClick={[Function]}
1316
styles={undefined}
14-
viewBox="0 0 512 512"
1517
>
1618
<Styled(button)
1719
aria-label="Toggle full screen"
18-
className="css-12n5ud e4v3eea0"
20+
className="css-12w3q3u e4v3eea0"
1921
onClick={[Function]}
2022
styles={undefined}
21-
viewBox="0 0 512 512"
2223
>
2324
<button
2425
aria-label="Toggle full screen"
25-
className="e4v3eea0 css-1hv29sw ev51h780"
26+
className="e4v3eea0 css-11lfetj ev51h780"
2627
onClick={[Function]}
27-
viewBox="0 0 512 512"
2828
>
2929
<svg
30-
viewBox="0 0 24 24"
30+
viewBox="0 0 512 512"
3131
>
3232
<path
33-
d="M0 0h24v24H0z"
34-
fill="none"
35-
/>
36-
<path
37-
d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"
33+
d="M396.795 396.8H320V448h128V320h-51.205zM396.8 115.205V192H448V64H320v51.205zM115.205 115.2H192V64H64v128h51.205zM115.2 396.795V320H64v128h128v-51.205z"
3834
fill="currentColor"
3935
/>
4036
</svg>

0 commit comments

Comments
 (0)