Skip to content

Commit 768abb3

Browse files
authored
Merge pull request #80 from BaileyBrightman/fullscreenPlugin
Fullscreen plugin
2 parents e2ec5f3 + a4676b7 commit 768abb3

20 files changed

+4537
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
docs
44
.grunt
55
.env
6+
.DS_Store
67
e2e/client.js
78
local.log
89
.DS_Store

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [2.1.1] - UNRELEASED
88
### Added
99
- This CHANGELOG
10-
- update NPM modules to remove security vulnerabilities
10+
- Fullscreen Plugin. The ability to add in a fullscreen button within container
11+
- Fullscreen Plugin Automated Testing
12+
- Fullscreen Plugin Documentation
13+
14+
15+
- update NPM modules to remove security vulnerabilities

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,56 @@ container.openPath('game.html');
359359
any unsupported values. See [the SpringRoll Application Class docs](https://github.com/SpringRoll/SpringRoll/tree/v2/src#handling-state-change)
360360
for more information on the request format.
361361

362+
### Fullscreen Plugin
363+
The fullscreen plugin hooks up an element or elements to set the iframe to full screen then communicates this through Bellhop. The plugin will also add the class ```'--fullScreen'``` to the element(s) given
364+
365+
```javascript
366+
import { FullScreenPlugin, Container } from 'springroll-container';
367+
368+
const container = new Container('#game', {
369+
370+
plugins: [
371+
// FullScreenPlugin expects the selector for the element(s) to hook onto
372+
new FullScreenPlugin('#fullScreenButton'),
373+
]
374+
});
375+
376+
container.openPath('game.html');
377+
378+
```
379+
380+
The plugin will accept either a selector or an array of selectors as a parameter
381+
382+
```javascript
383+
new FullScreenPlugin('#fullScreenButton');
384+
new FullScreenPlugin(['#fullScreenButton', '.fullScreenButtonSideNav']);
385+
386+
// It will also accept one string with all selectors each seperated by a comma
387+
new FullScreenPlugin('#fullScreenButton, .fullScreenButtonSideNav');
388+
389+
390+
```
391+
392+
The typical html can look something like this however, the element may be positioned anywhere in the html as long as it is not inside the iframe
393+
394+
395+
```html
396+
397+
<nav>
398+
<!-- May be a button or any other element that can create an onclick event -->
399+
<button id='fullScreenButton'>Fullscreen</button>
400+
</nav>
401+
<!-- The element cannot be inside the source file -->
402+
<iframe id="game" scrolling="no"></iframe>
403+
404+
405+
```
406+
isFullScreen returns true if there is a fullscreen element
407+
`` FullScreenPlugin.isFullScreen ``
408+
409+
410+
---
411+
362412
### Multiple Plugin Controls
363413
All Plugins accept one or more HTML elements as controls in their constructor.
364414
For example the SoundPlugin can accept more than one volume slider or button if your set up requires it:

dist/SpringRoll-Container-umd.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll-Container-umd.js.map

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll-umd.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll-umd.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)