Skip to content

Commit

Permalink
Merge pull request #10 from synyx/fullscreen-mode
Browse files Browse the repository at this point in the history
Fullscreen mode on presenter page
  • Loading branch information
stwa authored Jun 30, 2020
2 parents 88d9e01 + a7fd705 commit fc92c71
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let onNavigate = url => {
case "#presenter":
trigger("page/activate", "presenter");
trigger("projects/activate", args[0]);
trigger("viewport/fullscreen", true);
break;
default:
trigger("page/activate", "home");
Expand Down
25 changes: 24 additions & 1 deletion js/viewport.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
import { db, connector, connect, handler, withInputSignals } from "flyps";
import {
db,
connector,
connect,
effector,
handler,
withInputSignals,
} from "flyps";
import { h } from "flyps-dom-snabbdom";
import { mat4 } from "gl-matrix";

let matrix3d = mat => `matrix3d(${mat.join(",")})`;

/**
* effectors
*/

effector("fullscreen", fullscreen => {
if (fullscreen) {
document.documentElement.requestFullscreen({ navigationUI: "hide" });
} else {
document.exitFullscreen();
}
});

/**
* connectors
*/
Expand Down Expand Up @@ -59,6 +78,10 @@ function dbHandler(eventId, handlerFn, interceptors) {

dbHandler("viewport/set-rect", (db, id, rect) => setViewportRect(db, rect));

handler("viewport/fullscreen", (_causes, _id, fullscreen) => ({
fullscreen: fullscreen,
}));

/**
* views
*/
Expand Down

0 comments on commit fc92c71

Please sign in to comment.